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