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-array-writer.h" | 9 #include "src/interpreter/bytecode-array-writer.h" |
10 #include "src/interpreter/bytecode-register-allocator.h" | 10 #include "src/interpreter/bytecode-register-allocator.h" |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 // Creates a new handler table entry and returns a {hander_id} identifying the | 255 // Creates a new handler table entry and returns a {hander_id} identifying the |
256 // entry, so that it can be referenced by above exception handling support. | 256 // entry, so that it can be referenced by above exception handling support. |
257 int NewHandlerEntry() { return handler_table_builder()->NewHandlerEntry(); } | 257 int NewHandlerEntry() { return handler_table_builder()->NewHandlerEntry(); } |
258 | 258 |
259 void InitializeReturnPosition(FunctionLiteral* literal); | 259 void InitializeReturnPosition(FunctionLiteral* literal); |
260 | 260 |
261 void SetStatementPosition(Statement* stmt); | 261 void SetStatementPosition(Statement* stmt); |
262 void SetExpressionPosition(Expression* expr); | 262 void SetExpressionPosition(Expression* expr); |
263 void SetExpressionAsStatementPosition(Expression* expr); | 263 void SetExpressionAsStatementPosition(Expression* expr); |
264 | 264 |
| 265 // Set position for return. |
| 266 void SetReturnPosition(); |
| 267 |
265 // Accessors | 268 // Accessors |
266 TemporaryRegisterAllocator* temporary_register_allocator() { | 269 TemporaryRegisterAllocator* temporary_register_allocator() { |
267 return &temporary_allocator_; | 270 return &temporary_allocator_; |
268 } | 271 } |
269 const TemporaryRegisterAllocator* temporary_register_allocator() const { | 272 const TemporaryRegisterAllocator* temporary_register_allocator() const { |
270 return &temporary_allocator_; | 273 return &temporary_allocator_; |
271 } | 274 } |
272 Zone* zone() const { return zone_; } | 275 Zone* zone() const { return zone_; } |
273 | 276 |
274 void EnsureReturn(); | 277 void EnsureReturn(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 322 |
320 void LeaveBasicBlock(); | 323 void LeaveBasicBlock(); |
321 | 324 |
322 bool OperandIsValid(Bytecode bytecode, OperandScale operand_scale, | 325 bool OperandIsValid(Bytecode bytecode, OperandScale operand_scale, |
323 int operand_index, uint32_t operand_value) const; | 326 int operand_index, uint32_t operand_value) const; |
324 bool RegisterIsValid(Register reg, OperandSize reg_size) const; | 327 bool RegisterIsValid(Register reg, OperandSize reg_size) const; |
325 | 328 |
326 // Attach latest source position to |node|. | 329 // Attach latest source position to |node|. |
327 void AttachSourceInfo(BytecodeNode* node); | 330 void AttachSourceInfo(BytecodeNode* node); |
328 | 331 |
329 // Set position for return. | |
330 void SetReturnPosition(); | |
331 | |
332 // Gets a constant pool entry for the |object|. | 332 // Gets a constant pool entry for the |object|. |
333 size_t GetConstantPoolEntry(Handle<Object> object); | 333 size_t GetConstantPoolEntry(Handle<Object> object); |
334 | 334 |
335 // Not implemented as the illegal bytecode is used inside internally | 335 // Not implemented as the illegal bytecode is used inside internally |
336 // to indicate a bytecode field is not valid or an error has occured | 336 // to indicate a bytecode field is not valid or an error has occured |
337 // during bytecode generation. | 337 // during bytecode generation. |
338 BytecodeArrayBuilder& Illegal(); | 338 BytecodeArrayBuilder& Illegal(); |
339 | 339 |
340 Isolate* isolate() const { return isolate_; } | 340 Isolate* isolate() const { return isolate_; } |
341 BytecodeArrayWriter* bytecode_array_writer() { | 341 BytecodeArrayWriter* bytecode_array_writer() { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 size_t offset_; | 414 size_t offset_; |
415 | 415 |
416 friend class BytecodeArrayBuilder; | 416 friend class BytecodeArrayBuilder; |
417 }; | 417 }; |
418 | 418 |
419 } // namespace interpreter | 419 } // namespace interpreter |
420 } // namespace internal | 420 } // namespace internal |
421 } // namespace v8 | 421 } // namespace v8 |
422 | 422 |
423 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 423 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |