| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 #include "src/value-serializer.h" | 72 #include "src/value-serializer.h" |
| 73 #include "src/version.h" | 73 #include "src/version.h" |
| 74 #include "src/vm-state-inl.h" | 74 #include "src/vm-state-inl.h" |
| 75 #include "src/wasm/wasm-module.h" | 75 #include "src/wasm/wasm-module.h" |
| 76 | 76 |
| 77 namespace v8 { | 77 namespace v8 { |
| 78 | 78 |
| 79 #define LOG_API(isolate, class_name, function_name) \ | 79 #define LOG_API(isolate, class_name, function_name) \ |
| 80 i::RuntimeCallTimerScope _runtime_timer( \ | 80 i::RuntimeCallTimerScope _runtime_timer( \ |
| 81 isolate, &i::RuntimeCallStats::API_##class_name##_##function_name); \ | 81 isolate, &i::RuntimeCallStats::API_##class_name##_##function_name); \ |
| 82 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( \ | |
| 83 isolate, &internal::tracing::TraceEventStatsTable:: \ | |
| 84 API_##class_name##_##function_name); \ | |
| 85 LOG(isolate, ApiEntryCall("v8::" #class_name "::" #function_name)) | 82 LOG(isolate, ApiEntryCall("v8::" #class_name "::" #function_name)) |
| 86 | 83 |
| 87 #define ENTER_V8(isolate) i::VMState<v8::OTHER> __state__((isolate)) | 84 #define ENTER_V8(isolate) i::VMState<v8::OTHER> __state__((isolate)) |
| 88 | 85 |
| 89 #define PREPARE_FOR_EXECUTION_GENERIC(isolate, context, class_name, \ | 86 #define PREPARE_FOR_EXECUTION_GENERIC(isolate, context, class_name, \ |
| 90 function_name, bailout_value, \ | 87 function_name, bailout_value, \ |
| 91 HandleScopeClass, do_callback) \ | 88 HandleScopeClass, do_callback) \ |
| 92 if (IsExecutionTerminatingCheck(isolate)) { \ | 89 if (IsExecutionTerminatingCheck(isolate)) { \ |
| 93 return bailout_value; \ | 90 return bailout_value; \ |
| 94 } \ | 91 } \ |
| (...skipping 9085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9180 | 9177 |
| 9181 | 9178 |
| 9182 void InvokeAccessorGetterCallback( | 9179 void InvokeAccessorGetterCallback( |
| 9183 v8::Local<v8::Name> property, | 9180 v8::Local<v8::Name> property, |
| 9184 const v8::PropertyCallbackInfo<v8::Value>& info, | 9181 const v8::PropertyCallbackInfo<v8::Value>& info, |
| 9185 v8::AccessorNameGetterCallback getter) { | 9182 v8::AccessorNameGetterCallback getter) { |
| 9186 // Leaving JavaScript. | 9183 // Leaving JavaScript. |
| 9187 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 9184 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 9188 RuntimeCallTimerScope timer(isolate, | 9185 RuntimeCallTimerScope timer(isolate, |
| 9189 &RuntimeCallStats::AccessorGetterCallback); | 9186 &RuntimeCallStats::AccessorGetterCallback); |
| 9190 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( | |
| 9191 isolate, | |
| 9192 &internal::tracing::TraceEventStatsTable::AccessorGetterCallback); | |
| 9193 Address getter_address = reinterpret_cast<Address>(reinterpret_cast<intptr_t>( | 9187 Address getter_address = reinterpret_cast<Address>(reinterpret_cast<intptr_t>( |
| 9194 getter)); | 9188 getter)); |
| 9195 VMState<EXTERNAL> state(isolate); | 9189 VMState<EXTERNAL> state(isolate); |
| 9196 ExternalCallbackScope call_scope(isolate, getter_address); | 9190 ExternalCallbackScope call_scope(isolate, getter_address); |
| 9197 getter(property, info); | 9191 getter(property, info); |
| 9198 } | 9192 } |
| 9199 | 9193 |
| 9200 | 9194 |
| 9201 void InvokeFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info, | 9195 void InvokeFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info, |
| 9202 v8::FunctionCallback callback) { | 9196 v8::FunctionCallback callback) { |
| 9203 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); | 9197 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); |
| 9204 RuntimeCallTimerScope timer(isolate, | 9198 RuntimeCallTimerScope timer(isolate, |
| 9205 &RuntimeCallStats::InvokeFunctionCallback); | 9199 &RuntimeCallStats::InvokeFunctionCallback); |
| 9206 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( | |
| 9207 isolate, | |
| 9208 &internal::tracing::TraceEventStatsTable::InvokeFunctionCallback); | |
| 9209 Address callback_address = | 9200 Address callback_address = |
| 9210 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9201 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
| 9211 VMState<EXTERNAL> state(isolate); | 9202 VMState<EXTERNAL> state(isolate); |
| 9212 ExternalCallbackScope call_scope(isolate, callback_address); | 9203 ExternalCallbackScope call_scope(isolate, callback_address); |
| 9213 callback(info); | 9204 callback(info); |
| 9214 } | 9205 } |
| 9215 | 9206 |
| 9216 | 9207 |
| 9217 } // namespace internal | 9208 } // namespace internal |
| 9218 } // namespace v8 | 9209 } // namespace v8 |
| OLD | NEW |