| 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_cell = jsgraph()->HeapConstant( |
| 769 handle(Cell::cast(p.feedback().vector()->Get(slot)), isolate())); |
| 770 |
| 767 // Note that it is only safe to embed the raw entry point of the compile | 771 // Note that it is only safe to embed the raw entry point of the compile |
| 768 // lazy stub into the code, because that stub is immortal and immovable. | 772 // lazy stub into the code, because that stub is immortal and immovable. |
| 769 Node* compile_entry = jsgraph()->PointerConstant( | 773 Node* compile_entry = jsgraph()->PointerConstant( |
| 770 jsgraph()->isolate()->builtins()->CompileLazy()->entry()); | 774 jsgraph()->isolate()->builtins()->CompileLazy()->entry()); |
| 771 Node* empty_fixed_array = jsgraph()->EmptyFixedArrayConstant(); | 775 Node* empty_fixed_array = jsgraph()->EmptyFixedArrayConstant(); |
| 772 Node* empty_feedback_vector = jsgraph()->EmptyFeedbackVectorConstant(); | |
| 773 Node* the_hole = jsgraph()->TheHoleConstant(); | 776 Node* the_hole = jsgraph()->TheHoleConstant(); |
| 774 Node* undefined = jsgraph()->UndefinedConstant(); | 777 Node* undefined = jsgraph()->UndefinedConstant(); |
| 775 AllocationBuilder a(jsgraph(), effect, control); | 778 AllocationBuilder a(jsgraph(), effect, control); |
| 776 STATIC_ASSERT(JSFunction::kSize == 9 * kPointerSize); | 779 STATIC_ASSERT(JSFunction::kSize == 9 * kPointerSize); |
| 777 a.Allocate(JSFunction::kSize, p.pretenure()); | 780 a.Allocate(JSFunction::kSize, p.pretenure()); |
| 778 a.Store(AccessBuilder::ForMap(), function_map); | 781 a.Store(AccessBuilder::ForMap(), function_map); |
| 779 a.Store(AccessBuilder::ForJSObjectProperties(), empty_fixed_array); | 782 a.Store(AccessBuilder::ForJSObjectProperties(), empty_fixed_array); |
| 780 a.Store(AccessBuilder::ForJSObjectElements(), empty_fixed_array); | 783 a.Store(AccessBuilder::ForJSObjectElements(), empty_fixed_array); |
| 781 a.Store(AccessBuilder::ForJSFunctionFeedbackVector(), empty_feedback_vector); | 784 a.Store(AccessBuilder::ForJSFunctionFeedbackVector(), literals_cell); |
| 782 a.Store(AccessBuilder::ForJSFunctionPrototypeOrInitialMap(), the_hole); | 785 a.Store(AccessBuilder::ForJSFunctionPrototypeOrInitialMap(), the_hole); |
| 783 a.Store(AccessBuilder::ForJSFunctionSharedFunctionInfo(), shared); | 786 a.Store(AccessBuilder::ForJSFunctionSharedFunctionInfo(), shared); |
| 784 a.Store(AccessBuilder::ForJSFunctionContext(), context); | 787 a.Store(AccessBuilder::ForJSFunctionContext(), context); |
| 785 a.Store(AccessBuilder::ForJSFunctionCodeEntry(), compile_entry); | 788 a.Store(AccessBuilder::ForJSFunctionCodeEntry(), compile_entry); |
| 786 a.Store(AccessBuilder::ForJSFunctionNextFunctionLink(), undefined); | 789 a.Store(AccessBuilder::ForJSFunctionNextFunctionLink(), undefined); |
| 787 RelaxControls(node); | 790 RelaxControls(node); |
| 788 a.FinishAndChange(node); | 791 a.FinishAndChange(node); |
| 789 return Changed(node); | 792 return Changed(node); |
| 790 } | 793 } |
| 791 | 794 |
| (...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1386 return jsgraph()->simplified(); | 1389 return jsgraph()->simplified(); |
| 1387 } | 1390 } |
| 1388 | 1391 |
| 1389 MachineOperatorBuilder* JSCreateLowering::machine() const { | 1392 MachineOperatorBuilder* JSCreateLowering::machine() const { |
| 1390 return jsgraph()->machine(); | 1393 return jsgraph()->machine(); |
| 1391 } | 1394 } |
| 1392 | 1395 |
| 1393 } // namespace compiler | 1396 } // namespace compiler |
| 1394 } // namespace internal | 1397 } // namespace internal |
| 1395 } // namespace v8 | 1398 } // namespace v8 |
| OLD | NEW |