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