| 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 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1720 script->set_is_embedder_debug_script( | 1720 script->set_is_embedder_debug_script( |
| 1721 origin.ResourceIsEmbedderDebugScript()->IsTrue()); | 1721 origin.ResourceIsEmbedderDebugScript()->IsTrue()); |
| 1722 } | 1722 } |
| 1723 source->info->set_script(script); | 1723 source->info->set_script(script); |
| 1724 source->info->SetContext(isolate->native_context()); | 1724 source->info->SetContext(isolate->native_context()); |
| 1725 | 1725 |
| 1726 EXCEPTION_PREAMBLE(isolate); | 1726 EXCEPTION_PREAMBLE(isolate); |
| 1727 | 1727 |
| 1728 // Do the parsing tasks which need to be done on the main thread. This will | 1728 // Do the parsing tasks which need to be done on the main thread. This will |
| 1729 // also handle parse errors. | 1729 // also handle parse errors. |
| 1730 source->parser->Internalize(); | 1730 source->parser->Internalize(source->info.get()); |
| 1731 source->parser->HandleSourceURLComments(); | 1731 source->parser->HandleSourceURLComments(source->info.get()); |
| 1732 | 1732 |
| 1733 i::Handle<i::SharedFunctionInfo> result = | 1733 i::Handle<i::SharedFunctionInfo> result = |
| 1734 i::Handle<i::SharedFunctionInfo>::null(); | 1734 i::Handle<i::SharedFunctionInfo>::null(); |
| 1735 if (source->info->function() != NULL) { | 1735 if (source->info->function() != NULL) { |
| 1736 // Parsing has succeeded. | 1736 // Parsing has succeeded. |
| 1737 result = | 1737 result = |
| 1738 i::Compiler::CompileStreamedScript(source->info.get(), str->length()); | 1738 i::Compiler::CompileStreamedScript(source->info.get(), str->length()); |
| 1739 } | 1739 } |
| 1740 has_pending_exception = result.is_null(); | 1740 has_pending_exception = result.is_null(); |
| 1741 if (has_pending_exception) isolate->ReportPendingMessages(); | 1741 if (has_pending_exception) isolate->ReportPendingMessages(); |
| (...skipping 5997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7739 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 7739 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 7740 Address callback_address = | 7740 Address callback_address = |
| 7741 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 7741 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 7742 VMState<EXTERNAL> state(isolate); | 7742 VMState<EXTERNAL> state(isolate); |
| 7743 ExternalCallbackScope call_scope(isolate, callback_address); | 7743 ExternalCallbackScope call_scope(isolate, callback_address); |
| 7744 callback(info); | 7744 callback(info); |
| 7745 } | 7745 } |
| 7746 | 7746 |
| 7747 | 7747 |
| 7748 } } // namespace v8::internal | 7748 } } // namespace v8::internal |
| OLD | NEW |