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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 size_t GetConstantPoolEntry(Handle<Object> object); | 72 size_t GetConstantPoolEntry(Handle<Object> object); |
73 | 73 |
74 // Constant loads to accumulator. | 74 // Constant loads to accumulator. |
75 BytecodeArrayBuilder& LoadLiteral(v8::internal::Smi* value); | 75 BytecodeArrayBuilder& LoadLiteral(v8::internal::Smi* value); |
76 BytecodeArrayBuilder& LoadLiteral(Handle<Object> object); | 76 BytecodeArrayBuilder& LoadLiteral(Handle<Object> object); |
77 BytecodeArrayBuilder& LoadUndefined(); | 77 BytecodeArrayBuilder& LoadUndefined(); |
78 BytecodeArrayBuilder& LoadNull(); | 78 BytecodeArrayBuilder& LoadNull(); |
79 BytecodeArrayBuilder& LoadTheHole(); | 79 BytecodeArrayBuilder& LoadTheHole(); |
80 BytecodeArrayBuilder& LoadTrue(); | 80 BytecodeArrayBuilder& LoadTrue(); |
81 BytecodeArrayBuilder& LoadFalse(); | 81 BytecodeArrayBuilder& LoadFalse(); |
| 82 BytecodeArrayBuilder& LoadBooleanConstant(bool value); |
82 | 83 |
83 // Global loads to the accumulator and stores from the accumulator. | 84 // Global loads to the accumulator and stores from the accumulator. |
84 BytecodeArrayBuilder& LoadGlobal(size_t name_index, int feedback_slot, | 85 BytecodeArrayBuilder& LoadGlobal(size_t name_index, int feedback_slot, |
85 LanguageMode language_mode, | 86 LanguageMode language_mode, |
86 TypeofMode typeof_mode); | 87 TypeofMode typeof_mode); |
87 BytecodeArrayBuilder& StoreGlobal(size_t name_index, int feedback_slot, | 88 BytecodeArrayBuilder& StoreGlobal(size_t name_index, int feedback_slot, |
88 LanguageMode language_mode); | 89 LanguageMode language_mode); |
89 | 90 |
90 // Load the object at |slot_index| in |context| into the accumulator. | 91 // Load the object at |slot_index| in |context| into the accumulator. |
91 BytecodeArrayBuilder& LoadContextSlot(Register context, int slot_index); | 92 BytecodeArrayBuilder& LoadContextSlot(Register context, int slot_index); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 IdentityMap<size_t> constants_map_; | 279 IdentityMap<size_t> constants_map_; |
279 ZoneVector<Handle<Object>> constants_; | 280 ZoneVector<Handle<Object>> constants_; |
280 | 281 |
281 int parameter_count_; | 282 int parameter_count_; |
282 int local_register_count_; | 283 int local_register_count_; |
283 int context_register_count_; | 284 int context_register_count_; |
284 int temporary_register_count_; | 285 int temporary_register_count_; |
285 | 286 |
286 ZoneSet<int> free_temporaries_; | 287 ZoneSet<int> free_temporaries_; |
287 | 288 |
| 289 class PreviousBytecodeHelper; |
288 friend class TemporaryRegisterScope; | 290 friend class TemporaryRegisterScope; |
289 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); | 291 DISALLOW_COPY_AND_ASSIGN(BytecodeArrayBuilder); |
290 }; | 292 }; |
291 | 293 |
292 | 294 |
293 // A label representing a branch target in a bytecode array. When a | 295 // A label representing a branch target in a bytecode array. When a |
294 // label is bound, it represents a known position in the bytecode | 296 // label is bound, it represents a known position in the bytecode |
295 // array. For labels that are forward references there can be at most | 297 // array. For labels that are forward references there can be at most |
296 // one reference whilst it is unbound. | 298 // one reference whilst it is unbound. |
297 class BytecodeLabel final { | 299 class BytecodeLabel final { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 358 |
357 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); | 359 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); |
358 }; | 360 }; |
359 | 361 |
360 | 362 |
361 } // namespace interpreter | 363 } // namespace interpreter |
362 } // namespace internal | 364 } // namespace internal |
363 } // namespace v8 | 365 } // namespace v8 |
364 | 366 |
365 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 367 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |