Previously, there was a bug there, fixed in r5581. But having an assert still makes sense.

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
parent bef3ae07
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment