Chromium Code Reviews| Index: src/compiler.cc |
| diff --git a/src/compiler.cc b/src/compiler.cc |
| index 92f8c11a190921e96674e795e63032f3374d24b0..b8a189fd2a8f077da7bc63d0910f60b680abaf19 100644 |
| --- a/src/compiler.cc |
| +++ b/src/compiler.cc |
| @@ -948,6 +948,10 @@ Handle<SharedFunctionInfo> Compiler::CompileScript( |
| MaybeHandle<SharedFunctionInfo> maybe_result; |
| Handle<SharedFunctionInfo> result; |
| if (extension == NULL) { |
| + if (FLAG_serialize_toplevel && cached_data_mode == CONSUME_CACHED_DATA) { |
| + Object* des = CodeSerializer::Deserialize(isolate, *cached_data); |
| + return handle(SharedFunctionInfo::cast(des), isolate); |
| + } |
|
vogelheim
2014/07/07 15:20:00
[For my understanding; not criticism:]
Why is thi
Yang
2014/07/08 09:01:05
You got a point. I reordered this. However, I thin
|
| maybe_result = compilation_cache->LookupScript( |
| source, script_name, line_offset, column_offset, |
| is_shared_cross_origin, context); |
| @@ -971,17 +975,21 @@ Handle<SharedFunctionInfo> Compiler::CompileScript( |
| // Compile the function and add it to the cache. |
| CompilationInfoWithZone info(script); |
| info.MarkAsGlobal(); |
| - info.SetExtension(extension); |
| info.SetCachedData(cached_data, cached_data_mode); |
| + info.SetExtension(extension); |
| info.SetContext(context); |
| if (FLAG_use_strict) info.SetStrictMode(STRICT); |
| + |
| result = CompileToplevel(&info); |
| if (extension == NULL && !result.is_null() && !result->dont_cache()) { |
| compilation_cache->PutScript(source, context, result); |
| + if (FLAG_serialize_toplevel && cached_data_mode == PRODUCE_CACHED_DATA) { |
| + *cached_data = CodeSerializer::Serialize(result); |
| + } |
| } |
| if (result.is_null()) isolate->ReportPendingMessages(); |
| } else if (result->ic_age() != isolate->heap()->global_ic_age()) { |
| - result->ResetForNewContext(isolate->heap()->global_ic_age()); |
| + result->ResetForNewContext(isolate->heap()->global_ic_age()); |
| } |
| return result; |
| } |