Chromium Code Reviews| Index: src/objects.cc |
| diff --git a/src/objects.cc b/src/objects.cc |
| index 03e0120b0e047705ac6658891523df9461a5decc..0da8815c1448343aad281956cde065de64e596c0 100644 |
| --- a/src/objects.cc |
| +++ b/src/objects.cc |
| @@ -9290,11 +9290,12 @@ void JSFunction::MarkInRecompileQueue() { |
| static bool CompileLazyHelper(CompilationInfo* info, |
| - ClearExceptionFlag flag) { |
| + ClearExceptionFlag flag, |
| + bool install) { |
|
Michael Starzinger
2013/07/31 14:55:50
The boolean flag is obsolete, see comments in "com
|
| // Compile the source information to a code object. |
| ASSERT(info->IsOptimizing() || !info->shared_info()->is_compiled()); |
| ASSERT(!info->isolate()->has_pending_exception()); |
| - bool result = Compiler::CompileLazy(info); |
| + bool result = Compiler::CompileLazy(info, install); |
| ASSERT(result != Isolate::Current()->has_pending_exception()); |
| if (!result && flag == CLEAR_EXCEPTION) { |
| info->isolate()->clear_pending_exception(); |
| @@ -9307,7 +9308,7 @@ bool SharedFunctionInfo::CompileLazy(Handle<SharedFunctionInfo> shared, |
| ClearExceptionFlag flag) { |
| ASSERT(shared->allows_lazy_compilation_without_context()); |
| CompilationInfoWithZone info(shared); |
| - return CompileLazyHelper(&info, flag); |
| + return CompileLazyHelper(&info, flag, true); |
| } |
| @@ -9457,19 +9458,31 @@ bool JSFunction::CompileLazy(Handle<JSFunction> function, |
| } else { |
| ASSERT(function->shared()->allows_lazy_compilation()); |
| CompilationInfoWithZone info(function); |
| - result = CompileLazyHelper(&info, flag); |
| + result = CompileLazyHelper(&info, flag, true); |
| ASSERT(!result || function->is_compiled()); |
| } |
| return result; |
| } |
| -bool JSFunction::CompileOptimized(Handle<JSFunction> function, |
| +Handle<Code> JSFunction::CompileOsr(Handle<JSFunction> function, |
| BailoutId osr_ast_id, |
| ClearExceptionFlag flag) { |
| CompilationInfoWithZone info(function); |
| info.SetOptimizing(osr_ast_id); |
| - return CompileLazyHelper(&info, flag); |
| + if (CompileLazyHelper(&info, flag, false)) { |
| + return info.code(); |
| + } else { |
| + return Handle<Code>::null(); |
| + } |
| +} |
| + |
| + |
| +bool JSFunction::CompileOptimized(Handle<JSFunction> function, |
| + ClearExceptionFlag flag) { |
| + CompilationInfoWithZone info(function); |
| + info.SetOptimizing(BailoutId::None()); |
| + return CompileLazyHelper(&info, flag, true); |
| } |