| 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/compiler.h" | 5 #include "src/compiler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "src/ast/ast-numbering.h" | 9 #include "src/ast/ast-numbering.h" |
| 10 #include "src/ast/prettyprinter.h" | 10 #include "src/ast/prettyprinter.h" |
| (...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1324 // Deserializer failed. Fall through to compile. | 1324 // Deserializer failed. Fall through to compile. |
| 1325 } | 1325 } |
| 1326 } | 1326 } |
| 1327 | 1327 |
| 1328 base::ElapsedTimer timer; | 1328 base::ElapsedTimer timer; |
| 1329 if (FLAG_profile_deserialization && FLAG_serialize_toplevel && | 1329 if (FLAG_profile_deserialization && FLAG_serialize_toplevel && |
| 1330 compile_options == ScriptCompiler::kProduceCodeCache) { | 1330 compile_options == ScriptCompiler::kProduceCodeCache) { |
| 1331 timer.Start(); | 1331 timer.Start(); |
| 1332 } | 1332 } |
| 1333 | 1333 |
| 1334 if (!maybe_result.ToHandle(&result)) { | 1334 if (!maybe_result.ToHandle(&result) || |
| 1335 // No cache entry found. Compile the script. | 1335 (FLAG_serialize_toplevel && |
| 1336 compile_options == ScriptCompiler::kProduceCodeCache)) { |
| 1337 // No cache entry found, or embedder wants a code cache. Compile the script. |
| 1336 | 1338 |
| 1337 // Create a script object describing the script to be compiled. | 1339 // Create a script object describing the script to be compiled. |
| 1338 Handle<Script> script = isolate->factory()->NewScript(source); | 1340 Handle<Script> script = isolate->factory()->NewScript(source); |
| 1339 if (natives == NATIVES_CODE) { | 1341 if (natives == NATIVES_CODE) { |
| 1340 script->set_type(Script::TYPE_NATIVE); | 1342 script->set_type(Script::TYPE_NATIVE); |
| 1341 script->set_hide_source(true); | 1343 script->set_hide_source(true); |
| 1342 } else if (natives == EXTENSION_CODE) { | 1344 } else if (natives == EXTENSION_CODE) { |
| 1343 script->set_type(Script::TYPE_EXTENSION); | 1345 script->set_type(Script::TYPE_EXTENSION); |
| 1344 script->set_hide_source(true); | 1346 script->set_hide_source(true); |
| 1345 } | 1347 } |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1663 MaybeHandle<Code> code; | 1665 MaybeHandle<Code> code; |
| 1664 if (cached.code != nullptr) code = handle(cached.code); | 1666 if (cached.code != nullptr) code = handle(cached.code); |
| 1665 Handle<Context> native_context(function->context()->native_context()); | 1667 Handle<Context> native_context(function->context()->native_context()); |
| 1666 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, | 1668 SharedFunctionInfo::AddToOptimizedCodeMap(shared, native_context, code, |
| 1667 literals, BailoutId::None()); | 1669 literals, BailoutId::None()); |
| 1668 } | 1670 } |
| 1669 } | 1671 } |
| 1670 | 1672 |
| 1671 } // namespace internal | 1673 } // namespace internal |
| 1672 } // namespace v8 | 1674 } // namespace v8 |
| OLD | NEW |