OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 | 8 |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 CompilationCache* compilation_cache = isolate->compilation_cache(); | 1170 CompilationCache* compilation_cache = isolate->compilation_cache(); |
1171 | 1171 |
1172 // Do a lookup in the compilation cache but not for extensions. | 1172 // Do a lookup in the compilation cache but not for extensions. |
1173 MaybeHandle<SharedFunctionInfo> maybe_result; | 1173 MaybeHandle<SharedFunctionInfo> maybe_result; |
1174 Handle<SharedFunctionInfo> result; | 1174 Handle<SharedFunctionInfo> result; |
1175 if (extension == NULL) { | 1175 if (extension == NULL) { |
1176 if (FLAG_serialize_toplevel && | 1176 if (FLAG_serialize_toplevel && |
1177 compile_options == ScriptCompiler::kConsumeCodeCache && | 1177 compile_options == ScriptCompiler::kConsumeCodeCache && |
1178 !isolate->debug()->is_loaded()) { | 1178 !isolate->debug()->is_loaded()) { |
1179 HistogramTimerScope timer(isolate->counters()->compile_deserialize()); | 1179 HistogramTimerScope timer(isolate->counters()->compile_deserialize()); |
1180 return CodeSerializer::Deserialize(isolate, *cached_data, source); | 1180 Handle<SharedFunctionInfo> result; |
| 1181 if (CodeSerializer::Deserialize(isolate, *cached_data, source) |
| 1182 .ToHandle(&result)) { |
| 1183 return result; |
| 1184 } |
| 1185 // Deserializer failed. Fall through to compile. |
1181 } else { | 1186 } else { |
1182 maybe_result = compilation_cache->LookupScript( | 1187 maybe_result = compilation_cache->LookupScript( |
1183 source, script_name, line_offset, column_offset, | 1188 source, script_name, line_offset, column_offset, |
1184 is_shared_cross_origin, context); | 1189 is_shared_cross_origin, context); |
1185 } | 1190 } |
1186 } | 1191 } |
1187 | 1192 |
1188 base::ElapsedTimer timer; | 1193 base::ElapsedTimer timer; |
1189 if (FLAG_profile_deserialization && FLAG_serialize_toplevel && | 1194 if (FLAG_profile_deserialization && FLAG_serialize_toplevel && |
1190 compile_options == ScriptCompiler::kProduceCodeCache) { | 1195 compile_options == ScriptCompiler::kProduceCodeCache) { |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1446 AllowHandleDereference allow_deref; | 1451 AllowHandleDereference allow_deref; |
1447 bool tracing_on = info()->IsStub() | 1452 bool tracing_on = info()->IsStub() |
1448 ? FLAG_trace_hydrogen_stubs | 1453 ? FLAG_trace_hydrogen_stubs |
1449 : (FLAG_trace_hydrogen && | 1454 : (FLAG_trace_hydrogen && |
1450 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); | 1455 info()->closure()->PassesFilter(FLAG_trace_hydrogen_filter)); |
1451 return (tracing_on && | 1456 return (tracing_on && |
1452 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); | 1457 base::OS::StrChr(const_cast<char*>(FLAG_trace_phase), name_[0]) != NULL); |
1453 } | 1458 } |
1454 | 1459 |
1455 } } // namespace v8::internal | 1460 } } // namespace v8::internal |
OLD | NEW |