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 2366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2377 | 2377 |
2378 Node* result = | 2378 Node* result = |
2379 __ CallRuntime(Runtime::kCreateObjectLiteral, context, closure, | 2379 __ CallRuntime(Runtime::kCreateObjectLiteral, context, closure, |
2380 literal_index, constant_elements, flags); | 2380 literal_index, constant_elements, flags); |
2381 __ StoreRegister(result, __ BytecodeOperandReg(3)); | 2381 __ StoreRegister(result, __ BytecodeOperandReg(3)); |
2382 // TODO(klaasb) build a single dispatch once the call is inlined | 2382 // TODO(klaasb) build a single dispatch once the call is inlined |
2383 __ Dispatch(); | 2383 __ Dispatch(); |
2384 } | 2384 } |
2385 } | 2385 } |
2386 | 2386 |
2387 // CreateClosure <index> <tenured> | 2387 // CreateClosure <index> <slot> <tenured> |
2388 // | 2388 // |
2389 // Creates a new closure for SharedFunctionInfo at position |index| in the | 2389 // Creates a new closure for SharedFunctionInfo at position |index| in the |
2390 // constant pool and with the PretenureFlag <tenured>. | 2390 // constant pool and with the PretenureFlag <tenured>. |
2391 void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) { | 2391 void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) { |
2392 Node* index = __ BytecodeOperandIdx(0); | 2392 Node* index = __ BytecodeOperandIdx(0); |
2393 Node* shared = __ LoadConstantPoolEntry(index); | 2393 Node* shared = __ LoadConstantPoolEntry(index); |
2394 Node* flags = __ BytecodeOperandFlag(1); | 2394 Node* flags = __ BytecodeOperandFlag(2); |
2395 Node* context = __ GetContext(); | 2395 Node* context = __ GetContext(); |
2396 | 2396 |
2397 Label call_runtime(assembler, Label::kDeferred); | 2397 Label call_runtime(assembler, Label::kDeferred); |
2398 __ GotoUnless(__ IsSetWord32<CreateClosureFlags::FastNewClosureBit>(flags), | 2398 __ GotoUnless(__ IsSetWord32<CreateClosureFlags::FastNewClosureBit>(flags), |
2399 &call_runtime); | 2399 &call_runtime); |
2400 __ SetAccumulator(FastNewClosureStub::Generate(assembler, shared, context)); | 2400 Node* vector_index = __ BytecodeOperandIdx(1); |
| 2401 vector_index = __ SmiTag(vector_index); |
| 2402 Node* type_feedback_vector = __ LoadTypeFeedbackVector(); |
| 2403 __ SetAccumulator(FastNewClosureStub::Generate( |
| 2404 assembler, shared, type_feedback_vector, vector_index, context)); |
2401 __ Dispatch(); | 2405 __ Dispatch(); |
2402 | 2406 |
2403 __ Bind(&call_runtime); | 2407 __ Bind(&call_runtime); |
2404 { | 2408 { |
2405 Node* tenured_raw = | 2409 Node* tenured_raw = |
2406 __ DecodeWordFromWord32<CreateClosureFlags::PretenuredBit>(flags); | 2410 __ DecodeWordFromWord32<CreateClosureFlags::PretenuredBit>(flags); |
2407 Node* tenured = __ SmiTag(tenured_raw); | 2411 Node* tenured = __ SmiTag(tenured_raw); |
2408 Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context, | 2412 type_feedback_vector = __ LoadTypeFeedbackVector(); |
2409 shared, tenured); | 2413 vector_index = __ BytecodeOperandIdx(1); |
| 2414 vector_index = __ SmiTag(vector_index); |
| 2415 Node* result = |
| 2416 __ CallRuntime(Runtime::kInterpreterNewClosure, context, shared, |
| 2417 type_feedback_vector, vector_index, tenured); |
2410 __ SetAccumulator(result); | 2418 __ SetAccumulator(result); |
2411 __ Dispatch(); | 2419 __ Dispatch(); |
2412 } | 2420 } |
2413 } | 2421 } |
2414 | 2422 |
2415 // CreateBlockContext <index> | 2423 // CreateBlockContext <index> |
2416 // | 2424 // |
2417 // Creates a new block context with the scope info constant at |index| and the | 2425 // Creates a new block context with the scope info constant at |index| and the |
2418 // closure in the accumulator. | 2426 // closure in the accumulator. |
2419 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) { | 2427 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) { |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2904 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2912 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2905 __ SmiTag(new_state)); | 2913 __ SmiTag(new_state)); |
2906 __ SetAccumulator(old_state); | 2914 __ SetAccumulator(old_state); |
2907 | 2915 |
2908 __ Dispatch(); | 2916 __ Dispatch(); |
2909 } | 2917 } |
2910 | 2918 |
2911 } // namespace interpreter | 2919 } // namespace interpreter |
2912 } // namespace internal | 2920 } // namespace internal |
2913 } // namespace v8 | 2921 } // namespace v8 |
OLD | NEW |