diff options
Diffstat (limited to 'deps/v8/src/full-codegen.h')
-rw-r--r-- | deps/v8/src/full-codegen.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/deps/v8/src/full-codegen.h b/deps/v8/src/full-codegen.h index f0328547fd..1439942db8 100644 --- a/deps/v8/src/full-codegen.h +++ b/deps/v8/src/full-codegen.h @@ -586,6 +586,19 @@ class FullCodeGenerator: public AstVisitor { // is expected in the accumulator. void EmitAssignment(Expression* expr); + // Shall an error be thrown if assignment with 'op' operation is perfomed + // on this variable in given language mode? + static bool IsSignallingAssignmentToConst(Variable* var, Token::Value op, + StrictMode strict_mode) { + if (var->mode() == CONST) return op != Token::INIT_CONST; + + if (var->mode() == CONST_LEGACY) { + return strict_mode == STRICT && op != Token::INIT_CONST_LEGACY; + } + + return false; + } + // Complete a variable assignment. The right-hand-side value is expected // in the accumulator. void EmitVariableAssignment(Variable* var, @@ -614,6 +627,15 @@ class FullCodeGenerator: public AstVisitor { void EmitLoadHomeObject(SuperReference* expr); + static bool NeedsHomeObject(Expression* expr) { + return FunctionLiteral::NeedsHomeObject(expr); + } + + // Adds the [[HomeObject]] to |initializer| if it is a FunctionLiteral. + // The value of the initializer is expected to be at the top of the stack. + // |offset| is the offset in the stack where the home object can be found. + void EmitSetHomeObjectIfNeeded(Expression* initializer, int offset); + void EmitLoadSuperConstructor(SuperReference* expr); void CallIC(Handle<Code> code, @@ -873,6 +895,22 @@ class FullCodeGenerator: public AstVisitor { virtual bool IsEffect() const { return true; } }; + class EnterBlockScopeIfNeeded { + public: + EnterBlockScopeIfNeeded(FullCodeGenerator* codegen, Scope* scope, + BailoutId entry_id, BailoutId declarations_id, + BailoutId exit_id); + ~EnterBlockScopeIfNeeded(); + + private: + MacroAssembler* masm() const { return codegen_->masm(); } + + FullCodeGenerator* codegen_; + Scope* scope_; + Scope* saved_scope_; + BailoutId exit_id_; + }; + MacroAssembler* masm_; CompilationInfo* info_; Scope* scope_; |