| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 #include "src/v8.h" | 68 #include "src/v8.h" |
| 69 #include "src/v8threads.h" | 69 #include "src/v8threads.h" |
| 70 #include "src/version.h" | 70 #include "src/version.h" |
| 71 #include "src/vm-state-inl.h" | 71 #include "src/vm-state-inl.h" |
| 72 | 72 |
| 73 namespace v8 { | 73 namespace v8 { |
| 74 | 74 |
| 75 #define LOG_API(isolate, class_name, function_name) \ | 75 #define LOG_API(isolate, class_name, function_name) \ |
| 76 i::RuntimeCallTimerScope _runtime_timer( \ | 76 i::RuntimeCallTimerScope _runtime_timer( \ |
| 77 isolate, &i::RuntimeCallStats::API_##class_name##_##function_name); \ | 77 isolate, &i::RuntimeCallStats::API_##class_name##_##function_name); \ |
| 78 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( \ |
| 79 isolate, &internal::tracing::TraceEventStatsTable:: \ |
| 80 API_##class_name##_##function_name); \ |
| 78 LOG(isolate, ApiEntryCall("v8::" #class_name "::" #function_name)) | 81 LOG(isolate, ApiEntryCall("v8::" #class_name "::" #function_name)) |
| 79 | 82 |
| 80 #define ENTER_V8(isolate) i::VMState<v8::OTHER> __state__((isolate)) | 83 #define ENTER_V8(isolate) i::VMState<v8::OTHER> __state__((isolate)) |
| 81 | 84 |
| 82 #define PREPARE_FOR_EXECUTION_GENERIC(isolate, context, class_name, \ | 85 #define PREPARE_FOR_EXECUTION_GENERIC(isolate, context, class_name, \ |
| 83 function_name, bailout_value, \ | 86 function_name, bailout_value, \ |
| 84 HandleScopeClass, do_callback) \ | 87 HandleScopeClass, do_callback) \ |
| 85 if (IsExecutionTerminatingCheck(isolate)) { \ | 88 if (IsExecutionTerminatingCheck(isolate)) { \ |
| 86 return bailout_value; \ | 89 return bailout_value; \ |
| 87 } \ | 90 } \ |
| (...skipping 1806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1894 return Local<String>(); | 1897 return Local<String>(); |
| 1895 } | 1898 } |
| 1896 } | 1899 } |
| 1897 | 1900 |
| 1898 | 1901 |
| 1899 MaybeLocal<Value> Script::Run(Local<Context> context) { | 1902 MaybeLocal<Value> Script::Run(Local<Context> context) { |
| 1900 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, Script, Run, Value) | 1903 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, Script, Run, Value) |
| 1901 i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); | 1904 i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); |
| 1902 i::AggregatingHistogramTimerScope timer(isolate->counters()->compile_lazy()); | 1905 i::AggregatingHistogramTimerScope timer(isolate->counters()->compile_lazy()); |
| 1903 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); | 1906 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); |
| 1904 TRACE_EVENT0("v8", "V8.Execute"); | 1907 TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.Execute"); |
| 1905 auto fun = i::Handle<i::JSFunction>::cast(Utils::OpenHandle(this)); | 1908 auto fun = i::Handle<i::JSFunction>::cast(Utils::OpenHandle(this)); |
| 1906 i::Handle<i::Object> receiver = isolate->global_proxy(); | 1909 i::Handle<i::Object> receiver = isolate->global_proxy(); |
| 1907 Local<Value> result; | 1910 Local<Value> result; |
| 1908 has_pending_exception = | 1911 has_pending_exception = |
| 1909 !ToLocal<Value>(i::Execution::Call(isolate, fun, receiver, 0, NULL), | 1912 !ToLocal<Value>(i::Execution::Call(isolate, fun, receiver, 0, NULL), |
| 1910 &result); | 1913 &result); |
| 1911 RETURN_ON_FAILED_EXECUTION(Value); | 1914 RETURN_ON_FAILED_EXECUTION(Value); |
| 1912 RETURN_ESCAPED(result); | 1915 RETURN_ESCAPED(result); |
| 1913 } | 1916 } |
| 1914 | 1917 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1929 i::Handle<i::SharedFunctionInfo>(i::JSFunction::cast(*obj)->shared())); | 1932 i::Handle<i::SharedFunctionInfo>(i::JSFunction::cast(*obj)->shared())); |
| 1930 } | 1933 } |
| 1931 | 1934 |
| 1932 | 1935 |
| 1933 MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal( | 1936 MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal( |
| 1934 Isolate* v8_isolate, Source* source, CompileOptions options, | 1937 Isolate* v8_isolate, Source* source, CompileOptions options, |
| 1935 bool is_module) { | 1938 bool is_module) { |
| 1936 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 1939 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
| 1937 PREPARE_FOR_EXECUTION_WITH_ISOLATE(isolate, ScriptCompiler, CompileUnbound, | 1940 PREPARE_FOR_EXECUTION_WITH_ISOLATE(isolate, ScriptCompiler, CompileUnbound, |
| 1938 UnboundScript); | 1941 UnboundScript); |
| 1939 TRACE_EVENT0("v8", "V8.ScriptCompiler"); | 1942 TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.ScriptCompiler"); |
| 1940 | 1943 |
| 1941 // Don't try to produce any kind of cache when the debugger is loaded. | 1944 // Don't try to produce any kind of cache when the debugger is loaded. |
| 1942 if (isolate->debug()->is_loaded() && | 1945 if (isolate->debug()->is_loaded() && |
| 1943 (options == kProduceParserCache || options == kProduceCodeCache)) { | 1946 (options == kProduceParserCache || options == kProduceCodeCache)) { |
| 1944 options = kNoCompileOptions; | 1947 options = kNoCompileOptions; |
| 1945 } | 1948 } |
| 1946 | 1949 |
| 1947 i::ScriptData* script_data = NULL; | 1950 i::ScriptData* script_data = NULL; |
| 1948 if (options == kConsumeParserCache || options == kConsumeCodeCache) { | 1951 if (options == kConsumeParserCache || options == kConsumeCodeCache) { |
| 1949 DCHECK(source->cached_data); | 1952 DCHECK(source->cached_data); |
| (...skipping 2524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4474 auto self = Utils::OpenHandle(this); | 4477 auto self = Utils::OpenHandle(this); |
| 4475 return self->IsConstructor(); | 4478 return self->IsConstructor(); |
| 4476 } | 4479 } |
| 4477 | 4480 |
| 4478 MaybeLocal<Value> Object::CallAsFunction(Local<Context> context, | 4481 MaybeLocal<Value> Object::CallAsFunction(Local<Context> context, |
| 4479 Local<Value> recv, int argc, | 4482 Local<Value> recv, int argc, |
| 4480 Local<Value> argv[]) { | 4483 Local<Value> argv[]) { |
| 4481 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, Object, CallAsFunction, Value); | 4484 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, Object, CallAsFunction, Value); |
| 4482 i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); | 4485 i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); |
| 4483 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); | 4486 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); |
| 4484 TRACE_EVENT0("v8", "V8.Execute"); | 4487 TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.Execute"); |
| 4485 auto self = Utils::OpenHandle(this); | 4488 auto self = Utils::OpenHandle(this); |
| 4486 auto recv_obj = Utils::OpenHandle(*recv); | 4489 auto recv_obj = Utils::OpenHandle(*recv); |
| 4487 STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**)); | 4490 STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**)); |
| 4488 i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv); | 4491 i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv); |
| 4489 Local<Value> result; | 4492 Local<Value> result; |
| 4490 has_pending_exception = !ToLocal<Value>( | 4493 has_pending_exception = !ToLocal<Value>( |
| 4491 i::Execution::Call(isolate, self, recv_obj, argc, args), &result); | 4494 i::Execution::Call(isolate, self, recv_obj, argc, args), &result); |
| 4492 RETURN_ON_FAILED_EXECUTION(Value); | 4495 RETURN_ON_FAILED_EXECUTION(Value); |
| 4493 RETURN_ESCAPED(result); | 4496 RETURN_ESCAPED(result); |
| 4494 } | 4497 } |
| 4495 | 4498 |
| 4496 | 4499 |
| 4497 Local<v8::Value> Object::CallAsFunction(v8::Local<v8::Value> recv, int argc, | 4500 Local<v8::Value> Object::CallAsFunction(v8::Local<v8::Value> recv, int argc, |
| 4498 v8::Local<v8::Value> argv[]) { | 4501 v8::Local<v8::Value> argv[]) { |
| 4499 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); | 4502 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); |
| 4500 Local<Value>* argv_cast = reinterpret_cast<Local<Value>*>(argv); | 4503 Local<Value>* argv_cast = reinterpret_cast<Local<Value>*>(argv); |
| 4501 RETURN_TO_LOCAL_UNCHECKED(CallAsFunction(context, recv, argc, argv_cast), | 4504 RETURN_TO_LOCAL_UNCHECKED(CallAsFunction(context, recv, argc, argv_cast), |
| 4502 Value); | 4505 Value); |
| 4503 } | 4506 } |
| 4504 | 4507 |
| 4505 | 4508 |
| 4506 MaybeLocal<Value> Object::CallAsConstructor(Local<Context> context, int argc, | 4509 MaybeLocal<Value> Object::CallAsConstructor(Local<Context> context, int argc, |
| 4507 Local<Value> argv[]) { | 4510 Local<Value> argv[]) { |
| 4508 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, Object, CallAsConstructor, | 4511 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, Object, CallAsConstructor, |
| 4509 Value); | 4512 Value); |
| 4510 i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); | 4513 i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); |
| 4511 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); | 4514 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); |
| 4512 TRACE_EVENT0("v8", "V8.Execute"); | 4515 TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.Execute"); |
| 4513 auto self = Utils::OpenHandle(this); | 4516 auto self = Utils::OpenHandle(this); |
| 4514 STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**)); | 4517 STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**)); |
| 4515 i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv); | 4518 i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv); |
| 4516 Local<Value> result; | 4519 Local<Value> result; |
| 4517 has_pending_exception = !ToLocal<Value>( | 4520 has_pending_exception = !ToLocal<Value>( |
| 4518 i::Execution::New(isolate, self, self, argc, args), &result); | 4521 i::Execution::New(isolate, self, self, argc, args), &result); |
| 4519 RETURN_ON_FAILED_EXECUTION(Value); | 4522 RETURN_ON_FAILED_EXECUTION(Value); |
| 4520 RETURN_ESCAPED(result); | 4523 RETURN_ESCAPED(result); |
| 4521 } | 4524 } |
| 4522 | 4525 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 4553 return NewInstance(Isolate::GetCurrent()->GetCurrentContext(), 0, NULL) | 4556 return NewInstance(Isolate::GetCurrent()->GetCurrentContext(), 0, NULL) |
| 4554 .FromMaybe(Local<Object>()); | 4557 .FromMaybe(Local<Object>()); |
| 4555 } | 4558 } |
| 4556 | 4559 |
| 4557 | 4560 |
| 4558 MaybeLocal<Object> Function::NewInstance(Local<Context> context, int argc, | 4561 MaybeLocal<Object> Function::NewInstance(Local<Context> context, int argc, |
| 4559 v8::Local<v8::Value> argv[]) const { | 4562 v8::Local<v8::Value> argv[]) const { |
| 4560 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, Function, NewInstance, Object); | 4563 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, Function, NewInstance, Object); |
| 4561 i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); | 4564 i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); |
| 4562 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); | 4565 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); |
| 4563 TRACE_EVENT0("v8", "V8.Execute"); | 4566 TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.Execute"); |
| 4564 auto self = Utils::OpenHandle(this); | 4567 auto self = Utils::OpenHandle(this); |
| 4565 STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**)); | 4568 STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**)); |
| 4566 i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv); | 4569 i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv); |
| 4567 Local<Object> result; | 4570 Local<Object> result; |
| 4568 has_pending_exception = !ToLocal<Object>( | 4571 has_pending_exception = !ToLocal<Object>( |
| 4569 i::Execution::New(isolate, self, self, argc, args), &result); | 4572 i::Execution::New(isolate, self, self, argc, args), &result); |
| 4570 RETURN_ON_FAILED_EXECUTION(Object); | 4573 RETURN_ON_FAILED_EXECUTION(Object); |
| 4571 RETURN_ESCAPED(result); | 4574 RETURN_ESCAPED(result); |
| 4572 } | 4575 } |
| 4573 | 4576 |
| 4574 | 4577 |
| 4575 Local<v8::Object> Function::NewInstance(int argc, | 4578 Local<v8::Object> Function::NewInstance(int argc, |
| 4576 v8::Local<v8::Value> argv[]) const { | 4579 v8::Local<v8::Value> argv[]) const { |
| 4577 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); | 4580 auto context = ContextFromHeapObject(Utils::OpenHandle(this)); |
| 4578 RETURN_TO_LOCAL_UNCHECKED(NewInstance(context, argc, argv), Object); | 4581 RETURN_TO_LOCAL_UNCHECKED(NewInstance(context, argc, argv), Object); |
| 4579 } | 4582 } |
| 4580 | 4583 |
| 4581 | 4584 |
| 4582 MaybeLocal<v8::Value> Function::Call(Local<Context> context, | 4585 MaybeLocal<v8::Value> Function::Call(Local<Context> context, |
| 4583 v8::Local<v8::Value> recv, int argc, | 4586 v8::Local<v8::Value> recv, int argc, |
| 4584 v8::Local<v8::Value> argv[]) { | 4587 v8::Local<v8::Value> argv[]) { |
| 4585 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, Function, Call, Value); | 4588 PREPARE_FOR_EXECUTION_WITH_CALLBACK(context, Function, Call, Value); |
| 4586 i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); | 4589 i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); |
| 4587 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); | 4590 i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); |
| 4588 TRACE_EVENT0("v8", "V8.Execute"); | 4591 TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.Execute"); |
| 4589 auto self = Utils::OpenHandle(this); | 4592 auto self = Utils::OpenHandle(this); |
| 4590 i::Handle<i::Object> recv_obj = Utils::OpenHandle(*recv); | 4593 i::Handle<i::Object> recv_obj = Utils::OpenHandle(*recv); |
| 4591 STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**)); | 4594 STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**)); |
| 4592 i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv); | 4595 i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv); |
| 4593 Local<Value> result; | 4596 Local<Value> result; |
| 4594 has_pending_exception = !ToLocal<Value>( | 4597 has_pending_exception = !ToLocal<Value>( |
| 4595 i::Execution::Call(isolate, self, recv_obj, argc, args), &result); | 4598 i::Execution::Call(isolate, self, recv_obj, argc, args), &result); |
| 4596 RETURN_ON_FAILED_EXECUTION(Value); | 4599 RETURN_ON_FAILED_EXECUTION(Value); |
| 4597 RETURN_ESCAPED(result); | 4600 RETURN_ESCAPED(result); |
| 4598 } | 4601 } |
| (...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5759 return result; | 5762 return result; |
| 5760 } | 5763 } |
| 5761 | 5764 |
| 5762 Local<Context> NewContext(v8::Isolate* external_isolate, | 5765 Local<Context> NewContext(v8::Isolate* external_isolate, |
| 5763 v8::ExtensionConfiguration* extensions, | 5766 v8::ExtensionConfiguration* extensions, |
| 5764 v8::MaybeLocal<ObjectTemplate> global_template, | 5767 v8::MaybeLocal<ObjectTemplate> global_template, |
| 5765 v8::MaybeLocal<Value> global_object, | 5768 v8::MaybeLocal<Value> global_object, |
| 5766 size_t context_snapshot_index) { | 5769 size_t context_snapshot_index) { |
| 5767 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate); | 5770 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate); |
| 5768 LOG_API(isolate, Context, New); | 5771 LOG_API(isolate, Context, New); |
| 5772 TRACE_EVENT_CALL_STATS_SCOPED(isolate, "v8", "V8.NewContext"); |
| 5769 i::HandleScope scope(isolate); | 5773 i::HandleScope scope(isolate); |
| 5770 ExtensionConfiguration no_extensions; | 5774 ExtensionConfiguration no_extensions; |
| 5771 if (extensions == NULL) extensions = &no_extensions; | 5775 if (extensions == NULL) extensions = &no_extensions; |
| 5772 i::Handle<i::Context> env = | 5776 i::Handle<i::Context> env = |
| 5773 CreateEnvironment<i::Context>(isolate, extensions, global_template, | 5777 CreateEnvironment<i::Context>(isolate, extensions, global_template, |
| 5774 global_object, context_snapshot_index); | 5778 global_object, context_snapshot_index); |
| 5775 if (env.is_null()) { | 5779 if (env.is_null()) { |
| 5776 if (isolate->has_pending_exception()) { | 5780 if (isolate->has_pending_exception()) { |
| 5777 isolate->OptionalRescheduleException(true); | 5781 isolate->OptionalRescheduleException(true); |
| 5778 } | 5782 } |
| (...skipping 3240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9019 | 9023 |
| 9020 | 9024 |
| 9021 void InvokeAccessorGetterCallback( | 9025 void InvokeAccessorGetterCallback( |
| 9022 v8::Local<v8::Name> property, | 9026 v8::Local<v8::Name> property, |
| 9023 const v8::PropertyCallbackInfo<v8::Value>& info, | 9027 const v8::PropertyCallbackInfo<v8::Value>& info, |
| 9024 v8::AccessorNameGetterCallback getter) { | 9028 v8::AccessorNameGetterCallback getter) { |
| 9025 // Leaving JavaScript. | 9029 // Leaving JavaScript. |
| 9026 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 9030 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 9027 RuntimeCallTimerScope timer(isolate, | 9031 RuntimeCallTimerScope timer(isolate, |
| 9028 &RuntimeCallStats::AccessorGetterCallback); | 9032 &RuntimeCallStats::AccessorGetterCallback); |
| 9033 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( |
| 9034 isolate, |
| 9035 &internal::tracing::TraceEventStatsTable::AccessorGetterCallback); |
| 9029 Address getter_address = reinterpret_cast<Address>(reinterpret_cast<intptr_t>( | 9036 Address getter_address = reinterpret_cast<Address>(reinterpret_cast<intptr_t>( |
| 9030 getter)); | 9037 getter)); |
| 9031 VMState<EXTERNAL> state(isolate); | 9038 VMState<EXTERNAL> state(isolate); |
| 9032 ExternalCallbackScope call_scope(isolate, getter_address); | 9039 ExternalCallbackScope call_scope(isolate, getter_address); |
| 9033 getter(property, info); | 9040 getter(property, info); |
| 9034 } | 9041 } |
| 9035 | 9042 |
| 9036 | 9043 |
| 9037 void InvokeFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info, | 9044 void InvokeFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info, |
| 9038 v8::FunctionCallback callback) { | 9045 v8::FunctionCallback callback) { |
| 9039 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 9046 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 9040 RuntimeCallTimerScope timer(isolate, | 9047 RuntimeCallTimerScope timer(isolate, |
| 9041 &RuntimeCallStats::InvokeFunctionCallback); | 9048 &RuntimeCallStats::InvokeFunctionCallback); |
| 9049 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( |
| 9050 isolate, |
| 9051 &internal::tracing::TraceEventStatsTable::InvokeFunctionCallback); |
| 9042 Address callback_address = | 9052 Address callback_address = |
| 9043 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9053 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 9044 VMState<EXTERNAL> state(isolate); | 9054 VMState<EXTERNAL> state(isolate); |
| 9045 ExternalCallbackScope call_scope(isolate, callback_address); | 9055 ExternalCallbackScope call_scope(isolate, callback_address); |
| 9046 callback(info); | 9056 callback(info); |
| 9047 } | 9057 } |
| 9048 | 9058 |
| 9049 | 9059 |
| 9050 } // namespace internal | 9060 } // namespace internal |
| 9051 } // namespace v8 | 9061 } // namespace v8 |
| OLD | NEW |