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

Side by Side Diff: src/arguments.h

Issue 1615943002: Runtime call counters and timers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweaks Created 4 years, 11 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/flag-definitions.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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 274
275 #define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \ 275 #define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \
276 static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \ 276 static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \
277 Type Name(int args_length, Object** args_object, Isolate* isolate) { \ 277 Type Name(int args_length, Object** args_object, Isolate* isolate) { \
278 CLOBBER_DOUBLE_REGISTERS(); \ 278 CLOBBER_DOUBLE_REGISTERS(); \
279 Arguments args(args_length, args_object); \ 279 RuntimeCallStats* stats = isolate->runtime_state()->runtime_call_stats(); \
280 return __RT_impl_##Name(args, isolate); \ 280 stats->Count_##Name++; \
281 } \ 281 base::ElapsedTimer timer; \
282 static Type __RT_impl_##Name(Arguments args, Isolate* isolate) 282 bool timing = false; \
283 if (FLAG_runtime_call_stats && !stats->in_runtime_call) { \
284 stats->in_runtime_call = true; \
285 timing = true; \
286 timer.Start(); \
287 } \
288 Arguments args(args_length, args_object); \
289 Type value = __RT_impl_##Name(args, isolate); \
290 if (timing) { \
291 stats->in_runtime_call = false; \
292 isolate->runtime_state()->runtime_call_stats()->Time_##Name += \
293 timer.Elapsed(); \
294 } \
295 return value; \
296 } \
297 static Type __RT_impl_##Name(Arguments args, Isolate* isolate)
283 298
284 299
285 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name) 300 #define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name)
286 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \ 301 #define RUNTIME_FUNCTION_RETURN_PAIR(Name) \
287 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name) 302 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectPair, Name)
288 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \ 303 #define RUNTIME_FUNCTION_RETURN_TRIPLE(Name) \
289 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name) 304 RUNTIME_FUNCTION_RETURNS_TYPE(ObjectTriple, Name)
290 305
291 } // namespace internal 306 } // namespace internal
292 } // namespace v8 307 } // namespace v8
293 308
294 #endif // V8_ARGUMENTS_H_ 309 #endif // V8_ARGUMENTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698