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/compiler/js-create-lowering.h" | 5 #include "src/compiler/js-create-lowering.h" |
6 | 6 |
7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
10 #include "src/compiler/access-builder.h" | 10 #include "src/compiler/access-builder.h" |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 Handle<SharedFunctionInfo> shared = p.shared_info(); | 757 Handle<SharedFunctionInfo> shared = p.shared_info(); |
758 Node* effect = NodeProperties::GetEffectInput(node); | 758 Node* effect = NodeProperties::GetEffectInput(node); |
759 Node* control = NodeProperties::GetControlInput(node); | 759 Node* control = NodeProperties::GetControlInput(node); |
760 Node* context = NodeProperties::GetContextInput(node); | 760 Node* context = NodeProperties::GetContextInput(node); |
761 | 761 |
762 int const function_map_index = | 762 int const function_map_index = |
763 Context::FunctionMapIndex(shared->language_mode(), shared->kind()); | 763 Context::FunctionMapIndex(shared->language_mode(), shared->kind()); |
764 Node* function_map = jsgraph()->HeapConstant( | 764 Node* function_map = jsgraph()->HeapConstant( |
765 handle(Map::cast(native_context()->get(function_map_index)), isolate())); | 765 handle(Map::cast(native_context()->get(function_map_index)), isolate())); |
766 | 766 |
767 FeedbackVectorSlot slot = p.feedback().slot(); | |
768 Node* literals = jsgraph()->HeapConstant( | |
769 handle(LiteralsArray::cast(p.feedback().vector()->Get(slot)), isolate())); | |
770 | |
771 // Note that it is only safe to embed the raw entry point of the compile | 767 // Note that it is only safe to embed the raw entry point of the compile |
772 // lazy stub into the code, because that stub is immortal and immovable. | 768 // lazy stub into the code, because that stub is immortal and immovable. |
773 Node* compile_entry = jsgraph()->PointerConstant( | 769 Node* compile_entry = jsgraph()->PointerConstant( |
774 jsgraph()->isolate()->builtins()->CompileLazy()->entry()); | 770 jsgraph()->isolate()->builtins()->CompileLazy()->entry()); |
775 Node* empty_fixed_array = jsgraph()->EmptyFixedArrayConstant(); | 771 Node* empty_fixed_array = jsgraph()->EmptyFixedArrayConstant(); |
| 772 Node* empty_literals_array = jsgraph()->EmptyLiteralsArrayConstant(); |
776 Node* the_hole = jsgraph()->TheHoleConstant(); | 773 Node* the_hole = jsgraph()->TheHoleConstant(); |
777 Node* undefined = jsgraph()->UndefinedConstant(); | 774 Node* undefined = jsgraph()->UndefinedConstant(); |
778 AllocationBuilder a(jsgraph(), effect, control); | 775 AllocationBuilder a(jsgraph(), effect, control); |
779 STATIC_ASSERT(JSFunction::kSize == 9 * kPointerSize); | 776 STATIC_ASSERT(JSFunction::kSize == 9 * kPointerSize); |
780 a.Allocate(JSFunction::kSize, p.pretenure()); | 777 a.Allocate(JSFunction::kSize, p.pretenure()); |
781 a.Store(AccessBuilder::ForMap(), function_map); | 778 a.Store(AccessBuilder::ForMap(), function_map); |
782 a.Store(AccessBuilder::ForJSObjectProperties(), empty_fixed_array); | 779 a.Store(AccessBuilder::ForJSObjectProperties(), empty_fixed_array); |
783 a.Store(AccessBuilder::ForJSObjectElements(), empty_fixed_array); | 780 a.Store(AccessBuilder::ForJSObjectElements(), empty_fixed_array); |
784 a.Store(AccessBuilder::ForJSFunctionLiterals(), literals); | 781 a.Store(AccessBuilder::ForJSFunctionLiterals(), empty_literals_array); |
785 a.Store(AccessBuilder::ForJSFunctionPrototypeOrInitialMap(), the_hole); | 782 a.Store(AccessBuilder::ForJSFunctionPrototypeOrInitialMap(), the_hole); |
786 a.Store(AccessBuilder::ForJSFunctionSharedFunctionInfo(), shared); | 783 a.Store(AccessBuilder::ForJSFunctionSharedFunctionInfo(), shared); |
787 a.Store(AccessBuilder::ForJSFunctionContext(), context); | 784 a.Store(AccessBuilder::ForJSFunctionContext(), context); |
788 a.Store(AccessBuilder::ForJSFunctionCodeEntry(), compile_entry); | 785 a.Store(AccessBuilder::ForJSFunctionCodeEntry(), compile_entry); |
789 a.Store(AccessBuilder::ForJSFunctionNextFunctionLink(), undefined); | 786 a.Store(AccessBuilder::ForJSFunctionNextFunctionLink(), undefined); |
790 RelaxControls(node); | 787 RelaxControls(node); |
791 a.FinishAndChange(node); | 788 a.FinishAndChange(node); |
792 return Changed(node); | 789 return Changed(node); |
793 } | 790 } |
794 | 791 |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 return jsgraph()->simplified(); | 1385 return jsgraph()->simplified(); |
1389 } | 1386 } |
1390 | 1387 |
1391 MachineOperatorBuilder* JSCreateLowering::machine() const { | 1388 MachineOperatorBuilder* JSCreateLowering::machine() const { |
1392 return jsgraph()->machine(); | 1389 return jsgraph()->machine(); |
1393 } | 1390 } |
1394 | 1391 |
1395 } // namespace compiler | 1392 } // namespace compiler |
1396 } // namespace internal | 1393 } // namespace internal |
1397 } // namespace v8 | 1394 } // namespace v8 |
OLD | NEW |