Do not automatically pretenure global closures in runtime.cc (issue7210011)

0 views
Skip to first unread message

erik....@gmail.com

unread,
Jun 20, 2011, 8:06:33 AM6/20/11
to ag...@chromium.org, v8-...@googlegroups.com
Reviewers: Mads Ager,

Description:
Do not automatically pretenure global closures in runtime.cc
unless the caller has indicated that pretenuring is desirable.
This is intended to fix http://jsperf.com/scope-lookups/3

Please review this at http://codereview.chromium.org/7210011/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
M src/runtime.cc


Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 8323)
+++ src/runtime.cc (working copy)
@@ -7488,10 +7488,8 @@
CONVERT_ARG_CHECKED(SharedFunctionInfo, shared, 1);
CONVERT_BOOLEAN_CHECKED(pretenure, args[2]);

- // Allocate global closures in old space and allocate local closures
- // in new space. Additionally pretenure closures that are assigned
+ // The caller ensures that we pretenure closures that are assigned
// directly to properties.
- pretenure = pretenure || (context->global_context() == *context);
PretenureFlag pretenure_flag = pretenure ? TENURED : NOT_TENURED;
Handle<JSFunction> result =
isolate->factory()->NewFunctionFromSharedFunctionInfo(shared,


ag...@chromium.org

unread,
Jun 20, 2011, 8:09:07 AM6/20/11
to erik....@gmail.com, v8-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages