| 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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 // Creates a new handler table entry and returns a {hander_id} identifying the | 254 // Creates a new handler table entry and returns a {hander_id} identifying the |
| 255 // entry, so that it can be referenced by above exception handling support. | 255 // entry, so that it can be referenced by above exception handling support. |
| 256 int NewHandlerEntry() { return handler_table_builder()->NewHandlerEntry(); } | 256 int NewHandlerEntry() { return handler_table_builder()->NewHandlerEntry(); } |
| 257 | 257 |
| 258 void InitializeReturnPosition(FunctionLiteral* literal); | 258 void InitializeReturnPosition(FunctionLiteral* literal); |
| 259 | 259 |
| 260 void SetStatementPosition(Statement* stmt); | 260 void SetStatementPosition(Statement* stmt); |
| 261 void SetExpressionPosition(Expression* expr); | 261 void SetExpressionPosition(Expression* expr); |
| 262 void SetExpressionAsStatementPosition(Expression* expr); | 262 void SetExpressionAsStatementPosition(Expression* expr); |
| 263 | 263 |
| 264 // Set position for return. | |
| 265 void SetReturnPosition(); | |
| 266 | |
| 267 // Accessors | 264 // Accessors |
| 268 TemporaryRegisterAllocator* temporary_register_allocator() { | 265 TemporaryRegisterAllocator* temporary_register_allocator() { |
| 269 return &temporary_allocator_; | 266 return &temporary_allocator_; |
| 270 } | 267 } |
| 271 const TemporaryRegisterAllocator* temporary_register_allocator() const { | 268 const TemporaryRegisterAllocator* temporary_register_allocator() const { |
| 272 return &temporary_allocator_; | 269 return &temporary_allocator_; |
| 273 } | 270 } |
| 274 Zone* zone() const { return zone_; } | 271 Zone* zone() const { return zone_; } |
| 275 | 272 |
| 276 void EnsureReturn(); | 273 void EnsureReturn(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 BytecodeLabel* label); | 308 BytecodeLabel* label); |
| 312 | 309 |
| 313 | 310 |
| 314 bool OperandIsValid(Bytecode bytecode, OperandScale operand_scale, | 311 bool OperandIsValid(Bytecode bytecode, OperandScale operand_scale, |
| 315 int operand_index, uint32_t operand_value) const; | 312 int operand_index, uint32_t operand_value) const; |
| 316 bool RegisterIsValid(Register reg, OperandSize reg_size) const; | 313 bool RegisterIsValid(Register reg, OperandSize reg_size) const; |
| 317 | 314 |
| 318 // Attach latest source position to |node|. | 315 // Attach latest source position to |node|. |
| 319 void AttachSourceInfo(BytecodeNode* node); | 316 void AttachSourceInfo(BytecodeNode* node); |
| 320 | 317 |
| 318 // Set position for return. |
| 319 void SetReturnPosition(); |
| 320 |
| 321 // Gets a constant pool entry for the |object|. | 321 // Gets a constant pool entry for the |object|. |
| 322 size_t GetConstantPoolEntry(Handle<Object> object); | 322 size_t GetConstantPoolEntry(Handle<Object> object); |
| 323 | 323 |
| 324 // Not implemented as the illegal bytecode is used inside internally | 324 // Not implemented as the illegal bytecode is used inside internally |
| 325 // to indicate a bytecode field is not valid or an error has occured | 325 // to indicate a bytecode field is not valid or an error has occured |
| 326 // during bytecode generation. | 326 // during bytecode generation. |
| 327 BytecodeArrayBuilder& Illegal(); | 327 BytecodeArrayBuilder& Illegal(); |
| 328 | 328 |
| 329 void LeaveBasicBlock() { return_seen_in_block_ = false; } | 329 void LeaveBasicBlock() { return_seen_in_block_ = false; } |
| 330 | 330 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 359 BytecodeSourceInfo latest_source_info_; | 359 BytecodeSourceInfo latest_source_info_; |
| 360 | 360 |
| 361 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); | 361 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); |
| 362 }; | 362 }; |
| 363 | 363 |
| 364 } // namespace interpreter | 364 } // namespace interpreter |
| 365 } // namespace internal | 365 } // namespace internal |
| 366 } // namespace v8 | 366 } // namespace v8 |
| 367 | 367 |
| 368 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 368 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
| OLD | NEW |