| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins-constructor.h" | 5 #include "src/builtins/builtins-constructor.h" |
| 6 #include "src/ast/ast.h" | 6 #include "src/ast/ast.h" |
| 7 #include "src/builtins/builtins-utils.h" | 7 #include "src/builtins/builtins-utils.h" |
| 8 #include "src/builtins/builtins.h" | 8 #include "src/builtins/builtins.h" |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/code-stub-assembler.h" | 10 #include "src/code-stub-assembler.h" |
| 11 #include "src/interface-descriptors.h" | 11 #include "src/interface-descriptors.h" |
| 12 | 12 |
| 13 namespace v8 { | 13 namespace v8 { |
| 14 namespace internal { | 14 namespace internal { |
| 15 | 15 |
| 16 typedef compiler::Node Node; | 16 typedef compiler::Node Node; |
| 17 | 17 |
| 18 Node* ConstructorBuiltinsAssembler::EmitFastNewClosure(Node* shared_info, | 18 Node* ConstructorBuiltinsAssembler::EmitFastNewClosure(Node* shared_info, |
| 19 Node* feedback_vector, |
| 20 Node* slot, |
| 19 Node* context) { | 21 Node* context) { |
| 20 typedef compiler::CodeAssembler::Label Label; | 22 typedef compiler::CodeAssembler::Label Label; |
| 21 typedef compiler::CodeAssembler::Variable Variable; | 23 typedef compiler::CodeAssembler::Variable Variable; |
| 22 | 24 |
| 23 Isolate* isolate = this->isolate(); | 25 Isolate* isolate = this->isolate(); |
| 24 Factory* factory = isolate->factory(); | 26 Factory* factory = isolate->factory(); |
| 25 IncrementCounter(isolate->counters()->fast_new_closure_total(), 1); | 27 IncrementCounter(isolate->counters()->fast_new_closure_total(), 1); |
| 26 | 28 |
| 27 // Create a new closure from the given function info in new space | 29 // Create a new closure from the given function info in new space |
| 28 Node* result = Allocate(JSFunction::kSize); | 30 Node* result = Allocate(JSFunction::kSize); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 MachineType::PointerRepresentation()); | 143 MachineType::PointerRepresentation()); |
| 142 StoreObjectFieldNoWriteBarrier(result, JSFunction::kNextFunctionLinkOffset, | 144 StoreObjectFieldNoWriteBarrier(result, JSFunction::kNextFunctionLinkOffset, |
| 143 UndefinedConstant()); | 145 UndefinedConstant()); |
| 144 | 146 |
| 145 return result; | 147 return result; |
| 146 } | 148 } |
| 147 | 149 |
| 148 TF_BUILTIN(FastNewClosure, ConstructorBuiltinsAssembler) { | 150 TF_BUILTIN(FastNewClosure, ConstructorBuiltinsAssembler) { |
| 149 Node* shared = Parameter(FastNewClosureDescriptor::kSharedFunctionInfo); | 151 Node* shared = Parameter(FastNewClosureDescriptor::kSharedFunctionInfo); |
| 150 Node* context = Parameter(FastNewClosureDescriptor::kContext); | 152 Node* context = Parameter(FastNewClosureDescriptor::kContext); |
| 151 Return(EmitFastNewClosure(shared, context)); | 153 Node* vector = Parameter(FastNewClosureDescriptor::kVector); |
| 154 Node* slot = Parameter(FastNewClosureDescriptor::kSlot); |
| 155 Return(EmitFastNewClosure(shared, vector, slot, context)); |
| 152 } | 156 } |
| 153 | 157 |
| 154 TF_BUILTIN(FastNewObject, ConstructorBuiltinsAssembler) { | 158 TF_BUILTIN(FastNewObject, ConstructorBuiltinsAssembler) { |
| 155 typedef FastNewObjectDescriptor Descriptor; | 159 typedef FastNewObjectDescriptor Descriptor; |
| 156 Node* context = Parameter(Descriptor::kContext); | 160 Node* context = Parameter(Descriptor::kContext); |
| 157 Node* target = Parameter(Descriptor::kTarget); | 161 Node* target = Parameter(Descriptor::kTarget); |
| 158 Node* new_target = Parameter(Descriptor::kNewTarget); | 162 Node* new_target = Parameter(Descriptor::kNewTarget); |
| 159 | 163 |
| 160 Label call_runtime(this); | 164 Label call_runtime(this); |
| 161 | 165 |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 case 6: | 763 case 6: |
| 760 return FastCloneShallowObject6(); | 764 return FastCloneShallowObject6(); |
| 761 default: | 765 default: |
| 762 UNREACHABLE(); | 766 UNREACHABLE(); |
| 763 } | 767 } |
| 764 return Handle<Code>::null(); | 768 return Handle<Code>::null(); |
| 765 } | 769 } |
| 766 | 770 |
| 767 } // namespace internal | 771 } // namespace internal |
| 768 } // namespace v8 | 772 } // namespace v8 |
| OLD | NEW |