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 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2251 } | 2251 } |
2252 script->set_origin_options(origin.Options()); | 2252 script->set_origin_options(origin.Options()); |
2253 if (!origin.SourceMapUrl().IsEmpty()) { | 2253 if (!origin.SourceMapUrl().IsEmpty()) { |
2254 script->set_source_mapping_url( | 2254 script->set_source_mapping_url( |
2255 *Utils::OpenHandle(*(origin.SourceMapUrl()))); | 2255 *Utils::OpenHandle(*(origin.SourceMapUrl()))); |
2256 } | 2256 } |
2257 | 2257 |
2258 source->info->set_script(script); | 2258 source->info->set_script(script); |
2259 | 2259 |
2260 { | 2260 { |
2261 // Create a canonical handle scope for compiling Ignition bytecode. This is | 2261 // Create a canonical handle scope if compiling ignition bytecode. This is |
2262 // required by the constant array builder to de-duplicate objects without | 2262 // required by the constant array builder to de-duplicate objects without |
2263 // dereferencing handles. | 2263 // dereferencing handles. |
2264 i::CanonicalHandleScope canonical(isolate); | 2264 std::unique_ptr<i::CanonicalHandleScope> canonical; |
| 2265 if (i::FLAG_ignition) canonical.reset(new i::CanonicalHandleScope(isolate)); |
2265 | 2266 |
2266 // Do the parsing tasks which need to be done on the main thread. This will | 2267 // Do the parsing tasks which need to be done on the main thread. This will |
2267 // also handle parse errors. | 2268 // also handle parse errors. |
2268 source->parser->Internalize(isolate, script, | 2269 source->parser->Internalize(isolate, script, |
2269 source->info->literal() == nullptr); | 2270 source->info->literal() == nullptr); |
2270 } | 2271 } |
2271 source->parser->HandleSourceURLComments(isolate, script); | 2272 source->parser->HandleSourceURLComments(isolate, script); |
2272 | 2273 |
2273 i::Handle<i::SharedFunctionInfo> result; | 2274 i::Handle<i::SharedFunctionInfo> result; |
2274 if (source->info->literal() != nullptr) { | 2275 if (source->info->literal() != nullptr) { |
(...skipping 7216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9491 Address callback_address = | 9492 Address callback_address = |
9492 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9493 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9493 VMState<EXTERNAL> state(isolate); | 9494 VMState<EXTERNAL> state(isolate); |
9494 ExternalCallbackScope call_scope(isolate, callback_address); | 9495 ExternalCallbackScope call_scope(isolate, callback_address); |
9495 callback(info); | 9496 callback(info); |
9496 } | 9497 } |
9497 | 9498 |
9498 | 9499 |
9499 } // namespace internal | 9500 } // namespace internal |
9500 } // namespace v8 | 9501 } // namespace v8 |
OLD | NEW |