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 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1846 Source* source, | 1846 Source* source, |
1847 CompileOptions options) { | 1847 CompileOptions options) { |
1848 auto context = v8_isolate->GetCurrentContext(); | 1848 auto context = v8_isolate->GetCurrentContext(); |
1849 RETURN_TO_LOCAL_UNCHECKED(Compile(context, source, options), Script); | 1849 RETURN_TO_LOCAL_UNCHECKED(Compile(context, source, options), Script); |
1850 } | 1850 } |
1851 | 1851 |
1852 | 1852 |
1853 MaybeLocal<Script> ScriptCompiler::CompileModule(Local<Context> context, | 1853 MaybeLocal<Script> ScriptCompiler::CompileModule(Local<Context> context, |
1854 Source* source, | 1854 Source* source, |
1855 CompileOptions options) { | 1855 CompileOptions options) { |
1856 CHECK(i::FLAG_harmony_modules); | |
1857 auto isolate = context->GetIsolate(); | 1856 auto isolate = context->GetIsolate(); |
1858 TRACE_EVENT_SCOPED_CONTEXT("V8", "Isolate", isolate); | 1857 TRACE_EVENT_SCOPED_CONTEXT("V8", "Isolate", isolate); |
1859 auto maybe = CompileUnboundInternal(isolate, source, options, true); | 1858 auto maybe = CompileUnboundInternal(isolate, source, options, true); |
1860 Local<UnboundScript> generic; | 1859 Local<UnboundScript> generic; |
1861 if (!maybe.ToLocal(&generic)) return MaybeLocal<Script>(); | 1860 if (!maybe.ToLocal(&generic)) return MaybeLocal<Script>(); |
1862 v8::Context::Scope scope(context); | 1861 v8::Context::Scope scope(context); |
1863 return generic->BindToCurrentContext(); | 1862 return generic->BindToCurrentContext(); |
1864 } | 1863 } |
1865 | 1864 |
1866 | 1865 |
(...skipping 6827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8694 Address callback_address = | 8693 Address callback_address = |
8695 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 8694 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
8696 VMState<EXTERNAL> state(isolate); | 8695 VMState<EXTERNAL> state(isolate); |
8697 ExternalCallbackScope call_scope(isolate, callback_address); | 8696 ExternalCallbackScope call_scope(isolate, callback_address); |
8698 callback(info); | 8697 callback(info); |
8699 } | 8698 } |
8700 | 8699 |
8701 | 8700 |
8702 } // namespace internal | 8701 } // namespace internal |
8703 } // namespace v8 | 8702 } // namespace v8 |
OLD | NEW |