Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index 5967a446291fc3988b07b95b7ebed6a251c7ffc9..7be6c4ddc0977a8a534fc057fba0377e016f9933 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -877,10 +877,12 @@ Handle<JSFunction> Compiler::GetFunctionFromEval(Handle<String> source, |
isolate->counters()->total_compile_size()->Increment(source_length); |
CompilationCache* compilation_cache = isolate->compilation_cache(); |
- Handle<SharedFunctionInfo> shared_info = compilation_cache->LookupEval( |
- source, context, strict_mode, scope_position); |
+ MaybeHandle<SharedFunctionInfo> maybe_shared_info = |
+ compilation_cache->LookupEval(source, context, strict_mode, |
+ scope_position); |
+ Handle<SharedFunctionInfo> shared_info; |
- if (shared_info.is_null()) { |
+ if (!maybe_shared_info.ToHandle(&shared_info)) { |
Handle<Script> script = isolate->factory()->NewScript(source); |
CompilationInfoWithZone info(script); |
info.MarkAsEval(); |
@@ -945,17 +947,15 @@ Handle<SharedFunctionInfo> Compiler::CompileScript( |
CompilationCache* compilation_cache = isolate->compilation_cache(); |
// Do a lookup in the compilation cache but not for extensions. |
+ MaybeHandle<SharedFunctionInfo> maybe_result; |
Handle<SharedFunctionInfo> result; |
if (extension == NULL) { |
- result = compilation_cache->LookupScript(source, |
- script_name, |
- line_offset, |
- column_offset, |
- is_shared_cross_origin, |
- context); |
+ maybe_result = compilation_cache->LookupScript( |
+ source, script_name, line_offset, column_offset, |
+ is_shared_cross_origin, context); |
} |
- if (result.is_null()) { |
+ if (!maybe_result.ToHandle(&result)) { |
// No cache entry found. Compile the script. |
// Create a script object describing the script to be compiled. |
@@ -981,11 +981,10 @@ Handle<SharedFunctionInfo> Compiler::CompileScript( |
if (extension == NULL && !result.is_null() && !result->dont_cache()) { |
compilation_cache->PutScript(source, context, result); |
} |
+ if (result.is_null()) isolate->ReportPendingMessages(); |
} else if (result->ic_age() != isolate->heap()->global_ic_age()) { |
result->ResetForNewContext(isolate->heap()->global_ic_age()); |
} |
- |
- if (result.is_null()) isolate->ReportPendingMessages(); |
return result; |
} |