Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: src/compiler.cc

Issue 224733022: Handlify CompilationCache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compilation-cache.cc ('k') | src/jsregexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/compilation-cache.cc ('k') | src/jsregexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698