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

Side by Side Diff: src/arguments.h

Issue 1771323003: [counter] reducing the overhead of RuntimeCallTimerScope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: further reducing overhead Created 4 years, 9 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/counters.h » ('j') | no next file with comments »
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 #ifndef V8_ARGUMENTS_H_ 5 #ifndef V8_ARGUMENTS_H_
6 #define V8_ARGUMENTS_H_ 6 #define V8_ARGUMENTS_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 10
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 264
265 double ClobberDoubleRegisters(double x1, double x2, double x3, double x4); 265 double ClobberDoubleRegisters(double x1, double x2, double x3, double x4);
266 266
267 267
268 #ifdef DEBUG 268 #ifdef DEBUG
269 #define CLOBBER_DOUBLE_REGISTERS() ClobberDoubleRegisters(1, 2, 3, 4); 269 #define CLOBBER_DOUBLE_REGISTERS() ClobberDoubleRegisters(1, 2, 3, 4);
270 #else 270 #else
271 #define CLOBBER_DOUBLE_REGISTERS() 271 #define CLOBBER_DOUBLE_REGISTERS()
272 #endif 272 #endif
273 273
274 #define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \ 274 #define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \
275 static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \ 275 static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \
276 Type Name(int args_length, Object** args_object, Isolate* isolate) { \ 276 Type Name(int args_length, Object** args_object, Isolate* isolate) { \
277 CLOBBER_DOUBLE_REGISTERS(); \ 277 CLOBBER_DOUBLE_REGISTERS(); \
278 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \ 278 Arguments args(args_length, args_object); \
279 RuntimeCallTimerScope timer(isolate, &stats->Name); \ 279 Type value; \
280 Arguments args(args_length, args_object); \ 280 if (FLAG_runtime_call_stats) { \
281 Type value = __RT_impl_##Name(args, isolate); \ 281 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \
282 return value; \ 282 RuntimeCallTimerScope timer(isolate, &stats->Name); \
283 } \ 283 value = __RT_impl_##Name(args, isolate); \
284 } else { \
285 value = __RT_impl_##Name(args, isolate); \
286 } \
287 return value; \
288 } \
284 static Type __RT_impl_##Name(Arguments args, Isolate* isolate) 289 static Type __RT_impl_##Name(Arguments args, Isolate* isolate)
285 290
286 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) 291 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name)
287 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ 292 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \
288 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) 293 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name)
289 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \ 294 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \
290 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name) 295 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name)
291 296
292 } // namespace internal 297 } // namespace internal
293 } // namespace v8 298 } // namespace v8
294 299
295 #endif // V8_ARGUMENTS_H_ 300 #endif // V8_ARGUMENTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698