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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // Casts | 122 // Casts |
123 BytecodeArrayBuilder& CastAccumulatorToBoolean(); | 123 BytecodeArrayBuilder& CastAccumulatorToBoolean(); |
124 | 124 |
125 // Flow Control. | 125 // Flow Control. |
126 BytecodeArrayBuilder& Bind(BytecodeLabel* label); | 126 BytecodeArrayBuilder& Bind(BytecodeLabel* label); |
127 BytecodeArrayBuilder& Bind(const BytecodeLabel& target, BytecodeLabel* label); | 127 BytecodeArrayBuilder& Bind(const BytecodeLabel& target, BytecodeLabel* label); |
128 | 128 |
129 BytecodeArrayBuilder& Jump(BytecodeLabel* label); | 129 BytecodeArrayBuilder& Jump(BytecodeLabel* label); |
130 BytecodeArrayBuilder& JumpIfTrue(BytecodeLabel* label); | 130 BytecodeArrayBuilder& JumpIfTrue(BytecodeLabel* label); |
131 BytecodeArrayBuilder& JumpIfFalse(BytecodeLabel* label); | 131 BytecodeArrayBuilder& JumpIfFalse(BytecodeLabel* label); |
| 132 // TODO(mythria) The following two functions should be merged into |
| 133 // JumpIfTrue/False. These bytecodes should be automatically chosen rather |
| 134 // than explicitly using them. |
| 135 BytecodeArrayBuilder& JumpIfToBooleanTrue(BytecodeLabel* label); |
| 136 BytecodeArrayBuilder& JumpIfToBooleanFalse(BytecodeLabel* label); |
132 BytecodeArrayBuilder& Return(); | 137 BytecodeArrayBuilder& Return(); |
133 | 138 |
134 BytecodeArrayBuilder& EnterBlock(); | 139 BytecodeArrayBuilder& EnterBlock(); |
135 BytecodeArrayBuilder& LeaveBlock(); | 140 BytecodeArrayBuilder& LeaveBlock(); |
136 | 141 |
137 // Accessors | 142 // Accessors |
138 Zone* zone() const { return zone_; } | 143 Zone* zone() const { return zone_; } |
139 | 144 |
140 private: | 145 private: |
141 ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; } | 146 ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 | 264 |
260 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); | 265 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); |
261 }; | 266 }; |
262 | 267 |
263 | 268 |
264 } // namespace interpreter | 269 } // namespace interpreter |
265 } // namespace internal | 270 } // namespace internal |
266 } // namespace v8 | 271 } // namespace v8 |
267 | 272 |
268 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 273 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |