| 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 1807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1818 script->set_is_embedder_debug_script( | 1818 script->set_is_embedder_debug_script( |
| 1819 origin.ResourceIsEmbedderDebugScript()->IsTrue()); | 1819 origin.ResourceIsEmbedderDebugScript()->IsTrue()); |
| 1820 } | 1820 } |
| 1821 source->info->set_script(script); | 1821 source->info->set_script(script); |
| 1822 source->info->SetContext(isolate->native_context()); | 1822 source->info->SetContext(isolate->native_context()); |
| 1823 | 1823 |
| 1824 EXCEPTION_PREAMBLE(isolate); | 1824 EXCEPTION_PREAMBLE(isolate); |
| 1825 | 1825 |
| 1826 // Do the parsing tasks which need to be done on the main thread. This will | 1826 // Do the parsing tasks which need to be done on the main thread. This will |
| 1827 // also handle parse errors. | 1827 // also handle parse errors. |
| 1828 source->parser->Internalize(source->info.get()); | 1828 source->parser->Internalize(isolate, script, |
| 1829 source->parser->HandleSourceURLComments(source->info.get()); | 1829 source->info->function() == NULL); |
| 1830 source->parser->HandleSourceURLComments(isolate, script); |
| 1830 | 1831 |
| 1831 i::Handle<i::SharedFunctionInfo> result = | 1832 i::Handle<i::SharedFunctionInfo> result = |
| 1832 i::Handle<i::SharedFunctionInfo>::null(); | 1833 i::Handle<i::SharedFunctionInfo>::null(); |
| 1833 if (source->info->function() != NULL) { | 1834 if (source->info->function() != NULL) { |
| 1834 // Parsing has succeeded. | 1835 // Parsing has succeeded. |
| 1835 result = | 1836 result = |
| 1836 i::Compiler::CompileStreamedScript(source->info.get(), str->length()); | 1837 i::Compiler::CompileStreamedScript(source->info.get(), str->length()); |
| 1837 } | 1838 } |
| 1838 has_pending_exception = result.is_null(); | 1839 has_pending_exception = result.is_null(); |
| 1839 if (has_pending_exception) isolate->ReportPendingMessages(); | 1840 if (has_pending_exception) isolate->ReportPendingMessages(); |
| (...skipping 5997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7837 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7838 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7838 Address callback_address = | 7839 Address callback_address = |
| 7839 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7840 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7840 VMState<EXTERNAL> state(isolate); | 7841 VMState<EXTERNAL> state(isolate); |
| 7841 ExternalCallbackScope call_scope(isolate, callback_address); | 7842 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7842 callback(info); | 7843 callback(info); |
| 7843 } | 7844 } |
| 7844 | 7845 |
| 7845 | 7846 |
| 7846 } } // namespace v8::internal | 7847 } } // namespace v8::internal |
| OLD | NEW |