Revision: 11715
Author:   [email protected]
Date:     Tue Jun  5 06:15:35 2012
Log: Replace SharedFunctionInfo::EnsureCompiled with JSFunction::CompileLazy where possible.

After we get rid of all SharedFunctionInfo::EnsureCompiled calls, it will be possible to remove the HasTrivialOuterContext() condition in Scope::AllowsLazyCompilation.

[email protected]

Review URL: https://chromiumcodereview.appspot.com/10542002
http://code.google.com/p/v8/source/detail?r=11715

Modified:
 /branches/bleeding_edge/src/bootstrapper.cc
 /branches/bleeding_edge/src/runtime.cc

=======================================
--- /branches/bleeding_edge/src/bootstrapper.cc Wed May 23 07:24:29 2012
+++ /branches/bleeding_edge/src/bootstrapper.cc Tue Jun  5 06:15:35 2012
@@ -2092,14 +2092,10 @@
     Handle<JSFunction> function
         = Handle<JSFunction>(JSFunction::cast(function_object));
     builtins->set_javascript_builtin(id, *function);
-    Handle<SharedFunctionInfo> shared
-        = Handle<SharedFunctionInfo>(function->shared());
-    if (!SharedFunctionInfo::EnsureCompiled(shared, CLEAR_EXCEPTION)) {
+    if (!JSFunction::CompileLazy(function, CLEAR_EXCEPTION)) {
       return false;
     }
-    // Set the code object on the function object.
-    function->ReplaceCode(function->shared()->code());
-    builtins->set_javascript_builtin_code(id, shared->code());
+    builtins->set_javascript_builtin_code(id, function->shared()->code());
   }
   return true;
 }
=======================================
--- /branches/bleeding_edge/src/runtime.cc      Mon Jun  4 07:42:58 2012
+++ /branches/bleeding_edge/src/runtime.cc      Tue Jun  5 06:15:35 2012
@@ -2182,7 +2182,7 @@
     Handle<JSFunction> fun = Handle<JSFunction>::cast(code);
     Handle<SharedFunctionInfo> shared(fun->shared());

-    if (!SharedFunctionInfo::EnsureCompiled(shared, KEEP_EXCEPTION)) {
+    if (!JSFunction::CompileLazy(fun, KEEP_EXCEPTION)) {
       return Failure::Exception();
     }
     // Since we don't store the source for this we should never
@@ -12503,8 +12503,7 @@
   ASSERT(args.length() == 1);
   // Get the function and make sure it is compiled.
   CONVERT_ARG_HANDLE_CHECKED(JSFunction, func, 0);
-  Handle<SharedFunctionInfo> shared(func->shared());
-  if (!SharedFunctionInfo::EnsureCompiled(shared, KEEP_EXCEPTION)) {
+  if (!JSFunction::CompileLazy(func, KEEP_EXCEPTION)) {
     return Failure::Exception();
   }
   func->code()->PrintLn();
@@ -12519,11 +12518,10 @@
   ASSERT(args.length() == 1);
   // Get the function and make sure it is compiled.
   CONVERT_ARG_HANDLE_CHECKED(JSFunction, func, 0);
-  Handle<SharedFunctionInfo> shared(func->shared());
-  if (!SharedFunctionInfo::EnsureCompiled(shared, KEEP_EXCEPTION)) {
+  if (!JSFunction::CompileLazy(func, KEEP_EXCEPTION)) {
     return Failure::Exception();
   }
-  shared->construct_stub()->PrintLn();
+  func->shared()->construct_stub()->PrintLn();
 #endif  // DEBUG
   return isolate->heap()->undefined_value();
 }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to