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" |
| 11 #include "src/builtins/builtins-constructor.h" |
11 #include "src/code-factory.h" | 12 #include "src/code-factory.h" |
12 #include "src/compilation-info.h" | 13 #include "src/compilation-info.h" |
13 #include "src/compiler.h" | 14 #include "src/compiler.h" |
14 #include "src/factory.h" | 15 #include "src/factory.h" |
15 #include "src/interpreter/bytecode-flags.h" | 16 #include "src/interpreter/bytecode-flags.h" |
16 #include "src/interpreter/bytecode-generator.h" | 17 #include "src/interpreter/bytecode-generator.h" |
17 #include "src/interpreter/bytecodes.h" | 18 #include "src/interpreter/bytecodes.h" |
18 #include "src/interpreter/interpreter-assembler.h" | 19 #include "src/interpreter/interpreter-assembler.h" |
19 #include "src/interpreter/interpreter-intrinsics.h" | 20 #include "src/interpreter/interpreter-intrinsics.h" |
20 #include "src/log.h" | 21 #include "src/log.h" |
(...skipping 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2390 // constant pool and with the PretenureFlag <tenured>. | 2391 // constant pool and with the PretenureFlag <tenured>. |
2391 void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) { | 2392 void Interpreter::DoCreateClosure(InterpreterAssembler* assembler) { |
2392 Node* index = __ BytecodeOperandIdx(0); | 2393 Node* index = __ BytecodeOperandIdx(0); |
2393 Node* shared = __ LoadConstantPoolEntry(index); | 2394 Node* shared = __ LoadConstantPoolEntry(index); |
2394 Node* flags = __ BytecodeOperandFlag(1); | 2395 Node* flags = __ BytecodeOperandFlag(1); |
2395 Node* context = __ GetContext(); | 2396 Node* context = __ GetContext(); |
2396 | 2397 |
2397 Label call_runtime(assembler, Label::kDeferred); | 2398 Label call_runtime(assembler, Label::kDeferred); |
2398 __ GotoUnless(__ IsSetWord32<CreateClosureFlags::FastNewClosureBit>(flags), | 2399 __ GotoUnless(__ IsSetWord32<CreateClosureFlags::FastNewClosureBit>(flags), |
2399 &call_runtime); | 2400 &call_runtime); |
2400 __ SetAccumulator(FastNewClosureStub::Generate(assembler, shared, context)); | 2401 ConstructorBuiltinsAssembler constructor_assembler(assembler->state()); |
| 2402 __ SetAccumulator(constructor_assembler.EmitFastNewClosure(shared, context)); |
2401 __ Dispatch(); | 2403 __ Dispatch(); |
2402 | 2404 |
2403 __ Bind(&call_runtime); | 2405 __ Bind(&call_runtime); |
2404 { | 2406 { |
2405 Node* tenured_raw = | 2407 Node* tenured_raw = |
2406 __ DecodeWordFromWord32<CreateClosureFlags::PretenuredBit>(flags); | 2408 __ DecodeWordFromWord32<CreateClosureFlags::PretenuredBit>(flags); |
2407 Node* tenured = __ SmiTag(tenured_raw); | 2409 Node* tenured = __ SmiTag(tenured_raw); |
2408 Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context, | 2410 Node* result = __ CallRuntime(Runtime::kInterpreterNewClosure, context, |
2409 shared, tenured); | 2411 shared, tenured); |
2410 __ SetAccumulator(result); | 2412 __ SetAccumulator(result); |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2904 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, | 2906 __ StoreObjectField(generator, JSGeneratorObject::kContinuationOffset, |
2905 __ SmiTag(new_state)); | 2907 __ SmiTag(new_state)); |
2906 __ SetAccumulator(old_state); | 2908 __ SetAccumulator(old_state); |
2907 | 2909 |
2908 __ Dispatch(); | 2910 __ Dispatch(); |
2909 } | 2911 } |
2910 | 2912 |
2911 } // namespace interpreter | 2913 } // namespace interpreter |
2912 } // namespace internal | 2914 } // namespace internal |
2913 } // namespace v8 | 2915 } // namespace v8 |
OLD | NEW |