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

Unified Diff: src/full-codegen/full-codegen.cc

Issue 2614373002: [FeedbackVector] Infrastructure for literal arrays in the vector. (Closed)
Patch Set: Release compile 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/full-codegen/full-codegen.h ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/full-codegen.cc
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc
index 56440d95a5020ab71981a5c079fabea3c3ce014f..81fd485671b96cf7c1545bea30ee0aacf5490c79 100644
--- a/src/full-codegen/full-codegen.cc
+++ b/src/full-codegen/full-codegen.cc
@@ -1023,7 +1023,11 @@ void FullCodeGenerator::EmitUnwindAndReturn() {
}
void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
+ FeedbackVectorSlot slot,
bool pretenure) {
+ // If slot is invalid, then it's a native function literal and we
+ // can pass the empty array or empty literal array, something like that...
+
// If we're running with the --always-opt or the --prepare-always-opt
// flag, we need to use the runtime function so that the new function
// we are creating here gets a chance to have its code optimized and
@@ -1032,9 +1036,15 @@ void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
scope()->is_function_scope()) {
Callable callable = CodeFactory::FastNewClosure(isolate());
__ Move(callable.descriptor().GetRegisterParameter(0), info);
+ __ EmitLoadTypeFeedbackVector(
+ callable.descriptor().GetRegisterParameter(1));
+ __ Move(callable.descriptor().GetRegisterParameter(2), SmiFromSlot(slot));
__ Call(callable.code(), RelocInfo::CODE_TARGET);
} else {
__ Push(info);
+ __ EmitLoadTypeFeedbackVector(result_register());
+ __ Push(result_register());
+ __ Push(SmiFromSlot(slot));
__ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured
: Runtime::kNewClosure);
}
@@ -1288,7 +1298,7 @@ void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) {
SetStackOverflow();
return;
}
- EmitNewClosure(function_info, expr->pretenure());
+ EmitNewClosure(function_info, expr->LiteralFeedbackSlot(), expr->pretenure());
}
@@ -1321,7 +1331,7 @@ void FullCodeGenerator::VisitNativeFunctionLiteral(
Comment cmnt(masm_, "[ NativeFunctionLiteral");
Handle<SharedFunctionInfo> shared =
Compiler::GetSharedFunctionInfoForNative(expr->extension(), expr->name());
- EmitNewClosure(shared, false);
+ EmitNewClosure(shared, expr->LiteralFeedbackSlot(), false);
}
« no previous file with comments | « src/full-codegen/full-codegen.h ('k') | src/ia32/interface-descriptors-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698