Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: src/api.cc

Issue 2296243002: [RuntimeCallStats] Move tracing runtime instrumentation closer to the original version. (Closed)
Patch Set: Address lpy comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/api-arguments.cc » ('j') | src/counters.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 9082 matching lines...) Expand 10 before | Expand all | Expand 10 after
9177 9174
9178 9175
9179 void InvokeAccessorGetterCallback( 9176 void InvokeAccessorGetterCallback(
9180 v8::Local<v8::Name> property, 9177 v8::Local<v8::Name> property,
9181 const v8::PropertyCallbackInfo<v8::Value>& info, 9178 const v8::PropertyCallbackInfo<v8::Value>& info,
9182 v8::AccessorNameGetterCallback getter) { 9179 v8::AccessorNameGetterCallback getter) {
9183 // Leaving JavaScript. 9180 // Leaving JavaScript.
9184 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 9181 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
9185 RuntimeCallTimerScope timer(isolate, 9182 RuntimeCallTimerScope timer(isolate,
9186 &RuntimeCallStats::AccessorGetterCallback); 9183 &RuntimeCallStats::AccessorGetterCallback);
9187 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
9188 isolate,
9189 &internal::tracing::TraceEventStatsTable::AccessorGetterCallback);
9190 Address getter_address = reinterpret_cast<Address>(reinterpret_cast<intptr_t>( 9184 Address getter_address = reinterpret_cast<Address>(reinterpret_cast<intptr_t>(
9191 getter)); 9185 getter));
9192 VMState<EXTERNAL> state(isolate); 9186 VMState<EXTERNAL> state(isolate);
9193 ExternalCallbackScope call_scope(isolate, getter_address); 9187 ExternalCallbackScope call_scope(isolate, getter_address);
9194 getter(property, info); 9188 getter(property, info);
9195 } 9189 }
9196 9190
9197 9191
9198 void InvokeFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info, 9192 void InvokeFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info,
9199 v8::FunctionCallback callback) { 9193 v8::FunctionCallback callback) {
9200 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); 9194 Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
9201 RuntimeCallTimerScope timer(isolate, 9195 RuntimeCallTimerScope timer(isolate,
9202 &RuntimeCallStats::InvokeFunctionCallback); 9196 &RuntimeCallStats::InvokeFunctionCallback);
9203 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED(
9204 isolate,
9205 &internal::tracing::TraceEventStatsTable::InvokeFunctionCallback);
9206 Address callback_address = 9197 Address callback_address =
9207 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); 9198 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
9208 VMState<EXTERNAL> state(isolate); 9199 VMState<EXTERNAL> state(isolate);
9209 ExternalCallbackScope call_scope(isolate, callback_address); 9200 ExternalCallbackScope call_scope(isolate, callback_address);
9210 callback(info); 9201 callback(info);
9211 } 9202 }
9212 9203
9213 9204
9214 } // namespace internal 9205 } // namespace internal
9215 } // namespace v8 9206 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/api-arguments.cc » ('j') | src/counters.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698