OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/ast/prettyprinter.h" | 8 #include "src/ast/prettyprinter.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 | 470 |
471 | 471 |
472 RUNTIME_FUNCTION(Runtime_IncrementUseCounter) { | 472 RUNTIME_FUNCTION(Runtime_IncrementUseCounter) { |
473 HandleScope scope(isolate); | 473 HandleScope scope(isolate); |
474 DCHECK_EQ(1, args.length()); | 474 DCHECK_EQ(1, args.length()); |
475 CONVERT_SMI_ARG_CHECKED(counter, 0); | 475 CONVERT_SMI_ARG_CHECKED(counter, 0); |
476 isolate->CountUsage(static_cast<v8::Isolate::UseCounterFeature>(counter)); | 476 isolate->CountUsage(static_cast<v8::Isolate::UseCounterFeature>(counter)); |
477 return isolate->heap()->undefined_value(); | 477 return isolate->heap()->undefined_value(); |
478 } | 478 } |
479 | 479 |
| 480 |
| 481 RUNTIME_FUNCTION(Runtime_GetAndResetRuntimeCallStats) { |
| 482 HandleScope scope(isolate); |
| 483 DCHECK_EQ(0, args.length()); |
| 484 std::stringstream stats_stream; |
| 485 isolate->runtime_state()->runtime_call_stats()->Print(stats_stream); |
| 486 Handle<String> result = |
| 487 isolate->factory()->NewStringFromAsciiChecked(stats_stream.str().c_str()); |
| 488 isolate->runtime_state()->runtime_call_stats()->Reset(); |
| 489 return *result; |
| 490 } |
| 491 |
480 } // namespace internal | 492 } // namespace internal |
481 } // namespace v8 | 493 } // namespace v8 |
OLD | NEW |