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 "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
9 #include "src/compiler/interpreter-assembler.h" | 9 #include "src/compiler/interpreter-assembler.h" |
10 #include "src/factory.h" | 10 #include "src/factory.h" |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
645 compiler::InterpreterAssembler* assembler) { | 645 compiler::InterpreterAssembler* assembler) { |
646 Node* accumulator = __ GetAccumulator(); | 646 Node* accumulator = __ GetAccumulator(); |
647 Node* index = __ BytecodeOperandIdx8(0); | 647 Node* index = __ BytecodeOperandIdx8(0); |
648 Node* constant = __ LoadConstantPoolEntry(index); | 648 Node* constant = __ LoadConstantPoolEntry(index); |
649 Node* relative_jump = __ SmiUntag(constant); | 649 Node* relative_jump = __ SmiUntag(constant); |
650 Node* false_value = __ BooleanConstant(false); | 650 Node* false_value = __ BooleanConstant(false); |
651 __ JumpIfWordEqual(accumulator, false_value, relative_jump); | 651 __ JumpIfWordEqual(accumulator, false_value, relative_jump); |
652 } | 652 } |
653 | 653 |
654 | 654 |
655 // CreateClosure <tenured> | |
656 // | |
657 // Creates a new closure for SharedFunctionInfo in the accumulator with the | |
658 // PretenureFlag <tenured>. | |
659 void Interpreter::DoCreateClosure(compiler::InterpreterAssembler* assembler) { | |
660 // TODO(rmcilroy): Possibly call FastNewClosureStub when possible instead of | |
Michael Starzinger
2015/10/09 13:19:00
About this TODO: Michael Stanton is currently work
rmcilroy
2015/10/12 17:00:15
Good to know, thanks!
| |
661 // calling into the runtime. | |
662 Node* shared = __ GetAccumulator(); | |
663 Node* tenured_raw = __ BytecodeOperandImm8(0); | |
664 Node* tenured = __ SmiTag(tenured_raw); | |
665 Node* result = | |
666 __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured); | |
667 __ SetAccumulator(result); | |
668 __ Dispatch(); | |
669 } | |
670 | |
671 | |
655 // Return | 672 // Return |
656 // | 673 // |
657 // Return the value in the accumulator. | 674 // Return the value in the accumulator. |
658 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { | 675 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { |
659 __ Return(); | 676 __ Return(); |
660 } | 677 } |
661 | 678 |
662 | 679 |
663 } // namespace interpreter | 680 } // namespace interpreter |
664 } // namespace internal | 681 } // namespace internal |
665 } // namespace v8 | 682 } // namespace v8 |
OLD | NEW |