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

Side by Side Diff: src/builtins/builtins-utils.h

Issue 2187693002: [Tracing] Embed V8 runtime call stats into tracing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 #ifndef V8_BUILTINS_BUILTINS_UTILS_H_ 5 #ifndef V8_BUILTINS_BUILTINS_UTILS_H_
6 #define V8_BUILTINS_BUILTINS_UTILS_H_ 6 #define V8_BUILTINS_BUILTINS_UTILS_H_
7 7
8 #include "src/arguments.h" 8 #include "src/arguments.h"
9 #include "src/base/logging.h" 9 #include "src/base/logging.h"
10 #include "src/builtins/builtins.h" 10 #include "src/builtins/builtins.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 // enabled. 78 // enabled.
79 // TODO(cbruni): Convert the IsContext CHECK back to a DCHECK. 79 // TODO(cbruni): Convert the IsContext CHECK back to a DCHECK.
80 #define BUILTIN(name) \ 80 #define BUILTIN(name) \
81 MUST_USE_RESULT static Object* Builtin_Impl_##name(BuiltinArguments args, \ 81 MUST_USE_RESULT static Object* Builtin_Impl_##name(BuiltinArguments args, \
82 Isolate* isolate); \ 82 Isolate* isolate); \
83 \ 83 \
84 V8_NOINLINE static Object* Builtin_Impl_Stats_##name( \ 84 V8_NOINLINE static Object* Builtin_Impl_Stats_##name( \
85 int args_length, Object** args_object, Isolate* isolate) { \ 85 int args_length, Object** args_object, Isolate* isolate) { \
86 BuiltinArguments args(args_length, args_object); \ 86 BuiltinArguments args(args_length, args_object); \
87 RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Builtin_##name); \ 87 RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Builtin_##name); \
88 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), \
89 "V8.Builtin_" #name); \
90 return Builtin_Impl_##name(args, isolate); \ 88 return Builtin_Impl_##name(args, isolate); \
91 } \ 89 } \
92 \ 90 \
93 MUST_USE_RESULT Object* Builtin_##name( \ 91 MUST_USE_RESULT Object* Builtin_##name( \
94 int args_length, Object** args_object, Isolate* isolate) { \ 92 int args_length, Object** args_object, Isolate* isolate) { \
95 CHECK(isolate->context() == nullptr || isolate->context()->IsContext()); \ 93 CHECK(isolate->context() == nullptr || isolate->context()->IsContext()); \
96 if (FLAG_runtime_call_stats) { \ 94 if (FLAG_runtime_call_stats) { \
97 return Builtin_Impl_Stats_##name(args_length, args_object, isolate); \ 95 return Builtin_Impl_Stats_##name(args_length, args_object, isolate); \
98 } \ 96 } \
99 BuiltinArguments args(args_length, args_object); \ 97 BuiltinArguments args(args_length, args_object); \
100 return Builtin_Impl_##name(args, isolate); \ 98 TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_SCOPED( \
99 isolate, &tracing::TraceEventStatsTable::Builtin_##name); \
100 Object* result = Builtin_Impl_##name(args, isolate); \
Camillo Bruni 2016/07/27 08:29:07 The same as for the runtime functions. I'd like to
101 return result; \
101 } \ 102 } \
102 \ 103 \
103 MUST_USE_RESULT static Object* Builtin_Impl_##name(BuiltinArguments args, \ 104 MUST_USE_RESULT static Object* Builtin_Impl_##name(BuiltinArguments args, \
104 Isolate* isolate) 105 Isolate* isolate)
105 106
106 // ---------------------------------------------------------------------------- 107 // ----------------------------------------------------------------------------
107 108
108 #define CHECK_RECEIVER(Type, name, method) \ 109 #define CHECK_RECEIVER(Type, name, method) \
109 if (!args.receiver()->Is##Type()) { \ 110 if (!args.receiver()->Is##Type()) { \
110 THROW_NEW_ERROR_RETURN_FAILURE( \ 111 THROW_NEW_ERROR_RETURN_FAILURE( \
(...skipping 16 matching lines...) Expand all
127 isolate->factory()->NewStringFromAsciiChecked(method))); \ 128 isolate->factory()->NewStringFromAsciiChecked(method))); \
128 } \ 129 } \
129 Handle<String> name; \ 130 Handle<String> name; \
130 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \ 131 ASSIGN_RETURN_FAILURE_ON_EXCEPTION( \
131 isolate, name, Object::ToString(isolate, args.receiver())) 132 isolate, name, Object::ToString(isolate, args.receiver()))
132 133
133 } // namespace internal 134 } // namespace internal
134 } // namespace v8 135 } // namespace v8
135 136
136 #endif // V8_BUILTINS_BUILTINS_UTILS_H_ 137 #endif // V8_BUILTINS_BUILTINS_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698