Commit 2049e188 authored by Camillo Bruni's avatar Camillo Bruni Committed by V8 LUCI CQ

[runtime] Remove is_runtime_stats_enabled without RCS

If v8_enable_runtime_call_stats == false, we don't need
TracingFlags::is_runtime_stats_enabled and can save a bit of code and
needless overhead.

Bug: v8:11299
Change-Id: Ia5ec51c29b2408b77b65984c5bba0ae16e0de243
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3024155Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75983}
parent 86c81a84
......@@ -79,6 +79,7 @@ class BuiltinArguments : public JavaScriptArguments {
// through the BuiltinArguments object args.
// TODO(cbruni): add global flag to check whether any tracing events have been
// enabled.
#ifdef V8_RUNTIME_CALL_STATS
#define BUILTIN(name) \
V8_WARN_UNUSED_RESULT static Object Builtin_Impl_##name( \
BuiltinArguments args, Isolate* isolate); \
......@@ -105,6 +106,21 @@ class BuiltinArguments : public JavaScriptArguments {
V8_WARN_UNUSED_RESULT static Object Builtin_Impl_##name( \
BuiltinArguments args, Isolate* isolate)
#else // V8_RUNTIME_CALL_STATS
#define BUILTIN(name) \
V8_WARN_UNUSED_RESULT static Object Builtin_Impl_##name( \
BuiltinArguments args, Isolate* isolate); \
\
V8_WARN_UNUSED_RESULT Address Builtin_##name( \
int args_length, Address* args_object, Isolate* isolate) { \
DCHECK(isolate->context().is_null() || isolate->context().IsContext()); \
BuiltinArguments args(args_length, args_object); \
return CONVERT_OBJECT(Builtin_Impl_##name(args, isolate)); \
} \
\
V8_WARN_UNUSED_RESULT static Object Builtin_Impl_##name( \
BuiltinArguments args, Isolate* isolate)
#endif // V8_RUNTIME_CALL_STATS
// ----------------------------------------------------------------------------
#define CHECK_RECEIVER(Type, name, method) \
......
......@@ -69,9 +69,8 @@ CollectionEpoch GCTracer::CurrentEpoch(Scope::ScopeId scope_id) {
GCTracer::Scope::Scope(GCTracer* tracer, ScopeId scope, ThreadKind thread_kind)
: tracer_(tracer), scope_(scope), thread_kind_(thread_kind) {
start_time_ = tracer_->MonotonicallyIncreasingTimeInMs();
if (V8_LIKELY(!TracingFlags::is_runtime_stats_enabled())) return;
#ifdef V8_RUNTIME_CALL_STATS
if (V8_LIKELY(!TracingFlags::is_runtime_stats_enabled())) return;
if (thread_kind_ == ThreadKind::kMain) {
DCHECK_EQ(tracer_->heap_->isolate()->thread_id(), ThreadId::Current());
runtime_stats_ =
......
......@@ -3004,11 +3004,13 @@ RUNTIME_FUNCTION(Runtime_StoreCallbackProperty) {
Handle<Object> value = args.at(4);
HandleScope scope(isolate);
#ifdef V8_RUNTIME_CALL_STATS
if (V8_UNLIKELY(TracingFlags::is_runtime_stats_enabled())) {
RETURN_RESULT_OR_FAILURE(
isolate, Runtime::SetObjectProperty(isolate, receiver, name, value,
StoreOrigin::kMaybeKeyed));
}
#endif
DCHECK(info->IsCompatibleReceiver(*receiver));
......
......@@ -23,9 +23,11 @@ struct TracingFlags {
static V8_EXPORT_PRIVATE std::atomic_uint ic_stats;
static V8_EXPORT_PRIVATE std::atomic_uint zone_stats;
#ifdef V8_RUNTIME_CALL_STATS
static bool is_runtime_stats_enabled() {
return runtime_stats.load(std::memory_order_relaxed) != 0;
}
#endif
static bool is_gc_enabled() {
return gc.load(std::memory_order_relaxed) != 0;
......
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