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> <slot> <tenured> | 2387 // CreateClosure <index> <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(2); | 2394 Node* flags = __ BytecodeOperandFlag(1); |
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 Node* vector_index = __ BytecodeOperandIdx(1); | 2400 __ SetAccumulator(FastNewClosureStub::Generate(assembler, shared, context)); |
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)); | |
2405 __ Dispatch(); | 2401 __ Dispatch(); |
2406 | 2402 |
2407 __ Bind(&call_runtime); | 2403 __ Bind(&call_runtime); |
2408 { | 2404 { |
2409 Node* tenured_raw = | 2405 Node* tenured_raw = |
2410 __ DecodeWordFromWord32<CreateClosureFlags::PretenuredBit>(flags); | 2406 __ DecodeWordFromWord32<CreateClosureFlags::PretenuredBit>(flags); |
2411 Node* tenured = __ SmiTag(tenured_raw); | 2407 Node* tenured = __ SmiTag(tenured_raw); |
2412 type_feedback_vector = __ LoadTypeFeedbackVector(); | 2408 Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context, |
2413 vector_index = __ BytecodeOperandIdx(1); | 2409 shared, tenured); |
2414 vector_index = __ SmiTag(vector_index); | |
2415 Node* result = | |
2416 __ CallRuntime(Runtime::kInterpreterNewClosure, context, shared, | |
2417 type_feedback_vector, vector_index, tenured); | |
2418 __ SetAccumulator(result); | 2410 __ SetAccumulator(result); |
2419 __ Dispatch(); | 2411 __ Dispatch(); |
2420 } | 2412 } |
2421 } | 2413 } |
2422 | 2414 |
2423 // CreateBlockContext <index> | 2415 // CreateBlockContext <index> |
2424 // | 2416 // |
2425 // Creates a new block context with the scope info constant at |index| and the | 2417 // Creates a new block context with the scope info constant at |index| and the |
2426 // closure in the accumulator. | 2418 // closure in the accumulator. |
2427 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) { | 2419 void Interpreter::DoCreateBlockContext(InterpreterAssembler* assembler) { |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2912 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2904 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2913 __ SmiTag(new_state)); | 2905 __ SmiTag(new_state)); |
2914 __ SetAccumulator(old_state); | 2906 __ SetAccumulator(old_state); |
2915 | 2907 |
2916 __ Dispatch(); | 2908 __ Dispatch(); |
2917 } | 2909 } |
2918 | 2910 |
2919 } // namespace interpreter | 2911 } // namespace interpreter |
2920 } // namespace internal | 2912 } // namespace internal |
2921 } // namespace v8 | 2913 } // namespace v8 |
OLD | NEW |