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_ARRAY_BUILDER_H_ | 5 #ifndef V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 6 #define V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/ast.h" | 10 #include "src/ast.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 BytecodeArrayBuilder& Bind(const BytecodeLabel& target, BytecodeLabel* label); | 148 BytecodeArrayBuilder& Bind(const BytecodeLabel& target, BytecodeLabel* label); |
149 | 149 |
150 BytecodeArrayBuilder& Jump(BytecodeLabel* label); | 150 BytecodeArrayBuilder& Jump(BytecodeLabel* label); |
151 BytecodeArrayBuilder& JumpIfTrue(BytecodeLabel* label); | 151 BytecodeArrayBuilder& JumpIfTrue(BytecodeLabel* label); |
152 BytecodeArrayBuilder& JumpIfFalse(BytecodeLabel* label); | 152 BytecodeArrayBuilder& JumpIfFalse(BytecodeLabel* label); |
153 // TODO(mythria) The following two functions should be merged into | 153 // TODO(mythria) The following two functions should be merged into |
154 // JumpIfTrue/False. These bytecodes should be automatically chosen rather | 154 // JumpIfTrue/False. These bytecodes should be automatically chosen rather |
155 // than explicitly using them. | 155 // than explicitly using them. |
156 BytecodeArrayBuilder& JumpIfToBooleanTrue(BytecodeLabel* label); | 156 BytecodeArrayBuilder& JumpIfToBooleanTrue(BytecodeLabel* label); |
157 BytecodeArrayBuilder& JumpIfToBooleanFalse(BytecodeLabel* label); | 157 BytecodeArrayBuilder& JumpIfToBooleanFalse(BytecodeLabel* label); |
| 158 |
| 159 BytecodeArrayBuilder& Throw(); |
158 BytecodeArrayBuilder& Return(); | 160 BytecodeArrayBuilder& Return(); |
159 | 161 |
160 BytecodeArrayBuilder& EnterBlock(); | 162 BytecodeArrayBuilder& EnterBlock(); |
161 BytecodeArrayBuilder& LeaveBlock(); | 163 BytecodeArrayBuilder& LeaveBlock(); |
162 | 164 |
163 // Accessors | 165 // Accessors |
164 Zone* zone() const { return zone_; } | 166 Zone* zone() const { return zone_; } |
165 | 167 |
166 private: | 168 private: |
167 ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; } | 169 ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // Scope helpers used by TemporaryRegisterScope | 209 // Scope helpers used by TemporaryRegisterScope |
208 int BorrowTemporaryRegister(); | 210 int BorrowTemporaryRegister(); |
209 void ReturnTemporaryRegister(int reg_index); | 211 void ReturnTemporaryRegister(int reg_index); |
210 | 212 |
211 Isolate* isolate_; | 213 Isolate* isolate_; |
212 Zone* zone_; | 214 Zone* zone_; |
213 ZoneVector<uint8_t> bytecodes_; | 215 ZoneVector<uint8_t> bytecodes_; |
214 bool bytecode_generated_; | 216 bool bytecode_generated_; |
215 size_t last_block_end_; | 217 size_t last_block_end_; |
216 size_t last_bytecode_start_; | 218 size_t last_bytecode_start_; |
217 bool return_seen_in_block_; | 219 bool exit_seen_in_block_; |
218 | 220 |
219 IdentityMap<size_t> constants_map_; | 221 IdentityMap<size_t> constants_map_; |
220 ZoneVector<Handle<Object>> constants_; | 222 ZoneVector<Handle<Object>> constants_; |
221 | 223 |
222 int parameter_count_; | 224 int parameter_count_; |
223 int local_register_count_; | 225 int local_register_count_; |
224 int context_register_count_; | 226 int context_register_count_; |
225 int temporary_register_count_; | 227 int temporary_register_count_; |
226 int temporary_register_next_; | 228 int temporary_register_next_; |
227 | 229 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 288 |
287 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); | 289 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); |
288 }; | 290 }; |
289 | 291 |
290 | 292 |
291 } // namespace interpreter | 293 } // namespace interpreter |
292 } // namespace internal | 294 } // namespace internal |
293 } // namespace v8 | 295 } // namespace v8 |
294 | 296 |
295 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 297 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |