Index: src/full-codegen/full-codegen.cc |
diff --git a/src/full-codegen/full-codegen.cc b/src/full-codegen/full-codegen.cc |
index 20eb47e05652d3d40e9d8700d296a35b459b5d00..e5de9fec913b5d7029b25b954871d14bca27c2f0 100644 |
--- a/src/full-codegen/full-codegen.cc |
+++ b/src/full-codegen/full-codegen.cc |
@@ -1019,7 +1019,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 |
@@ -1028,9 +1032,17 @@ void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info, |
scope()->is_function_scope()) { |
FastNewClosureStub stub(isolate()); |
__ Move(stub.GetCallInterfaceDescriptor().GetRegisterParameter(0), info); |
+ DCHECK(!slot.IsInvalid()); |
+ __ EmitLoadTypeFeedbackVector( |
+ stub.GetCallInterfaceDescriptor().GetRegisterParameter(1)); |
+ __ Move(stub.GetCallInterfaceDescriptor().GetRegisterParameter(2), |
+ SmiFromSlot(slot)); |
__ CallStub(&stub); |
} else { |
__ Push(info); |
+ __ EmitLoadTypeFeedbackVector(result_register()); |
+ __ Push(result_register()); |
+ __ Push(SmiFromSlot(slot)); |
__ CallRuntime(pretenure ? Runtime::kNewClosure_Tenured |
: Runtime::kNewClosure); |
} |
@@ -1292,7 +1304,7 @@ void FullCodeGenerator::VisitFunctionLiteral(FunctionLiteral* expr) { |
SetStackOverflow(); |
return; |
} |
- EmitNewClosure(function_info, expr->pretenure()); |
+ EmitNewClosure(function_info, expr->LiteralFeedbackSlot(), expr->pretenure()); |
} |
@@ -1325,7 +1337,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); |
} |