Previously, there was a bug there, fixed in r5581. But having an assert still makes...
authormikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 4 Oct 2010 12:54:31 +0000 (12:54 +0000)
committermikhail.naganov@gmail.com <mikhail.naganov@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 4 Oct 2010 12:54:31 +0000 (12:54 +0000)
Also, add functions registration to CPU profiler in case
when closure code wasn't compiled yet.

Review URL: http://codereview.chromium.org/3557007

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

src/handles.cc

index ae3792c..759d7ce 100644 (file)
@@ -788,11 +788,13 @@ bool CompileLazy(Handle<JSFunction> function,
                  ClearExceptionFlag flag) {
   if (function->shared()->is_compiled()) {
     function->set_code(function->shared()->code());
+    PROFILE(FunctionCreateEvent(*function));
     function->shared()->set_code_age(0);
     return true;
   } else {
     CompilationInfo info(function);
     bool result = CompileLazyHelper(&info, flag);
+    ASSERT(!result || function->is_compiled());
     PROFILE(FunctionCreateEvent(*function));
     return result;
   }
@@ -803,12 +805,14 @@ bool CompileLazyInLoop(Handle<JSFunction> function,
                        ClearExceptionFlag flag) {
   if (function->shared()->is_compiled()) {
     function->set_code(function->shared()->code());
+    PROFILE(FunctionCreateEvent(*function));
     function->shared()->set_code_age(0);
     return true;
   } else {
     CompilationInfo info(function);
     info.MarkAsInLoop();
     bool result = CompileLazyHelper(&info, flag);
+    ASSERT(!result || function->is_compiled());
     PROFILE(FunctionCreateEvent(*function));
     return result;
   }