| 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 2167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2178 } | 2178 } |
| 2179 script->set_origin_options(origin.Options()); | 2179 script->set_origin_options(origin.Options()); |
| 2180 if (!origin.SourceMapUrl().IsEmpty()) { | 2180 if (!origin.SourceMapUrl().IsEmpty()) { |
| 2181 script->set_source_mapping_url( | 2181 script->set_source_mapping_url( |
| 2182 *Utils::OpenHandle(*(origin.SourceMapUrl()))); | 2182 *Utils::OpenHandle(*(origin.SourceMapUrl()))); |
| 2183 } | 2183 } |
| 2184 | 2184 |
| 2185 source->info->set_script(script); | 2185 source->info->set_script(script); |
| 2186 source->info->set_context(isolate->native_context()); | 2186 source->info->set_context(isolate->native_context()); |
| 2187 | 2187 |
| 2188 // Create a canonical handle scope before internalizing parsed values if | |
| 2189 // compiling bytecode. This is required for off-thread bytecode generation. | |
| 2190 std::unique_ptr<i::CanonicalHandleScope> canonical; | |
| 2191 if (i::FLAG_ignition) canonical.reset(new i::CanonicalHandleScope(isolate)); | |
| 2192 | |
| 2193 // Do the parsing tasks which need to be done on the main thread. This will | 2188 // Do the parsing tasks which need to be done on the main thread. This will |
| 2194 // also handle parse errors. | 2189 // also handle parse errors. |
| 2195 source->parser->Internalize(isolate, script, | 2190 source->parser->Internalize(isolate, script, |
| 2196 source->info->literal() == nullptr); | 2191 source->info->literal() == nullptr); |
| 2197 source->parser->HandleSourceURLComments(isolate, script); | 2192 source->parser->HandleSourceURLComments(isolate, script); |
| 2198 | 2193 |
| 2199 i::Handle<i::SharedFunctionInfo> result; | 2194 i::Handle<i::SharedFunctionInfo> result; |
| 2200 if (source->info->literal() != nullptr) { | 2195 if (source->info->literal() != nullptr) { |
| 2201 // Parsing has succeeded. | 2196 // Parsing has succeeded. |
| 2202 result = i::Compiler::GetSharedFunctionInfoForStreamedScript( | 2197 result = i::Compiler::GetSharedFunctionInfoForStreamedScript( |
| (...skipping 7033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9236 Address callback_address = | 9231 Address callback_address = |
| 9237 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9232 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 9238 VMState<EXTERNAL> state(isolate); | 9233 VMState<EXTERNAL> state(isolate); |
| 9239 ExternalCallbackScope call_scope(isolate, callback_address); | 9234 ExternalCallbackScope call_scope(isolate, callback_address); |
| 9240 callback(info); | 9235 callback(info); |
| 9241 } | 9236 } |
| 9242 | 9237 |
| 9243 | 9238 |
| 9244 } // namespace internal | 9239 } // namespace internal |
| 9245 } // namespace v8 | 9240 } // namespace v8 |
| OLD | NEW |