Chromium Code Reviews| Index: src/handles.cc |
| diff --git a/src/handles.cc b/src/handles.cc |
| index d625d644c776e744251d69bfc7f582b77751c1b2..cdd33e309af58720216e1e147bfd937345127c3d 100644 |
| --- a/src/handles.cc |
| +++ b/src/handles.cc |
| @@ -834,14 +834,16 @@ bool CompileLazyShared(Handle<SharedFunctionInfo> shared, |
| } |
| -bool CompileLazy(Handle<JSFunction> function, |
| - ClearExceptionFlag flag) { |
| +static bool CompileLazyFunction(Handle<JSFunction> function, |
| + ClearExceptionFlag flag, |
| + bool in_loop) { |
| bool result = true; |
| if (function->shared()->is_compiled()) { |
| function->ReplaceCode(function->shared()->code()); |
| function->shared()->set_code_age(0); |
| } else { |
| CompilationInfo info(function); |
| + if (in_loop) info.MarkAsInLoop(); |
| result = CompileLazyHelper(&info, flag); |
| ASSERT(!result || function->is_compiled()); |
| } |
| @@ -852,22 +854,15 @@ bool CompileLazy(Handle<JSFunction> function, |
| } |
| +bool CompileLazy(Handle<JSFunction> function, |
| + ClearExceptionFlag flag) { |
| + return CompileLazyFunction(function, flag, false /* in loop */); |
|
Kevin Millikin (Chromium)
2011/02/18 16:16:58
The C style comment is OK, but I don't think we ha
antonm
2011/02/21 18:27:58
(And responding to Slava too): I didn't want to in
|
| +} |
| + |
| + |
| bool CompileLazyInLoop(Handle<JSFunction> function, |
| ClearExceptionFlag flag) { |
| - bool result = true; |
| - if (function->shared()->is_compiled()) { |
| - function->ReplaceCode(function->shared()->code()); |
| - function->shared()->set_code_age(0); |
| - } else { |
| - CompilationInfo info(function); |
| - info.MarkAsInLoop(); |
| - result = CompileLazyHelper(&info, flag); |
| - ASSERT(!result || function->is_compiled()); |
| - } |
| - if (result && function->is_compiled()) { |
| - PROFILE(FunctionCreateEvent(*function)); |
| - } |
| - return result; |
| + return CompileLazyFunction(function, flag, true /* in loop */); |
| } |