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/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1708 } | 1708 } |
1709 | 1709 |
1710 | 1710 |
1711 MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal( | 1711 MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal( |
1712 Isolate* v8_isolate, Source* source, CompileOptions options, | 1712 Isolate* v8_isolate, Source* source, CompileOptions options, |
1713 bool is_module) { | 1713 bool is_module) { |
1714 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 1714 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
1715 PREPARE_FOR_EXECUTION_WITH_ISOLATE( | 1715 PREPARE_FOR_EXECUTION_WITH_ISOLATE( |
1716 isolate, "v8::ScriptCompiler::CompileUnbound()", UnboundScript); | 1716 isolate, "v8::ScriptCompiler::CompileUnbound()", UnboundScript); |
1717 | 1717 |
1718 // Support the old API for a transition period: | |
1719 // - kProduceToCache -> kProduceParserCache | |
1720 // - kNoCompileOptions + cached_data != NULL -> kConsumeParserCache | |
1721 if (options == kProduceDataToCache) { | |
1722 options = kProduceParserCache; | |
1723 } else if (options == kNoCompileOptions && source->cached_data) { | |
1724 options = kConsumeParserCache; | |
1725 } | |
1726 | |
1727 // Don't try to produce any kind of cache when the debugger is loaded. | 1718 // Don't try to produce any kind of cache when the debugger is loaded. |
1728 if (isolate->debug()->is_loaded() && | 1719 if (isolate->debug()->is_loaded() && |
1729 (options == kProduceParserCache || options == kProduceCodeCache)) { | 1720 (options == kProduceParserCache || options == kProduceCodeCache)) { |
1730 options = kNoCompileOptions; | 1721 options = kNoCompileOptions; |
1731 } | 1722 } |
1732 | 1723 |
1733 i::ScriptData* script_data = NULL; | 1724 i::ScriptData* script_data = NULL; |
1734 if (options == kConsumeParserCache || options == kConsumeCodeCache) { | 1725 if (options == kConsumeParserCache || options == kConsumeCodeCache) { |
1735 DCHECK(source->cached_data); | 1726 DCHECK(source->cached_data); |
1736 // ScriptData takes care of pointer-aligning the data. | 1727 // ScriptData takes care of pointer-aligning the data. |
(...skipping 6776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8513 Address callback_address = | 8504 Address callback_address = |
8514 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8505 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8515 VMState<EXTERNAL> state(isolate); | 8506 VMState<EXTERNAL> state(isolate); |
8516 ExternalCallbackScope call_scope(isolate, callback_address); | 8507 ExternalCallbackScope call_scope(isolate, callback_address); |
8517 callback(info); | 8508 callback(info); |
8518 } | 8509 } |
8519 | 8510 |
8520 | 8511 |
8521 } // namespace internal | 8512 } // namespace internal |
8522 } // namespace v8 | 8513 } // namespace v8 |
OLD | NEW |