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

Unified Diff: src/arguments.h

Issue 1868513002: [runtime] reduce runtime function and builtins overhead (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: commit ALL files Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/builtins.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arguments.h
diff --git a/src/arguments.h b/src/arguments.h
index 02090f9fe363d789ea023576a4f890caa927f47d..673a6d1abccbdd10a6db4f152a3e6f0137d4329f 100644
--- a/src/arguments.h
+++ b/src/arguments.h
@@ -79,22 +79,30 @@ double ClobberDoubleRegisters(double x1, double x2, double x3, double x4);
#define CLOBBER_DOUBLE_REGISTERS()
#endif
-#define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \
- static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \
- Type Name(int args_length, Object** args_object, Isolate* isolate) { \
- CLOBBER_DOUBLE_REGISTERS(); \
- Type value; \
- TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), "V8." #Name); \
- Arguments args(args_length, args_object); \
- if (FLAG_runtime_call_stats) { \
- RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \
- RuntimeCallTimerScope timer(isolate, &stats->Name); \
- value = __RT_impl_##Name(args, isolate); \
- } else { \
- value = __RT_impl_##Name(args, isolate); \
- } \
- return value; \
- } \
+// TODO(cbruni): add global flag to check whether any tracing events have been
+// enabled.
+#define RUNTIME_FUNCTION_RETURNS_TYPE(Type, Name) \
+ static INLINE(Type __RT_impl_##Name(Arguments args, Isolate* isolate)); \
+ \
+ V8_NOINLINE static Type Stats_##Name(int args_length, Object** args_object, \
+ Isolate* isolate) { \
+ RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); \
+ RuntimeCallTimerScope timer(isolate, &stats->Name); \
+ TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.runtime"), \
+ "V8.Runtime_" #Name); \
+ Arguments args(args_length, args_object); \
+ return __RT_impl_##Name(args, isolate); \
+ } \
+ \
+ Type Name(int args_length, Object** args_object, Isolate* isolate) { \
+ CLOBBER_DOUBLE_REGISTERS(); \
+ if (FLAG_runtime_call_stats) { \
+ return Stats_##Name(args_length, args_object, isolate); \
+ } \
+ Arguments args(args_length, args_object); \
+ return __RT_impl_##Name(args, isolate); \
+ } \
+ \
static Type __RT_impl_##Name(Arguments args, Isolate* isolate)
#define RUNTIME_FUNCTION(Name) RUNTIME_FUNCTION_RETURNS_TYPE(Object*, Name)
« no previous file with comments | « no previous file | src/builtins.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698