| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_INTERPRETER_BYTECODE_GENERATOR_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_GENERATOR_H_ |
| 6 #define V8_INTERPRETER_BYTECODE_GENERATOR_H_ | 6 #define V8_INTERPRETER_BYTECODE_GENERATOR_H_ |
| 7 | 7 |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/interpreter/bytecode-array-builder.h" | 9 #include "src/interpreter/bytecode-array-builder.h" |
| 10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 class ControlScopeForBreakable; | 35 class ControlScopeForBreakable; |
| 36 class ControlScopeForIteration; | 36 class ControlScopeForIteration; |
| 37 class ControlScopeForTopLevel; | 37 class ControlScopeForTopLevel; |
| 38 class ControlScopeForTryCatch; | 38 class ControlScopeForTryCatch; |
| 39 class ControlScopeForTryFinally; | 39 class ControlScopeForTryFinally; |
| 40 class ExpressionResultScope; | 40 class ExpressionResultScope; |
| 41 class EffectResultScope; | 41 class EffectResultScope; |
| 42 class AccumulatorResultScope; | 42 class AccumulatorResultScope; |
| 43 class RegisterResultScope; | 43 class RegisterResultScope; |
| 44 class RegisterAllocationScope; | 44 class RegisterAllocationScope; |
| 45 class SuperPropertyArguments; | |
| 46 | 45 |
| 47 void MakeBytecodeBody(); | 46 void MakeBytecodeBody(); |
| 48 | 47 |
| 49 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); | 48 DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); |
| 50 | 49 |
| 51 // Dispatched from VisitBinaryOperation. | 50 // Dispatched from VisitBinaryOperation. |
| 52 void VisitArithmeticExpression(BinaryOperation* binop); | 51 void VisitArithmeticExpression(BinaryOperation* binop); |
| 53 void VisitCommaExpression(BinaryOperation* binop); | 52 void VisitCommaExpression(BinaryOperation* binop); |
| 54 void VisitLogicalOrExpression(BinaryOperation* binop); | 53 void VisitLogicalOrExpression(BinaryOperation* binop); |
| 55 void VisitLogicalAndExpression(BinaryOperation* binop); | 54 void VisitLogicalAndExpression(BinaryOperation* binop); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); | 86 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); |
| 88 void VisitVariableLoadForAccumulatorValue( | 87 void VisitVariableLoadForAccumulatorValue( |
| 89 Variable* variable, FeedbackVectorSlot slot, | 88 Variable* variable, FeedbackVectorSlot slot, |
| 90 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); | 89 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); |
| 91 MUST_USE_RESULT Register | 90 MUST_USE_RESULT Register |
| 92 VisitVariableLoadForRegisterValue(Variable* variable, FeedbackVectorSlot slot, | 91 VisitVariableLoadForRegisterValue(Variable* variable, FeedbackVectorSlot slot, |
| 93 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); | 92 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); |
| 94 void VisitVariableAssignment(Variable* variable, Token::Value op, | 93 void VisitVariableAssignment(Variable* variable, Token::Value op, |
| 95 FeedbackVectorSlot slot); | 94 FeedbackVectorSlot slot); |
| 96 | 95 |
| 97 void PrepareNamedSuperPropertyArguments( | 96 void BuildNamedSuperPropertyStore(Register receiver, Register home_object, |
| 98 SuperPropertyReference* super_property, Handle<Name> name, | 97 Register name, Register value); |
| 99 SuperPropertyArguments* super_property_args); | 98 void BuildKeyedSuperPropertyStore(Register receiver, Register home_object, |
| 100 void PrepareKeyedSuperPropertyArguments( | 99 Register key, Register value); |
| 101 SuperPropertyReference* super_property, Expression* key, | 100 void BuildNamedSuperPropertyLoad(Register receiver, Register home_object, |
| 102 SuperPropertyArguments* super_property_args); | 101 Register name); |
| 103 void BuildNamedSuperPropertyLoad(SuperPropertyArguments* super_property_args); | 102 void BuildKeyedSuperPropertyLoad(Register receiver, Register home_object, |
| 104 void BuildKeyedSuperPropertyLoad(SuperPropertyArguments* super_property_args); | 103 Register key); |
| 105 void BuildNamedSuperPropertyStore( | |
| 106 SuperPropertyArguments* super_property_args); | |
| 107 void BuildKeyedSuperPropertyStore( | |
| 108 SuperPropertyArguments* super_property_args); | |
| 109 | 104 |
| 110 void BuildThrowIfHole(Handle<String> name); | 105 void BuildThrowIfHole(Handle<String> name); |
| 111 void BuildThrowIfNotHole(Handle<String> name); | 106 void BuildThrowIfNotHole(Handle<String> name); |
| 112 void BuildThrowReassignConstant(Handle<String> name); | 107 void BuildThrowReassignConstant(Handle<String> name); |
| 113 void BuildThrowReferenceError(Handle<String> name); | 108 void BuildThrowReferenceError(Handle<String> name); |
| 114 void BuildHoleCheckForVariableLoad(VariableMode mode, Handle<String> name); | 109 void BuildHoleCheckForVariableLoad(VariableMode mode, Handle<String> name); |
| 115 void BuildHoleCheckForVariableAssignment(Variable* variable, Token::Value op); | 110 void BuildHoleCheckForVariableAssignment(Variable* variable, Token::Value op); |
| 116 | 111 |
| 117 void VisitArgumentsObject(Variable* variable); | 112 void VisitArgumentsObject(Variable* variable); |
| 118 void VisitRestArgumentsArray(Variable* rest); | 113 void VisitRestArgumentsArray(Variable* rest); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 142 void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop_builder); | 137 void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop_builder); |
| 143 | 138 |
| 144 // Visit a statement and switch scopes, the context is in the accumulator. | 139 // Visit a statement and switch scopes, the context is in the accumulator. |
| 145 void VisitInScope(Statement* stmt, Scope* scope); | 140 void VisitInScope(Statement* stmt, Scope* scope); |
| 146 | 141 |
| 147 // Visitors for obtaining expression result in the accumulator, in a | 142 // Visitors for obtaining expression result in the accumulator, in a |
| 148 // register, or just getting the effect. | 143 // register, or just getting the effect. |
| 149 void VisitForAccumulatorValue(Expression* expr); | 144 void VisitForAccumulatorValue(Expression* expr); |
| 150 void VisitForAccumulatorValueOrTheHole(Expression* expr); | 145 void VisitForAccumulatorValueOrTheHole(Expression* expr); |
| 151 MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr); | 146 MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr); |
| 147 void VisitForRegisterValue(Expression* expr, Register destination); |
| 152 void VisitForEffect(Expression* expr); | 148 void VisitForEffect(Expression* expr); |
| 153 | 149 |
| 154 // Methods for tracking and remapping register. | 150 // Methods for tracking and remapping register. |
| 155 void RecordStoreToRegister(Register reg); | 151 void RecordStoreToRegister(Register reg); |
| 156 Register LoadFromAliasedRegister(Register reg); | 152 Register LoadFromAliasedRegister(Register reg); |
| 157 | 153 |
| 158 // Methods for tracking try-block nesting. | 154 // Methods for tracking try-block nesting. |
| 159 bool IsInsideTryCatch() const { return try_catch_nesting_level_ > 0; } | 155 bool IsInsideTryCatch() const { return try_catch_nesting_level_ > 0; } |
| 160 bool IsInsideTryFinally() const { return try_finally_nesting_level_ > 0; } | 156 bool IsInsideTryFinally() const { return try_finally_nesting_level_ > 0; } |
| 161 | 157 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 RegisterAllocationScope* register_allocator_; | 206 RegisterAllocationScope* register_allocator_; |
| 211 int try_catch_nesting_level_; | 207 int try_catch_nesting_level_; |
| 212 int try_finally_nesting_level_; | 208 int try_finally_nesting_level_; |
| 213 }; | 209 }; |
| 214 | 210 |
| 215 } // namespace interpreter | 211 } // namespace interpreter |
| 216 } // namespace internal | 212 } // namespace internal |
| 217 } // namespace v8 | 213 } // namespace v8 |
| 218 | 214 |
| 219 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ | 215 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ |
| OLD | NEW |