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
This commit is contained in:
mikhail.naganov@gmail.com 2010-10-04 12:54:31 +00:00
parent bef3ae07db
commit 2f54abf974

View 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;
}