Commit 6d96d19f authored by machenbach's avatar machenbach Committed by Commit bot

Revert of Reland: Add a trace-event for each runtime-stats timer (CL...

Revert of Reland: Add a trace-event for each runtime-stats timer (CL 2052523002) (patchset #2 id:20001 of https://codereview.chromium.org/2063853002/ )

Reason for revert:
[Sheriff] Speculative revert for http://crbug.com/620279

Original issue's description:
> Reland: Add a trace-event for each runtime-stats timer (CL 2052523002)
>
> The trace-events will have a high overhead when turned on, but they are in a disabled-by-default category.
>
> As long as the off overhead is negligible, this CL allows us to understand the behavior of V8 rather than its performance at the moment.
>
> The original CL was failing the TSAN builder, the variable in question was intended to be accessed quickly with no guarantee.
> Switched to using an Atomic variable with no barrier read/write.
>
> BUG=v8:5089
>
> patch from issue 2052523002 at patchset 100001 (http://crrev.com/2052523002#ps100001)
>
> Committed: https://crrev.com/fd7080cbefc21f2f890b5db00d4eadf163e2cbbf
> Cr-Commit-Position: refs/heads/master@{#36973}

TBR=cbruni@chromium.org,fmeawad@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5089

Review-Url: https://codereview.chromium.org/2068143002
Cr-Commit-Position: refs/heads/master@{#36997}
parent 14a1a7ed
...@@ -20,7 +20,6 @@ namespace internal { ...@@ -20,7 +20,6 @@ namespace internal {
Handle<Name> name) { \ Handle<Name> name) { \
Isolate* isolate = this->isolate(); \ Isolate* isolate = this->isolate(); \
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \ RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \
TRACE_RUNTIME_CALL(#Function); \
VMState<EXTERNAL> state(isolate); \ VMState<EXTERNAL> state(isolate); \
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \ ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
PropertyCallbackInfo<ApiReturn> info(begin()); \ PropertyCallbackInfo<ApiReturn> info(begin()); \
...@@ -45,7 +44,6 @@ FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(WRITE_CALL_1_NAME) ...@@ -45,7 +44,6 @@ FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(WRITE_CALL_1_NAME)
uint32_t index) { \ uint32_t index) { \
Isolate* isolate = this->isolate(); \ Isolate* isolate = this->isolate(); \
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \ RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \
TRACE_RUNTIME_CALL(#Function); \
VMState<EXTERNAL> state(isolate); \ VMState<EXTERNAL> state(isolate); \
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \ ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \
PropertyCallbackInfo<ApiReturn> info(begin()); \ PropertyCallbackInfo<ApiReturn> info(begin()); \
...@@ -66,7 +64,6 @@ Handle<Object> PropertyCallbackArguments::Call( ...@@ -66,7 +64,6 @@ Handle<Object> PropertyCallbackArguments::Call(
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer( RuntimeCallTimerScope timer(
isolate, &RuntimeCallStats::GenericNamedPropertySetterCallback); isolate, &RuntimeCallStats::GenericNamedPropertySetterCallback);
TRACE_RUNTIME_CALL("GenericNamedPropertySetterCallback");
VMState<EXTERNAL> state(isolate); VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<v8::Value> info(begin()); PropertyCallbackInfo<v8::Value> info(begin());
...@@ -82,7 +79,6 @@ Handle<Object> PropertyCallbackArguments::Call(IndexedPropertySetterCallback f, ...@@ -82,7 +79,6 @@ Handle<Object> PropertyCallbackArguments::Call(IndexedPropertySetterCallback f,
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(isolate, RuntimeCallTimerScope timer(isolate,
&RuntimeCallStats::IndexedPropertySetterCallback); &RuntimeCallStats::IndexedPropertySetterCallback);
TRACE_RUNTIME_CALL("IndexedPropertySetterCallback");
VMState<EXTERNAL> state(isolate); VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<v8::Value> info(begin()); PropertyCallbackInfo<v8::Value> info(begin());
...@@ -97,7 +93,6 @@ void PropertyCallbackArguments::Call(AccessorNameSetterCallback f, ...@@ -97,7 +93,6 @@ void PropertyCallbackArguments::Call(AccessorNameSetterCallback f,
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(isolate, RuntimeCallTimerScope timer(isolate,
&RuntimeCallStats::AccessorNameSetterCallback); &RuntimeCallStats::AccessorNameSetterCallback);
TRACE_RUNTIME_CALL("AccessorNameSetterCallback");
VMState<EXTERNAL> state(isolate); VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<void> info(begin()); PropertyCallbackInfo<void> info(begin());
......
...@@ -13,7 +13,6 @@ namespace internal { ...@@ -13,7 +13,6 @@ namespace internal {
Handle<Object> FunctionCallbackArguments::Call(FunctionCallback f) { Handle<Object> FunctionCallbackArguments::Call(FunctionCallback f) {
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::FunctionCallback); RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::FunctionCallback);
TRACE_RUNTIME_CALL("FunctionCallback");
VMState<EXTERNAL> state(isolate); VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
FunctionCallbackInfo<v8::Value> info(begin(), argv_, argc_); FunctionCallbackInfo<v8::Value> info(begin(), argv_, argc_);
...@@ -25,7 +24,6 @@ Handle<JSObject> PropertyCallbackArguments::Call( ...@@ -25,7 +24,6 @@ Handle<JSObject> PropertyCallbackArguments::Call(
IndexedPropertyEnumeratorCallback f) { IndexedPropertyEnumeratorCallback f) {
Isolate* isolate = this->isolate(); Isolate* isolate = this->isolate();
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::PropertyCallback); RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::PropertyCallback);
TRACE_RUNTIME_CALL("PropertyCallback");
VMState<EXTERNAL> state(isolate); VMState<EXTERNAL> state(isolate);
ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
PropertyCallbackInfo<v8::Array> info(begin()); PropertyCallbackInfo<v8::Array> info(begin());
......
...@@ -73,7 +73,6 @@ namespace v8 { ...@@ -73,7 +73,6 @@ namespace v8 {
#define LOG_API(isolate, class_name, function_name) \ #define LOG_API(isolate, class_name, function_name) \
i::RuntimeCallTimerScope _runtime_timer( \ i::RuntimeCallTimerScope _runtime_timer( \
isolate, &i::RuntimeCallStats::API_##class_name##_##function_name); \ isolate, &i::RuntimeCallStats::API_##class_name##_##function_name); \
TRACE_RUNTIME_CALL(#class_name "::" #function_name); \
LOG(isolate, ApiEntryCall("v8::" #class_name "::" #function_name)) LOG(isolate, ApiEntryCall("v8::" #class_name "::" #function_name))
#define ENTER_V8(isolate) i::VMState<v8::OTHER> __state__((isolate)) #define ENTER_V8(isolate) i::VMState<v8::OTHER> __state__((isolate))
...@@ -1765,7 +1764,6 @@ MaybeLocal<Value> Script::Run(Local<Context> context) { ...@@ -1765,7 +1764,6 @@ MaybeLocal<Value> Script::Run(Local<Context> context) {
i::AggregatingHistogramTimerScope timer(isolate->counters()->compile_lazy()); i::AggregatingHistogramTimerScope timer(isolate->counters()->compile_lazy());
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute"); TRACE_EVENT0("v8", "V8.Execute");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
auto fun = i::Handle<i::JSFunction>::cast(Utils::OpenHandle(this)); auto fun = i::Handle<i::JSFunction>::cast(Utils::OpenHandle(this));
i::Handle<i::Object> receiver = isolate->global_proxy(); i::Handle<i::Object> receiver = isolate->global_proxy();
Local<Value> result; Local<Value> result;
...@@ -1820,7 +1818,6 @@ MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal( ...@@ -1820,7 +1818,6 @@ MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal(
{ {
i::HistogramTimerScope total(isolate->counters()->compile_script(), true); i::HistogramTimerScope total(isolate->counters()->compile_script(), true);
TRACE_EVENT0("v8", "V8.CompileScript"); TRACE_EVENT0("v8", "V8.CompileScript");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
i::Handle<i::Object> name_obj; i::Handle<i::Object> name_obj;
i::Handle<i::Object> source_map_url; i::Handle<i::Object> source_map_url;
int line_offset = 0; int line_offset = 0;
...@@ -4357,7 +4354,6 @@ MaybeLocal<Value> Object::CallAsFunction(Local<Context> context, ...@@ -4357,7 +4354,6 @@ MaybeLocal<Value> Object::CallAsFunction(Local<Context> context,
i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true);
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute"); TRACE_EVENT0("v8", "V8.Execute");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
auto self = Utils::OpenHandle(this); auto self = Utils::OpenHandle(this);
auto recv_obj = Utils::OpenHandle(*recv); auto recv_obj = Utils::OpenHandle(*recv);
STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**)); STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
...@@ -4386,7 +4382,6 @@ MaybeLocal<Value> Object::CallAsConstructor(Local<Context> context, int argc, ...@@ -4386,7 +4382,6 @@ MaybeLocal<Value> Object::CallAsConstructor(Local<Context> context, int argc,
i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true);
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute"); TRACE_EVENT0("v8", "V8.Execute");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
auto self = Utils::OpenHandle(this); auto self = Utils::OpenHandle(this);
STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**)); STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv); i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
...@@ -4437,7 +4432,6 @@ MaybeLocal<Object> Function::NewInstance(Local<Context> context, int argc, ...@@ -4437,7 +4432,6 @@ MaybeLocal<Object> Function::NewInstance(Local<Context> context, int argc,
i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true);
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute"); TRACE_EVENT0("v8", "V8.Execute");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
auto self = Utils::OpenHandle(this); auto self = Utils::OpenHandle(this);
STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**)); STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv); i::Handle<i::Object>* args = reinterpret_cast<i::Handle<i::Object>*>(argv);
...@@ -4463,7 +4457,6 @@ MaybeLocal<v8::Value> Function::Call(Local<Context> context, ...@@ -4463,7 +4457,6 @@ MaybeLocal<v8::Value> Function::Call(Local<Context> context,
i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true); i::HistogramTimerScope execute_timer(isolate->counters()->execute(), true);
i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate); i::TimerEventScope<i::TimerEventExecute> timer_scope(isolate);
TRACE_EVENT0("v8", "V8.Execute"); TRACE_EVENT0("v8", "V8.Execute");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
auto self = Utils::OpenHandle(this); auto self = Utils::OpenHandle(this);
i::Handle<i::Object> recv_obj = Utils::OpenHandle(*recv); i::Handle<i::Object> recv_obj = Utils::OpenHandle(*recv);
STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**)); STATIC_ASSERT(sizeof(v8::Local<v8::Value>) == sizeof(i::Object**));
...@@ -5611,8 +5604,6 @@ Local<Context> v8::Context::New(v8::Isolate* external_isolate, ...@@ -5611,8 +5604,6 @@ Local<Context> v8::Context::New(v8::Isolate* external_isolate,
v8::Local<Value> global_object) { v8::Local<Value> global_object) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate); i::Isolate* isolate = reinterpret_cast<i::Isolate*>(external_isolate);
LOG_API(isolate, Context, New); LOG_API(isolate, Context, New);
TRACE_EVENT0("v8", "V8.NewContext");
TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING();
i::HandleScope scope(isolate); i::HandleScope scope(isolate);
ExtensionConfiguration no_extensions; ExtensionConfiguration no_extensions;
if (extensions == NULL) extensions = &no_extensions; if (extensions == NULL) extensions = &no_extensions;
...@@ -8802,7 +8793,6 @@ void InvokeAccessorGetterCallback( ...@@ -8802,7 +8793,6 @@ void InvokeAccessorGetterCallback(
Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
RuntimeCallTimerScope timer(isolate, RuntimeCallTimerScope timer(isolate,
&RuntimeCallStats::AccessorGetterCallback); &RuntimeCallStats::AccessorGetterCallback);
TRACE_RUNTIME_CALL("AccessorGetterCallback");
Address getter_address = reinterpret_cast<Address>(reinterpret_cast<intptr_t>( Address getter_address = reinterpret_cast<Address>(reinterpret_cast<intptr_t>(
getter)); getter));
VMState<EXTERNAL> state(isolate); VMState<EXTERNAL> state(isolate);
...@@ -8816,7 +8806,6 @@ void InvokeFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info, ...@@ -8816,7 +8806,6 @@ void InvokeFunctionCallback(const v8::FunctionCallbackInfo<v8::Value>& info,
Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate()); Isolate* isolate = reinterpret_cast<Isolate*>(info.GetIsolate());
RuntimeCallTimerScope timer(isolate, RuntimeCallTimerScope timer(isolate,
&RuntimeCallStats::InvokeFunctionCallback); &RuntimeCallStats::InvokeFunctionCallback);
TRACE_RUNTIME_CALL("InvokeFunctionCallback");
Address callback_address = Address callback_address =
reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback));
VMState<EXTERNAL> state(isolate); VMState<EXTERNAL> state(isolate);
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "src/globals.h" #include "src/globals.h"
#include "src/objects.h" #include "src/objects.h"
#include "src/runtime/runtime.h" #include "src/runtime/runtime.h"
#include "src/tracing/trace-event.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
...@@ -787,7 +786,6 @@ class RuntimeCallStats { ...@@ -787,7 +786,6 @@ class RuntimeCallStats {
#define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \ #define TRACE_RUNTIME_CALL_STATS(isolate, counter_name) \
do { \ do { \
TRACE_RUNTIME_CALL(#counter_name); \
if (FLAG_runtime_call_stats) { \ if (FLAG_runtime_call_stats) { \
RuntimeCallStats::CorrectCurrentCounterId( \ RuntimeCallStats::CorrectCurrentCounterId( \
isolate, &RuntimeCallStats::counter_name); \ isolate, &RuntimeCallStats::counter_name); \
......
...@@ -95,7 +95,6 @@ MUST_USE_RESULT MaybeHandle<Object> Invoke(Isolate* isolate, bool is_construct, ...@@ -95,7 +95,6 @@ MUST_USE_RESULT MaybeHandle<Object> Invoke(Isolate* isolate, bool is_construct,
PrintDeserializedCodeInfo(Handle<JSFunction>::cast(target)); PrintDeserializedCodeInfo(Handle<JSFunction>::cast(target));
} }
RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::JS_Execution); RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::JS_Execution);
TRACE_RUNTIME_CALL("JS_Execution");
value = CALL_GENERATED_CODE(isolate, stub_entry, orig_func, func, recv, value = CALL_GENERATED_CODE(isolate, stub_entry, orig_func, func, recv,
argc, argv); argc, argv);
} }
......
...@@ -352,8 +352,6 @@ void LookupIterator::Delete() { ...@@ -352,8 +352,6 @@ void LookupIterator::Delete() {
isolate_, is_prototype_map isolate_, is_prototype_map
? &RuntimeCallStats::PrototypeObject_DeleteProperty ? &RuntimeCallStats::PrototypeObject_DeleteProperty
: &RuntimeCallStats::Object_DeleteProperty); : &RuntimeCallStats::Object_DeleteProperty);
TRACE_RUNTIME_CALL(is_prototype_map ? "PrototypeObject_DeleteProperty"
: "Object_DeleteProperty");
PropertyNormalizationMode mode = PropertyNormalizationMode mode =
is_prototype_map ? KEEP_INOBJECT_PROPERTIES : CLEAR_INOBJECT_PROPERTIES; is_prototype_map ? KEEP_INOBJECT_PROPERTIES : CLEAR_INOBJECT_PROPERTIES;
......
...@@ -9161,9 +9161,6 @@ Handle<Map> Map::TransitionToDataProperty(Handle<Map> map, Handle<Name> name, ...@@ -9161,9 +9161,6 @@ Handle<Map> Map::TransitionToDataProperty(Handle<Map> map, Handle<Name> name,
*map, map->is_prototype_map() *map, map->is_prototype_map()
? &RuntimeCallStats::PrototypeMap_TransitionToDataProperty ? &RuntimeCallStats::PrototypeMap_TransitionToDataProperty
: &RuntimeCallStats::Map_TransitionToDataProperty); : &RuntimeCallStats::Map_TransitionToDataProperty);
TRACE_RUNTIME_CALL(map->is_prototype_map()
? "PrototypeMap_TransitionToDataProperty"
: "Map_TransitionToDataProperty");
DCHECK(name->IsUniqueName()); DCHECK(name->IsUniqueName());
DCHECK(!map->is_dictionary_map()); DCHECK(!map->is_dictionary_map());
...@@ -9250,9 +9247,6 @@ Handle<Map> Map::TransitionToAccessorProperty(Isolate* isolate, Handle<Map> map, ...@@ -9250,9 +9247,6 @@ Handle<Map> Map::TransitionToAccessorProperty(Isolate* isolate, Handle<Map> map,
map->is_prototype_map() map->is_prototype_map()
? &RuntimeCallStats::PrototypeMap_TransitionToAccessorProperty ? &RuntimeCallStats::PrototypeMap_TransitionToAccessorProperty
: &RuntimeCallStats::Map_TransitionToAccessorProperty); : &RuntimeCallStats::Map_TransitionToAccessorProperty);
TRACE_RUNTIME_CALL(map->is_prototype_map()
? "PrototypeMap_TransitionToAccessorProperty"
: "Map_TransitionToAccessorProperty");
// At least one of the accessors needs to be a new value. // At least one of the accessors needs to be a new value.
DCHECK(!getter->IsNull(isolate) || !setter->IsNull(isolate)); DCHECK(!getter->IsNull(isolate) || !setter->IsNull(isolate));
...@@ -12118,7 +12112,6 @@ Handle<Cell> Map::GetOrCreatePrototypeChainValidityCell(Handle<Map> map, ...@@ -12118,7 +12112,6 @@ Handle<Cell> Map::GetOrCreatePrototypeChainValidityCell(Handle<Map> map,
void Map::SetPrototype(Handle<Map> map, Handle<Object> prototype, void Map::SetPrototype(Handle<Map> map, Handle<Object> prototype,
PrototypeOptimizationMode proto_mode) { PrototypeOptimizationMode proto_mode) {
RuntimeCallTimerScope stats_scope(*map, &RuntimeCallStats::Map_SetPrototype); RuntimeCallTimerScope stats_scope(*map, &RuntimeCallStats::Map_SetPrototype);
TRACE_RUNTIME_CALL("Map_SetPrototype");
bool is_hidden = false; bool is_hidden = false;
if (prototype->IsJSObject()) { if (prototype->IsJSObject()) {
......
...@@ -6,10 +6,6 @@ ...@@ -6,10 +6,6 @@
#include "src/v8.h" #include "src/v8.h"
// A global flag used as a shortcut to check for the
// v8.runtime category due to its high frequency use.
TRACE_EVENT_API_ATOMIC_BYTE g_runtime_calls_trace_enabled = 0;
namespace v8 { namespace v8 {
namespace internal { namespace internal {
namespace tracing { namespace tracing {
......
...@@ -133,7 +133,6 @@ enum CategoryGroupEnabledFlags { ...@@ -133,7 +133,6 @@ enum CategoryGroupEnabledFlags {
->UpdateTraceEventDuration ->UpdateTraceEventDuration
// Defines atomic operations used internally by the tracing system. // Defines atomic operations used internally by the tracing system.
#define TRACE_EVENT_API_ATOMIC_BYTE v8::base::Atomic8
#define TRACE_EVENT_API_ATOMIC_WORD v8::base::AtomicWord #define TRACE_EVENT_API_ATOMIC_WORD v8::base::AtomicWord
#define TRACE_EVENT_API_ATOMIC_LOAD(var) v8::base::NoBarrier_Load(&(var)) #define TRACE_EVENT_API_ATOMIC_LOAD(var) v8::base::NoBarrier_Load(&(var))
#define TRACE_EVENT_API_ATOMIC_STORE(var, value) \ #define TRACE_EVENT_API_ATOMIC_STORE(var, value) \
...@@ -595,31 +594,4 @@ class TraceEventSamplingStateScope { ...@@ -595,31 +594,4 @@ class TraceEventSamplingStateScope {
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
// V8 Specific macros
// Runtime calls happen at a high frequency, the following set of macros
// minimizes the tracing overhead of those calls. A global variable is set
// when top level V8 API is called, and checked per runtime call.
extern TRACE_EVENT_API_ATOMIC_BYTE g_runtime_calls_trace_enabled;
#define TRACE_IS_RUNTIME_CALLS_TRACING_ENABLED() \
TRACE_EVENT_API_ATOMIC_LOAD(g_runtime_calls_trace_enabled)
#define TRACE_CHECK_AND_SET_RUNTIME_CALLS_TRACING() \
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO( \
TRACE_DISABLED_BY_DEFAULT("v8.runtime")); \
TRACE_EVENT_API_ATOMIC_STORE(g_runtime_calls_trace_enabled, \
INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE() ? 1 \
: 0); \
} while (0)
#define TRACE_RUNTIME_CALL(name) \
do { \
if (V8_UNLIKELY(TRACE_IS_RUNTIME_CALLS_TRACING_ENABLED())) { \
INTERNAL_TRACE_EVENT_ADD_SCOPED(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), \
name); \
} \
} while (0)
#endif // SRC_TRACING_TRACE_EVENT_H_ #endif // SRC_TRACING_TRACE_EVENT_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment