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 "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/interpreter/bytecode-register-allocator.h" | 9 #include "src/interpreter/bytecode-register-allocator.h" |
10 #include "src/interpreter/bytecodes.h" | 10 #include "src/interpreter/bytecodes.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 // Exception handling. | 251 // Exception handling. |
252 BytecodeArrayBuilder& MarkHandler(int handler_id, bool will_catch); | 252 BytecodeArrayBuilder& MarkHandler(int handler_id, bool will_catch); |
253 BytecodeArrayBuilder& MarkTryBegin(int handler_id, Register context); | 253 BytecodeArrayBuilder& MarkTryBegin(int handler_id, Register context); |
254 BytecodeArrayBuilder& MarkTryEnd(int handler_id); | 254 BytecodeArrayBuilder& MarkTryEnd(int handler_id); |
255 | 255 |
256 // Creates a new handler table entry and returns a {hander_id} identifying the | 256 // Creates a new handler table entry and returns a {hander_id} identifying the |
257 // entry, so that it can be referenced by above exception handling support. | 257 // entry, so that it can be referenced by above exception handling support. |
258 int NewHandlerEntry() { return handler_table_builder()->NewHandlerEntry(); } | 258 int NewHandlerEntry() { return handler_table_builder()->NewHandlerEntry(); } |
259 | 259 |
260 void SetReturnPosition(FunctionLiteral* fun); | |
261 void SetStatementPosition(Statement* stmt); | 260 void SetStatementPosition(Statement* stmt); |
262 void SetExpressionPosition(Expression* expr); | 261 void SetExpressionPosition(Expression* expr); |
263 | 262 |
264 // Accessors | 263 // Accessors |
265 Zone* zone() const { return zone_; } | 264 Zone* zone() const { return zone_; } |
266 TemporaryRegisterAllocator* temporary_register_allocator() { | 265 TemporaryRegisterAllocator* temporary_register_allocator() { |
267 return &temporary_allocator_; | 266 return &temporary_allocator_; |
268 } | 267 } |
269 const TemporaryRegisterAllocator* temporary_register_allocator() const { | 268 const TemporaryRegisterAllocator* temporary_register_allocator() const { |
270 return &temporary_allocator_; | 269 return &temporary_allocator_; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 void LeaveBasicBlock(); | 327 void LeaveBasicBlock(); |
329 | 328 |
330 bool OperandIsValid(Bytecode bytecode, int operand_index, | 329 bool OperandIsValid(Bytecode bytecode, int operand_index, |
331 uint32_t operand_value) const; | 330 uint32_t operand_value) const; |
332 bool RegisterIsValid(Register reg, OperandType reg_type) const; | 331 bool RegisterIsValid(Register reg, OperandType reg_type) const; |
333 | 332 |
334 bool LastBytecodeInSameBlock() const; | 333 bool LastBytecodeInSameBlock() const; |
335 bool NeedToBooleanCast(); | 334 bool NeedToBooleanCast(); |
336 bool IsRegisterInAccumulator(Register reg); | 335 bool IsRegisterInAccumulator(Register reg); |
337 | 336 |
| 337 // Set position for implicit return. |
| 338 void SetReturnPosition(FunctionLiteral* fun); |
| 339 |
338 // Gets a constant pool entry for the |object|. | 340 // Gets a constant pool entry for the |object|. |
339 size_t GetConstantPoolEntry(Handle<Object> object); | 341 size_t GetConstantPoolEntry(Handle<Object> object); |
340 | 342 |
341 ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; } | 343 ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; } |
342 const ZoneVector<uint8_t>* bytecodes() const { return &bytecodes_; } | 344 const ZoneVector<uint8_t>* bytecodes() const { return &bytecodes_; } |
343 Isolate* isolate() const { return isolate_; } | 345 Isolate* isolate() const { return isolate_; } |
344 ConstantArrayBuilder* constant_array_builder() { | 346 ConstantArrayBuilder* constant_array_builder() { |
345 return &constant_array_builder_; | 347 return &constant_array_builder_; |
346 } | 348 } |
347 const ConstantArrayBuilder* constant_array_builder() const { | 349 const ConstantArrayBuilder* constant_array_builder() const { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 size_t offset_; | 416 size_t offset_; |
415 | 417 |
416 friend class BytecodeArrayBuilder; | 418 friend class BytecodeArrayBuilder; |
417 }; | 419 }; |
418 | 420 |
419 } // namespace interpreter | 421 } // namespace interpreter |
420 } // namespace internal | 422 } // namespace internal |
421 } // namespace v8 | 423 } // namespace v8 |
422 | 424 |
423 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 425 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |