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/ast.h" | 10 #include "src/ast/ast.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // Deletes property from an object. This expects that accumulator contains | 178 // Deletes property from an object. This expects that accumulator contains |
179 // the key to be deleted and the register contains a reference to the object. | 179 // the key to be deleted and the register contains a reference to the object. |
180 BytecodeArrayBuilder& Delete(Register object, LanguageMode language_mode); | 180 BytecodeArrayBuilder& Delete(Register object, LanguageMode language_mode); |
181 | 181 |
182 // Tests. | 182 // Tests. |
183 BytecodeArrayBuilder& CompareOperation(Token::Value op, Register reg, | 183 BytecodeArrayBuilder& CompareOperation(Token::Value op, Register reg, |
184 Strength strength); | 184 Strength strength); |
185 | 185 |
186 // Casts. | 186 // Casts. |
187 BytecodeArrayBuilder& CastAccumulatorToBoolean(); | 187 BytecodeArrayBuilder& CastAccumulatorToBoolean(); |
188 BytecodeArrayBuilder& CastAccumulatorToJSObject(); | |
189 BytecodeArrayBuilder& CastAccumulatorToName(); | 188 BytecodeArrayBuilder& CastAccumulatorToName(); |
190 BytecodeArrayBuilder& CastAccumulatorToNumber(); | 189 BytecodeArrayBuilder& CastAccumulatorToNumber(); |
191 | 190 |
192 // Flow Control. | 191 // Flow Control. |
193 BytecodeArrayBuilder& Bind(BytecodeLabel* label); | 192 BytecodeArrayBuilder& Bind(BytecodeLabel* label); |
194 BytecodeArrayBuilder& Bind(const BytecodeLabel& target, BytecodeLabel* label); | 193 BytecodeArrayBuilder& Bind(const BytecodeLabel& target, BytecodeLabel* label); |
195 | 194 |
196 BytecodeArrayBuilder& Jump(BytecodeLabel* label); | 195 BytecodeArrayBuilder& Jump(BytecodeLabel* label); |
197 BytecodeArrayBuilder& JumpIfTrue(BytecodeLabel* label); | 196 BytecodeArrayBuilder& JumpIfTrue(BytecodeLabel* label); |
198 BytecodeArrayBuilder& JumpIfFalse(BytecodeLabel* label); | 197 BytecodeArrayBuilder& JumpIfFalse(BytecodeLabel* label); |
199 BytecodeArrayBuilder& JumpIfNull(BytecodeLabel* label); | 198 BytecodeArrayBuilder& JumpIfNull(BytecodeLabel* label); |
200 BytecodeArrayBuilder& JumpIfUndefined(BytecodeLabel* label); | 199 BytecodeArrayBuilder& JumpIfUndefined(BytecodeLabel* label); |
201 | 200 |
202 BytecodeArrayBuilder& Throw(); | 201 BytecodeArrayBuilder& Throw(); |
203 BytecodeArrayBuilder& Return(); | 202 BytecodeArrayBuilder& Return(); |
204 | 203 |
205 // Complex flow control. | 204 // Complex flow control. |
206 BytecodeArrayBuilder& ForInPrepare(Register receiver); | 205 BytecodeArrayBuilder& ForInPrepare(Register receiver, Register cache_type, |
207 BytecodeArrayBuilder& ForInNext(Register for_in_state, Register index); | 206 Register cache_array, |
208 BytecodeArrayBuilder& ForInDone(Register for_in_state); | 207 Register cache_length); |
| 208 BytecodeArrayBuilder& ForInNext(Register receiver, Register cache_type, |
| 209 Register cache_array, Register index); |
| 210 BytecodeArrayBuilder& ForInDone(Register index, Register cache_length); |
| 211 BytecodeArrayBuilder& ForInStep(Register index); |
209 | 212 |
210 // Accessors | 213 // Accessors |
211 Zone* zone() const { return zone_; } | 214 Zone* zone() const { return zone_; } |
212 | 215 |
213 private: | 216 private: |
214 ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; } | 217 ZoneVector<uint8_t>* bytecodes() { return &bytecodes_; } |
215 const ZoneVector<uint8_t>* bytecodes() const { return &bytecodes_; } | 218 const ZoneVector<uint8_t>* bytecodes() const { return &bytecodes_; } |
216 Isolate* isolate() const { return isolate_; } | 219 Isolate* isolate() const { return isolate_; } |
217 | 220 |
218 static Bytecode BytecodeForBinaryOperation(Token::Value op); | 221 static Bytecode BytecodeForBinaryOperation(Token::Value op); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 367 |
365 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); | 368 DISALLOW_COPY_AND_ASSIGN(TemporaryRegisterScope); |
366 }; | 369 }; |
367 | 370 |
368 | 371 |
369 } // namespace interpreter | 372 } // namespace interpreter |
370 } // namespace internal | 373 } // namespace internal |
371 } // namespace v8 | 374 } // namespace v8 |
372 | 375 |
373 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ | 376 #endif // V8_INTERPRETER_BYTECODE_ARRAY_BUILDER_H_ |
OLD | NEW |