Do not automatically pretenure global closures in runtime.cc
authorerik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 20 Jun 2011 12:20:30 +0000 (12:20 +0000)
committererik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 20 Jun 2011 12:20:30 +0000 (12:20 +0000)
unless the caller has indicated that pretenuring is desirable.
This is intended to fix http://jsperf.com/scope-lookups/3
Review URL: http://codereview.chromium.org/7210011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8328 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/runtime.cc

index dd58b2b..07f18ee 100644 (file)
@@ -7488,10 +7488,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NewClosure) {
   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,