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 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 MaybeLocal<Value> Module::Evaluate(Local<Context> context) { | 1923 MaybeLocal<Value> Module::Evaluate(Local<Context> context) { |
1924 PREPARE_FOR_EXECUTION_WITH_CONTEXT_IN_RUNTIME_CALL_STATS_SCOPE( | 1924 PREPARE_FOR_EXECUTION_WITH_CONTEXT_IN_RUNTIME_CALL_STATS_SCOPE( |
1925 "v8", "V8.Execute", context, Module, Evaluate, MaybeLocal<Value>(), | 1925 "v8", "V8.Execute", context, Module, Evaluate, MaybeLocal<Value>(), |
1926 InternalEscapableScope, true); | 1926 InternalEscapableScope, true); |
1927 i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); | 1927 i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); |
1928 i::AggregatingHistogramTimerScope timer(isolate->counters()->compile_lazy()); | 1928 i::AggregatingHistogramTimerScope timer(isolate->counters()->compile_lazy()); |
1929 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); | 1929 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); |
1930 | 1930 |
1931 i::Handle<i::Module> self = Utils::OpenHandle(this); | 1931 i::Handle<i::Module> self = Utils::OpenHandle(this); |
1932 // It's an API error to call Evaluate before Instantiate. | 1932 // It's an API error to call Evaluate before Instantiate. |
1933 CHECK(self->code()->IsJSFunction()); | 1933 CHECK(self->instantiated()); |
1934 | 1934 |
1935 Local<Value> result; | 1935 Local<Value> result; |
1936 has_pending_exception = !ToLocal(i::Module::Evaluate(self), &result); | 1936 has_pending_exception = !ToLocal(i::Module::Evaluate(self), &result); |
1937 RETURN_ON_FAILED_EXECUTION(Value); | 1937 RETURN_ON_FAILED_EXECUTION(Value); |
1938 RETURN_ESCAPED(result); | 1938 RETURN_ESCAPED(result); |
1939 } | 1939 } |
1940 | 1940 |
1941 MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal( | 1941 MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal( |
1942 Isolate* v8_isolate, Source* source, CompileOptions options, | 1942 Isolate* v8_isolate, Source* source, CompileOptions options, |
1943 bool is_module) { | 1943 bool is_module) { |
(...skipping 7473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9417 Address callback_address = | 9417 Address callback_address = |
9418 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9418 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9419 VMState<EXTERNAL> state(isolate); | 9419 VMState<EXTERNAL> state(isolate); |
9420 ExternalCallbackScope call_scope(isolate, callback_address); | 9420 ExternalCallbackScope call_scope(isolate, callback_address); |
9421 callback(info); | 9421 callback(info); |
9422 } | 9422 } |
9423 | 9423 |
9424 | 9424 |
9425 } // namespace internal | 9425 } // namespace internal |
9426 } // namespace v8 | 9426 } // namespace v8 |
OLD | NEW |