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 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 compiler::InterpreterAssembler* assembler) { | 680 compiler::InterpreterAssembler* assembler) { |
681 Node* accumulator = __ GetAccumulator(); | 681 Node* accumulator = __ GetAccumulator(); |
682 Node* index = __ BytecodeOperandIdx8(0); | 682 Node* index = __ BytecodeOperandIdx8(0); |
683 Node* constant = __ LoadConstantPoolEntry(index); | 683 Node* constant = __ LoadConstantPoolEntry(index); |
684 Node* relative_jump = __ SmiUntag(constant); | 684 Node* relative_jump = __ SmiUntag(constant); |
685 Node* false_value = __ BooleanConstant(false); | 685 Node* false_value = __ BooleanConstant(false); |
686 __ JumpIfWordEqual(accumulator, false_value, relative_jump); | 686 __ JumpIfWordEqual(accumulator, false_value, relative_jump); |
687 } | 687 } |
688 | 688 |
689 | 689 |
| 690 // CreateClosure <tenured> |
| 691 // |
| 692 // Creates a new closure for SharedFunctionInfo in the accumulator with the |
| 693 // PretenureFlag <tenured>. |
| 694 void Interpreter::DoCreateClosure(compiler::InterpreterAssembler* assembler) { |
| 695 // TODO(rmcilroy): Possibly call FastNewClosureStub when possible instead of |
| 696 // calling into the runtime. |
| 697 Node* shared = __ GetAccumulator(); |
| 698 Node* tenured_raw = __ BytecodeOperandImm8(0); |
| 699 Node* tenured = __ SmiTag(tenured_raw); |
| 700 Node* result = |
| 701 __ CallRuntime(Runtime::kInterpreterNewClosure, shared, tenured); |
| 702 __ SetAccumulator(result); |
| 703 __ Dispatch(); |
| 704 } |
| 705 |
| 706 |
690 // Return | 707 // Return |
691 // | 708 // |
692 // Return the value in the accumulator. | 709 // Return the value in the accumulator. |
693 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { | 710 void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) { |
694 __ Return(); | 711 __ Return(); |
695 } | 712 } |
696 | 713 |
697 | 714 |
698 } // namespace interpreter | 715 } // namespace interpreter |
699 } // namespace internal | 716 } // namespace internal |
700 } // namespace v8 | 717 } // namespace v8 |
OLD | NEW |