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

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

Issue 5220007: Force pretenuring of closures that are immediately assigned to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 1 month 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
Index: src/arm/full-codegen-arm.cc
===================================================================
--- src/arm/full-codegen-arm.cc (revision 5865)
+++ src/arm/full-codegen-arm.cc (working copy)
@@ -860,18 +860,23 @@
}
-void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info) {
+void FullCodeGenerator::EmitNewClosure(Handle<SharedFunctionInfo> info,
+ bool pretenure) {
// Use the fast case closure allocation code that allocates in new
// space for nested functions that don't need literals cloning.
- if (scope()->is_function_scope() && info->num_literals() == 0) {
+ if (scope()->is_function_scope() &&
+ info->num_literals() == 0 &&
+ !pretenure) {
FastNewClosureStub stub;
__ mov(r0, Operand(info));
__ push(r0);
__ CallStub(&stub);
} else {
__ mov(r0, Operand(info));
- __ Push(cp, r0);
- __ CallRuntime(Runtime::kNewClosure, 2);
+ __ LoadRoot(r1, pretenure ? Heap::kTrueValueRootIndex
+ : Heap::kFalseValueRootIndex);
+ __ Push(cp, r0, r1);
+ __ CallRuntime(Runtime::kNewClosure, 3);
}
context()->Plug(r0);
}
« src/arm/codegen-arm.cc ('K') | « src/arm/codegen-arm.cc ('k') | src/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698