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

Unified Diff: src/compiler/js-create-lowering.cc

Issue 1906823002: Move of the type feedback vector to the closure. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-create-lowering.cc
diff --git a/src/compiler/js-create-lowering.cc b/src/compiler/js-create-lowering.cc
index 895293469c3489c1f6092e5a0c908f5f93822d6c..11e07d626575fd3648b2c22db71a904400ba82c4 100644
--- a/src/compiler/js-create-lowering.cc
+++ b/src/compiler/js-create-lowering.cc
@@ -548,44 +548,40 @@ Reduction JSCreateLowering::ReduceJSCreateClosure(Node* node) {
CreateClosureParameters const& p = CreateClosureParametersOf(node->op());
Handle<SharedFunctionInfo> shared = p.shared_info();
- // Use inline allocation for functions that don't need literals cloning.
- if (shared->num_literals() == 0) {
- Node* effect = NodeProperties::GetEffectInput(node);
- Node* control = NodeProperties::GetControlInput(node);
- Node* context = NodeProperties::GetContextInput(node);
- Node* native_context = effect = graph()->NewNode(
- javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true),
- context, context, effect);
- int function_map_index =
- Context::FunctionMapIndex(shared->language_mode(), shared->kind());
- Node* function_map = effect =
- graph()->NewNode(javascript()->LoadContext(0, function_map_index, true),
- native_context, native_context, effect);
- // Note that it is only safe to embed the raw entry point of the compile
- // lazy stub into the code, because that stub is immortal and immovable.
- Node* compile_entry = jsgraph()->IntPtrConstant(reinterpret_cast<intptr_t>(
- jsgraph()->isolate()->builtins()->CompileLazy()->entry()));
- Node* empty_fixed_array = jsgraph()->EmptyFixedArrayConstant();
- Node* the_hole = jsgraph()->TheHoleConstant();
- Node* undefined = jsgraph()->UndefinedConstant();
- AllocationBuilder a(jsgraph(), effect, control);
- STATIC_ASSERT(JSFunction::kSize == 9 * kPointerSize);
- a.Allocate(JSFunction::kSize, p.pretenure());
- a.Store(AccessBuilder::ForMap(), function_map);
- a.Store(AccessBuilder::ForJSObjectProperties(), empty_fixed_array);
- a.Store(AccessBuilder::ForJSObjectElements(), empty_fixed_array);
- a.Store(AccessBuilder::ForJSFunctionLiterals(), empty_fixed_array);
- a.Store(AccessBuilder::ForJSFunctionPrototypeOrInitialMap(), the_hole);
- a.Store(AccessBuilder::ForJSFunctionSharedFunctionInfo(), shared);
- a.Store(AccessBuilder::ForJSFunctionContext(), context);
- a.Store(AccessBuilder::ForJSFunctionCodeEntry(), compile_entry);
- a.Store(AccessBuilder::ForJSFunctionNextFunctionLink(), undefined);
- RelaxControls(node);
- a.FinishAndChange(node);
- return Changed(node);
- }
-
- return NoChange();
+ Node* effect = NodeProperties::GetEffectInput(node);
+ Node* control = NodeProperties::GetControlInput(node);
+ Node* context = NodeProperties::GetContextInput(node);
+ Node* native_context = effect = graph()->NewNode(
+ javascript()->LoadContext(0, Context::NATIVE_CONTEXT_INDEX, true),
+ context, context, effect);
+ int function_map_index =
+ Context::FunctionMapIndex(shared->language_mode(), shared->kind());
+ Node* function_map = effect =
+ graph()->NewNode(javascript()->LoadContext(0, function_map_index, true),
+ native_context, native_context, effect);
+ // Note that it is only safe to embed the raw entry point of the compile
+ // lazy stub into the code, because that stub is immortal and immovable.
+ Node* compile_entry = jsgraph()->IntPtrConstant(reinterpret_cast<intptr_t>(
+ jsgraph()->isolate()->builtins()->CompileLazy()->entry()));
+ Node* empty_fixed_array = jsgraph()->EmptyFixedArrayConstant();
+ Node* empty_literals_array = jsgraph()->EmptyLiteralsArrayConstant();
+ Node* the_hole = jsgraph()->TheHoleConstant();
+ Node* undefined = jsgraph()->UndefinedConstant();
+ AllocationBuilder a(jsgraph(), effect, control);
+ STATIC_ASSERT(JSFunction::kSize == 9 * kPointerSize);
+ a.Allocate(JSFunction::kSize, p.pretenure());
+ a.Store(AccessBuilder::ForMap(), function_map);
+ a.Store(AccessBuilder::ForJSObjectProperties(), empty_fixed_array);
+ a.Store(AccessBuilder::ForJSObjectElements(), empty_fixed_array);
+ a.Store(AccessBuilder::ForJSFunctionLiterals(), empty_literals_array);
+ a.Store(AccessBuilder::ForJSFunctionPrototypeOrInitialMap(), the_hole);
+ a.Store(AccessBuilder::ForJSFunctionSharedFunctionInfo(), shared);
+ a.Store(AccessBuilder::ForJSFunctionContext(), context);
+ a.Store(AccessBuilder::ForJSFunctionCodeEntry(), compile_entry);
+ a.Store(AccessBuilder::ForJSFunctionNextFunctionLink(), undefined);
+ RelaxControls(node);
+ a.FinishAndChange(node);
+ return Changed(node);
}
Reduction JSCreateLowering::ReduceJSCreateIterResultObject(Node* node) {
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698