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/bytecode-label.h" | 10 #include "src/interpreter/bytecode-label.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 // Dispatched from VisitUnaryOperation. | 66 // Dispatched from VisitUnaryOperation. |
67 void VisitVoid(UnaryOperation* expr); | 67 void VisitVoid(UnaryOperation* expr); |
68 void VisitTypeOf(UnaryOperation* expr); | 68 void VisitTypeOf(UnaryOperation* expr); |
69 void VisitNot(UnaryOperation* expr); | 69 void VisitNot(UnaryOperation* expr); |
70 void VisitDelete(UnaryOperation* expr); | 70 void VisitDelete(UnaryOperation* expr); |
71 | 71 |
72 // Used by flow control routines to evaluate loop condition. | 72 // Used by flow control routines to evaluate loop condition. |
73 void VisitCondition(Expression* expr); | 73 void VisitCondition(Expression* expr); |
74 | 74 |
75 // Visit the arguments expressions in |args| and store them in |args_regs| | 75 // Visit the arguments expressions in |args| and store them in |args_regs|, |
76 // starting at register |first_argument_register| in the list. | 76 // growing |args_regs| for each argument visited. |
77 void VisitArguments(ZoneList<Expression*>* args, RegisterList arg_regs, | 77 void VisitArguments(ZoneList<Expression*>* args, RegisterList* arg_regs); |
78 size_t first_argument_register = 0); | |
79 | 78 |
80 // Visit a keyed super property load. The optional | 79 // Visit a keyed super property load. The optional |
81 // |opt_receiver_out| register will have the receiver stored to it | 80 // |opt_receiver_out| register will have the receiver stored to it |
82 // if it's a valid register. The loaded value is placed in the | 81 // if it's a valid register. The loaded value is placed in the |
83 // accumulator. | 82 // accumulator. |
84 void VisitKeyedSuperPropertyLoad(Property* property, | 83 void VisitKeyedSuperPropertyLoad(Property* property, |
85 Register opt_receiver_out); | 84 Register opt_receiver_out); |
86 | 85 |
87 // Visit a named super property load. The optional | 86 // Visit a named super property load. The optional |
88 // |opt_receiver_out| register will have the receiver stored to it | 87 // |opt_receiver_out| register will have the receiver stored to it |
89 // if it's a valid register. The loaded value is placed in the | 88 // if it's a valid register. The loaded value is placed in the |
90 // accumulator. | 89 // accumulator. |
91 void VisitNamedSuperPropertyLoad(Property* property, | 90 void VisitNamedSuperPropertyLoad(Property* property, |
92 Register opt_receiver_out); | 91 Register opt_receiver_out); |
93 | 92 |
94 void VisitPropertyLoad(Register obj, Property* expr); | 93 void VisitPropertyLoad(Register obj, Property* expr); |
95 void VisitPropertyLoadForAccumulator(Register obj, Property* expr); | 94 void VisitPropertyLoadForRegister(Register obj, Property* expr, |
| 95 Register destination); |
96 | 96 |
97 void BuildVariableLoad(Variable* variable, FeedbackVectorSlot slot, | 97 void BuildVariableLoad(Variable* variable, FeedbackVectorSlot slot, |
98 HoleCheckMode hole_check_mode, | 98 HoleCheckMode hole_check_mode, |
99 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); | 99 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); |
100 void BuildVariableLoadForAccumulatorValue( | 100 void BuildVariableLoadForAccumulatorValue( |
101 Variable* variable, FeedbackVectorSlot slot, | 101 Variable* variable, FeedbackVectorSlot slot, |
102 HoleCheckMode hole_check_mode, | 102 HoleCheckMode hole_check_mode, |
103 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); | 103 TypeofMode typeof_mode = NOT_INSIDE_TYPEOF); |
104 void BuildVariableAssignment(Variable* variable, Token::Value op, | 104 void BuildVariableAssignment(Variable* variable, Token::Value op, |
105 FeedbackVectorSlot slot, | 105 FeedbackVectorSlot slot, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 void VisitModuleNamespaceImports(); | 146 void VisitModuleNamespaceImports(); |
147 | 147 |
148 // Visit the header/body of a loop iteration. | 148 // Visit the header/body of a loop iteration. |
149 void VisitIterationHeader(IterationStatement* stmt, | 149 void VisitIterationHeader(IterationStatement* stmt, |
150 LoopBuilder* loop_builder); | 150 LoopBuilder* loop_builder); |
151 void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop_builder); | 151 void VisitIterationBody(IterationStatement* stmt, LoopBuilder* loop_builder); |
152 | 152 |
153 // Visit a statement and switch scopes, the context is in the accumulator. | 153 // Visit a statement and switch scopes, the context is in the accumulator. |
154 void VisitInScope(Statement* stmt, Scope* scope); | 154 void VisitInScope(Statement* stmt, Scope* scope); |
155 | 155 |
| 156 void BuildPushUndefinedIntoRegisterList(RegisterList* reg_list); |
| 157 |
156 // Visitors for obtaining expression result in the accumulator, in a | 158 // Visitors for obtaining expression result in the accumulator, in a |
157 // register, or just getting the effect. | 159 // register, or just getting the effect. |
158 void VisitForAccumulatorValue(Expression* expr); | 160 void VisitForAccumulatorValue(Expression* expr); |
159 void VisitForAccumulatorValueOrTheHole(Expression* expr); | 161 void VisitForAccumulatorValueOrTheHole(Expression* expr); |
160 MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr); | 162 MUST_USE_RESULT Register VisitForRegisterValue(Expression* expr); |
161 void VisitForRegisterValue(Expression* expr, Register destination); | 163 void VisitForRegisterValue(Expression* expr, Register destination); |
| 164 void VisitAndPushIntoRegisterList(Expression* expr, RegisterList* reg_list); |
162 void VisitForEffect(Expression* expr); | 165 void VisitForEffect(Expression* expr); |
163 void VisitForTest(Expression* expr, BytecodeLabels* then_labels, | 166 void VisitForTest(Expression* expr, BytecodeLabels* then_labels, |
164 BytecodeLabels* else_labels, TestFallthrough fallthrough); | 167 BytecodeLabels* else_labels, TestFallthrough fallthrough); |
165 | 168 |
166 // Returns the runtime function id for a store to super for the function's | 169 // Returns the runtime function id for a store to super for the function's |
167 // language mode. | 170 // language mode. |
168 inline Runtime::FunctionId StoreToSuperRuntimeId(); | 171 inline Runtime::FunctionId StoreToSuperRuntimeId(); |
169 inline Runtime::FunctionId StoreKeyedToSuperRuntimeId(); | 172 inline Runtime::FunctionId StoreKeyedToSuperRuntimeId(); |
170 | 173 |
171 inline BytecodeArrayBuilder* builder() const { return builder_; } | 174 inline BytecodeArrayBuilder* builder() const { return builder_; } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 Handle<Name> prototype_string_; | 226 Handle<Name> prototype_string_; |
224 Handle<FixedArray> empty_fixed_array_; | 227 Handle<FixedArray> empty_fixed_array_; |
225 const AstRawString* undefined_string_; | 228 const AstRawString* undefined_string_; |
226 }; | 229 }; |
227 | 230 |
228 } // namespace interpreter | 231 } // namespace interpreter |
229 } // namespace internal | 232 } // namespace internal |
230 } // namespace v8 | 233 } // namespace v8 |
231 | 234 |
232 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ | 235 #endif // V8_INTERPRETER_BYTECODE_GENERATOR_H_ |
OLD | NEW |