Index: src/runtime/runtime-internal.cc |
diff --git a/src/runtime/runtime-internal.cc b/src/runtime/runtime-internal.cc |
index ba20aa392ebe2ad6ba6b48c4beb6af56949e5143..e0783265f0ec9c6113fa7b15bbf15fefa4598f8a 100644 |
--- a/src/runtime/runtime-internal.cc |
+++ b/src/runtime/runtime-internal.cc |
@@ -477,5 +477,17 @@ RUNTIME_FUNCTION(Runtime_IncrementUseCounter) { |
return isolate->heap()->undefined_value(); |
} |
+ |
+RUNTIME_FUNCTION(Runtime_GetAndResetRuntimeCallStats) { |
+ HandleScope scope(isolate); |
+ DCHECK_EQ(0, args.length()); |
+ std::stringstream stats_stream; |
+ isolate->runtime_state()->runtime_call_stats()->Print(stats_stream); |
+ Handle<String> result = |
+ isolate->factory()->NewStringFromAsciiChecked(stats_stream.str().c_str()); |
+ isolate->runtime_state()->runtime_call_stats()->Reset(); |
+ return *result; |
+} |
+ |
} // namespace internal |
} // namespace v8 |