Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: src/compiler/js-create-lowering.cc

Issue 2620753003: [TypeFeedbackVector] Root literal arrays in function literals slots (Closed)
Patch Set: GCSTRESS fix. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler.cc ('k') | src/compiler/js-graph.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/compiler/js-graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698