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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 Register Parameter(int parameter_index) const; | 72 Register Parameter(int parameter_index) const; |
73 | 73 |
74 // Return true if the register |reg| represents a parameter or a | 74 // Return true if the register |reg| represents a parameter or a |
75 // local. | 75 // local. |
76 bool RegisterIsParameterOrLocal(Register reg) const; | 76 bool RegisterIsParameterOrLocal(Register reg) const; |
77 | 77 |
78 // Returns true if the register |reg| is a live temporary register. | 78 // Returns true if the register |reg| is a live temporary register. |
79 bool TemporaryRegisterIsLive(Register reg) const; | 79 bool TemporaryRegisterIsLive(Register reg) const; |
80 | 80 |
81 // Constant loads to accumulator. | 81 // Constant loads to accumulator. |
| 82 BytecodeArrayBuilder& LoadConstantPoolEntry(size_t entry); |
82 BytecodeArrayBuilder& LoadLiteral(v8::internal::Smi* value); | 83 BytecodeArrayBuilder& LoadLiteral(v8::internal::Smi* value); |
83 BytecodeArrayBuilder& LoadLiteral(Handle<Object> object); | 84 BytecodeArrayBuilder& LoadLiteral(Handle<Object> object); |
84 BytecodeArrayBuilder& LoadUndefined(); | 85 BytecodeArrayBuilder& LoadUndefined(); |
85 BytecodeArrayBuilder& LoadNull(); | 86 BytecodeArrayBuilder& LoadNull(); |
86 BytecodeArrayBuilder& LoadTheHole(); | 87 BytecodeArrayBuilder& LoadTheHole(); |
87 BytecodeArrayBuilder& LoadTrue(); | 88 BytecodeArrayBuilder& LoadTrue(); |
88 BytecodeArrayBuilder& LoadFalse(); | 89 BytecodeArrayBuilder& LoadFalse(); |
89 | 90 |
90 // Global loads to the accumulator and stores from the accumulator. | 91 // Global loads to the accumulator and stores from the accumulator. |
91 BytecodeArrayBuilder& LoadGlobal(int feedback_slot, TypeofMode typeof_mode); | 92 BytecodeArrayBuilder& LoadGlobal(int feedback_slot, TypeofMode typeof_mode); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 | 252 |
252 // Exception handling. | 253 // Exception handling. |
253 BytecodeArrayBuilder& MarkHandler(int handler_id, bool will_catch); | 254 BytecodeArrayBuilder& MarkHandler(int handler_id, bool will_catch); |
254 BytecodeArrayBuilder& MarkTryBegin(int handler_id, Register context); | 255 BytecodeArrayBuilder& MarkTryBegin(int handler_id, Register context); |
255 BytecodeArrayBuilder& MarkTryEnd(int handler_id); | 256 BytecodeArrayBuilder& MarkTryEnd(int handler_id); |
256 | 257 |
257 // Creates a new handler table entry and returns a {hander_id} identifying the | 258 // Creates a new handler table entry and returns a {hander_id} identifying the |
258 // entry, so that it can be referenced by above exception handling support. | 259 // entry, so that it can be referenced by above exception handling support. |
259 int NewHandlerEntry() { return handler_table_builder()->NewHandlerEntry(); } | 260 int NewHandlerEntry() { return handler_table_builder()->NewHandlerEntry(); } |
260 | 261 |
| 262 // Reserves a slot in the constant pool which can later be inserted. |
| 263 size_t ReserveConstantPoolEntry(); |
| 264 // Inserts a entry into a reserved constant pool entry. |
| 265 void InsertReservedConstantPoolEntry(size_t entry, Handle<Object> object); |
| 266 |
261 void InitializeReturnPosition(FunctionLiteral* literal); | 267 void InitializeReturnPosition(FunctionLiteral* literal); |
262 | 268 |
263 void SetStatementPosition(Statement* stmt); | 269 void SetStatementPosition(Statement* stmt); |
264 void SetExpressionPosition(Expression* expr); | 270 void SetExpressionPosition(Expression* expr); |
265 void SetExpressionAsStatementPosition(Expression* expr); | 271 void SetExpressionAsStatementPosition(Expression* expr); |
266 | 272 |
267 // Accessors | 273 // Accessors |
268 TemporaryRegisterAllocator* temporary_register_allocator() { | 274 TemporaryRegisterAllocator* temporary_register_allocator() { |
269 return &temporary_allocator_; | 275 return &temporary_allocator_; |
270 } | 276 } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 BytecodeSourceInfo latest_source_info_; | 377 BytecodeSourceInfo latest_source_info_; |
372 | 378 |
373 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); | 379 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); |
374 }; | 380 }; |
375 | 381 |
376 } // namespace interpreter | 382 } // namespace interpreter |
377 } // namespace internal | 383 } // namespace internal |
378 } // namespace v8 | 384 } // namespace v8 |
379 | 385 |
380 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 386 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |