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 2710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2721 | 2721 |
2722 Node* result = | 2722 Node* result = |
2723 __ CallRuntime(Runtime::kCreateObjectLiteral, context, closure, | 2723 __ CallRuntime(Runtime::kCreateObjectLiteral, context, closure, |
2724 literal_index, constant_elements, flags); | 2724 literal_index, constant_elements, flags); |
2725 __ StoreRegister(result, __ BytecodeOperandReg(3)); | 2725 __ StoreRegister(result, __ BytecodeOperandReg(3)); |
2726 // TODO(klaasb) build a single dispatch once the call is inlined | 2726 // TODO(klaasb) build a single dispatch once the call is inlined |
2727 __ Dispatch(); | 2727 __ Dispatch(); |
2728 } | 2728 } |
2729 } | 2729 } |
2730 | 2730 |
2731 // CreateClosure <index> <tenured> | 2731 // CreateClosure <index> <slot> <tenured> |
2732 // | 2732 // |
2733 // Creates a new closure for SharedFunctionInfo at position |index| in the | 2733 // Creates a new closure for SharedFunctionInfo at position |index| in the |
2734 // constant pool and with the PretenureFlag <tenured>. | 2734 // constant pool and with the PretenureFlag <tenured>. |
2735 void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) { | 2735 void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) { |
2736 Node* index = __ BytecodeOperandIdx(0); | 2736 Node* index = __ BytecodeOperandIdx(0); |
2737 Node* shared = __ LoadConstantPoolEntry(index); | 2737 Node* shared = __ LoadConstantPoolEntry(index); |
2738 Node* flags = __ BytecodeOperandFlag(1); | 2738 Node* flags = __ BytecodeOperandFlag(2); |
2739 Node* context = __ GetContext(); | 2739 Node* context = __ GetContext(); |
2740 | 2740 |
2741 Label call_runtime(assembler, Label::kDeferred); | 2741 Label call_runtime(assembler, Label::kDeferred); |
2742 __ GotoUnless(__ IsSetWord32<CreateClosureFlags::FastNewClosureBit>(flags), | 2742 __ GotoUnless(__ IsSetWord32<CreateClosureFlags::FastNewClosureBit>(flags), |
2743 &call_runtime); | 2743 &call_runtime); |
2744 ConstructorBuiltinsAssembler constructor_assembler(assembler->state()); | 2744 ConstructorBuiltinsAssembler constructor_assembler(assembler->state()); |
2745 __ SetAccumulator(constructor_assembler.EmitFastNewClosure(shared, context)); | 2745 Node* vector_index = __ BytecodeOperandIdx(1); |
| 2746 vector_index = __ SmiTag(vector_index); |
| 2747 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); |
| 2748 __ SetAccumulator(constructor_assembler.EmitFastNewClosure( |
| 2749 shared, type_feedback_vector, vector_index, context)); |
2746 __ Dispatch(); | 2750 __ Dispatch(); |
2747 | 2751 |
2748 __ Bind(&call_runtime); | 2752 __ Bind(&call_runtime); |
2749 { | 2753 { |
2750 Node* tenured_raw = | 2754 Node* tenured_raw = |
2751 __ DecodeWordFromWord32<CreateClosureFlags::PretenuredBit>(flags); | 2755 __ DecodeWordFromWord32<CreateClosureFlags::PretenuredBit>(flags); |
2752 Node* tenured = __ SmiTag(tenured_raw); | 2756 Node* tenured = __ SmiTag(tenured_raw); |
2753 Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context, | 2757 type_feedback_vector = __ LoadTypeFeedbackVector(); |
2754 shared, tenured); | 2758 vector_index = __ BytecodeOperandIdx(1); |
| 2759 vector_index = __ SmiTag(vector_index); |
| 2760 Node* result = |
| 2761 __ CallRuntime(Runtime::kInterpreterNewClosure, context, shared, |
| 2762 type_feedback_vector, vector_index, tenured); |
2755 __ SetAccumulator(result); | 2763 __ SetAccumulator(result); |
2756 __ Dispatch(); | 2764 __ Dispatch(); |
2757 } | 2765 } |
2758 } | 2766 } |
2759 | 2767 |
2760 // CreateBlockContext <index> | 2768 // CreateBlockContext <index> |
2761 // | 2769 // |
2762 // Creates a new block context with the scope info constant at |index| and the | 2770 // Creates a new block context with the scope info constant at |index| and the |
2763 // closure in the accumulator. | 2771 // closure in the accumulator. |
2764 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) { | 2772 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) { |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3251 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 3259 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
3252 __ SmiTag(new_state)); | 3260 __ SmiTag(new_state)); |
3253 __ SetAccumulator(old_state); | 3261 __ SetAccumulator(old_state); |
3254 | 3262 |
3255 __ Dispatch(); | 3263 __ Dispatch(); |
3256 } | 3264 } |
3257 | 3265 |
3258 } // namespace interpreter | 3266 } // namespace interpreter |
3259 } // namespace internal | 3267 } // namespace internal |
3260 } // namespace v8 | 3268 } // namespace v8 |
OLD | NEW |