| 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 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1799 CHECK(i::FLAG_harmony_modules); | 1799 CHECK(i::FLAG_harmony_modules); |
| 1800 auto isolate = context->GetIsolate(); | 1800 auto isolate = context->GetIsolate(); |
| 1801 auto maybe = CompileUnboundInternal(isolate, source, options, true); | 1801 auto maybe = CompileUnboundInternal(isolate, source, options, true); |
| 1802 Local<UnboundScript> generic; | 1802 Local<UnboundScript> generic; |
| 1803 if (!maybe.ToLocal(&generic)) return MaybeLocal<Script>(); | 1803 if (!maybe.ToLocal(&generic)) return MaybeLocal<Script>(); |
| 1804 v8::Context::Scope scope(context); | 1804 v8::Context::Scope scope(context); |
| 1805 return generic->BindToCurrentContext(); | 1805 return generic->BindToCurrentContext(); |
| 1806 } | 1806 } |
| 1807 | 1807 |
| 1808 | 1808 |
| 1809 Local<Script> ScriptCompiler::CompileModule(Isolate* v8_isolate, Source* source, | |
| 1810 CompileOptions options) { | |
| 1811 auto context = v8_isolate->GetCurrentContext(); | |
| 1812 RETURN_TO_LOCAL_UNCHECKED(CompileModule(context, source, options), Script); | |
| 1813 } | |
| 1814 | |
| 1815 | |
| 1816 class IsIdentifierHelper { | 1809 class IsIdentifierHelper { |
| 1817 public: | 1810 public: |
| 1818 IsIdentifierHelper() : is_identifier_(false), first_char_(true) {} | 1811 IsIdentifierHelper() : is_identifier_(false), first_char_(true) {} |
| 1819 | 1812 |
| 1820 bool Check(i::String* string) { | 1813 bool Check(i::String* string) { |
| 1821 i::ConsString* cons_string = i::String::VisitFlat(this, string, 0); | 1814 i::ConsString* cons_string = i::String::VisitFlat(this, string, 0); |
| 1822 if (cons_string == NULL) return is_identifier_; | 1815 if (cons_string == NULL) return is_identifier_; |
| 1823 // We don't support cons strings here. | 1816 // We don't support cons strings here. |
| 1824 return false; | 1817 return false; |
| 1825 } | 1818 } |
| (...skipping 6598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8424 Address callback_address = | 8417 Address callback_address = |
| 8425 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8418 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 8426 VMState<EXTERNAL> state(isolate); | 8419 VMState<EXTERNAL> state(isolate); |
| 8427 ExternalCallbackScope call_scope(isolate, callback_address); | 8420 ExternalCallbackScope call_scope(isolate, callback_address); |
| 8428 callback(info); | 8421 callback(info); |
| 8429 } | 8422 } |
| 8430 | 8423 |
| 8431 | 8424 |
| 8432 } // namespace internal | 8425 } // namespace internal |
| 8433 } // namespace v8 | 8426 } // namespace v8 |
| OLD | NEW |