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 #include "src/interpreter/interpreter.h" | 5 #include "src/interpreter/interpreter.h" |
6 | 6 |
7 #include <fstream> | 7 #include <fstream> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1296 Node* result = Generator::Generate(assembler, value, context, | 1296 Node* result = Generator::Generate(assembler, value, context, |
1297 type_feedback_vector, slot_index); | 1297 type_feedback_vector, slot_index); |
1298 __ SetAccumulator(result); | 1298 __ SetAccumulator(result); |
1299 __ Dispatch(); | 1299 __ Dispatch(); |
1300 } | 1300 } |
1301 | 1301 |
1302 // ToName | 1302 // ToName |
1303 // | 1303 // |
1304 // Convert the object referenced by the accumulator to a name. | 1304 // Convert the object referenced by the accumulator to a name. |
1305 void Interpreter::DoToName(InterpreterAssembler* assembler) { | 1305 void Interpreter::DoToName(InterpreterAssembler* assembler) { |
1306 Node* result = BuildUnaryOp(CodeFactory::ToName(isolate_), assembler); | 1306 Node* object = __ GetAccumulator(); |
| 1307 Node* context = __ GetContext(); |
| 1308 Node* result = __ ToName(context, object); |
1307 __ StoreRegister(result, __ BytecodeOperandReg(0)); | 1309 __ StoreRegister(result, __ BytecodeOperandReg(0)); |
1308 __ Dispatch(); | 1310 __ Dispatch(); |
1309 } | 1311 } |
1310 | 1312 |
1311 // ToNumber | 1313 // ToNumber |
1312 // | 1314 // |
1313 // Convert the object referenced by the accumulator to a number. | 1315 // Convert the object referenced by the accumulator to a number. |
1314 void Interpreter::DoToNumber(InterpreterAssembler* assembler) { | 1316 void Interpreter::DoToNumber(InterpreterAssembler* assembler) { |
1315 Node* result = BuildUnaryOp(CodeFactory::ToNumber(isolate_), assembler); | 1317 Node* result = BuildUnaryOp(CodeFactory::ToNumber(isolate_), assembler); |
1316 __ StoreRegister(result, __ BytecodeOperandReg(0)); | 1318 __ StoreRegister(result, __ BytecodeOperandReg(0)); |
(...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2452 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2454 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2453 __ SmiTag(new_state)); | 2455 __ SmiTag(new_state)); |
2454 __ SetAccumulator(old_state); | 2456 __ SetAccumulator(old_state); |
2455 | 2457 |
2456 __ Dispatch(); | 2458 __ Dispatch(); |
2457 } | 2459 } |
2458 | 2460 |
2459 } // namespace interpreter | 2461 } // namespace interpreter |
2460 } // namespace internal | 2462 } // namespace internal |
2461 } // namespace v8 | 2463 } // namespace v8 |
OLD | NEW |