diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-02-09 10:24:26 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-02-09 10:24:26 -0800 |
commit | a0702b54d1db35a6006644882c0b5420d8670958 (patch) | |
tree | e246bb342237e8caabd45450301cb7cc5e4ccf24 /deps/v8/src/compiler.h | |
parent | a48a0755358d322f4a593d09c331432c10a500bc (diff) | |
download | node-new-a0702b54d1db35a6006644882c0b5420d8670958.tar.gz |
Upgrade V8 to 3.1.2
Diffstat (limited to 'deps/v8/src/compiler.h')
-rw-r--r-- | deps/v8/src/compiler.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/deps/v8/src/compiler.h b/deps/v8/src/compiler.h index 44ac9c85ce..9843dd6452 100644 --- a/deps/v8/src/compiler.h +++ b/deps/v8/src/compiler.h @@ -49,6 +49,7 @@ class CompilationInfo BASE_EMBEDDED { bool is_lazy() const { return (flags_ & IsLazy::mask()) != 0; } bool is_eval() const { return (flags_ & IsEval::mask()) != 0; } bool is_global() const { return (flags_ & IsGlobal::mask()) != 0; } + bool is_strict() const { return (flags_ & IsStrict::mask()) != 0; } bool is_in_loop() const { return (flags_ & IsInLoop::mask()) != 0; } FunctionLiteral* function() const { return function_; } Scope* scope() const { return scope_; } @@ -69,6 +70,13 @@ class CompilationInfo BASE_EMBEDDED { ASSERT(!is_lazy()); flags_ |= IsGlobal::encode(true); } + void MarkAsStrict() { + ASSERT(!is_lazy()); + flags_ |= IsStrict::encode(true); + } + StrictModeFlag StrictMode() { + return is_strict() ? kStrictMode : kNonStrictMode; + } void MarkAsInLoop() { ASSERT(is_lazy()); flags_ |= IsInLoop::encode(true); @@ -162,6 +170,8 @@ class CompilationInfo BASE_EMBEDDED { class IsGlobal: public BitField<bool, 2, 1> {}; // Flags that can be set for lazy compilation. class IsInLoop: public BitField<bool, 3, 1> {}; + // Strict mode - used in eager compilation. + class IsStrict: public BitField<bool, 4, 1> {}; unsigned flags_; @@ -230,7 +240,8 @@ class Compiler : public AllStatic { // Compile a String source within a context for Eval. static Handle<SharedFunctionInfo> CompileEval(Handle<String> source, Handle<Context> context, - bool is_global); + bool is_global, + StrictModeFlag strict_mode); // Compile from function info (used for lazy compilation). Returns true on // success and false if the compilation resulted in a stack overflow. |