| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/benchmark_test.h" | 5 #include "vm/benchmark_test.h" |
| 6 | 6 |
| 7 #include "bin/builtin.h" | 7 #include "bin/builtin.h" |
| 8 #include "bin/file.h" | 8 #include "bin/file.h" |
| 9 | 9 |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 458 | 458 |
| 459 BENCHMARK(CreateMirrorSystem) { | 459 BENCHMARK(CreateMirrorSystem) { |
| 460 const char* kScriptChars = | 460 const char* kScriptChars = |
| 461 "import 'dart:mirrors';\n" | 461 "import 'dart:mirrors';\n" |
| 462 "\n" | 462 "\n" |
| 463 "void benchmark() {\n" | 463 "void benchmark() {\n" |
| 464 " currentMirrorSystem();\n" | 464 " currentMirrorSystem();\n" |
| 465 "}\n"; | 465 "}\n"; |
| 466 | 466 |
| 467 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); | 467 Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL); |
| 468 Dart_Handle args[0]; | |
| 469 | 468 |
| 470 Timer timer(true, "currentMirrorSystem() benchmark"); | 469 Timer timer(true, "currentMirrorSystem() benchmark"); |
| 471 timer.Start(); | 470 timer.Start(); |
| 472 Dart_Invoke(lib, NewString("benchmark"), 0, args); | 471 Dart_Invoke(lib, NewString("benchmark"), 0, NULL); |
| 473 timer.Stop(); | 472 timer.Stop(); |
| 474 int64_t elapsed_time = timer.TotalElapsedTime(); | 473 int64_t elapsed_time = timer.TotalElapsedTime(); |
| 475 benchmark->set_score(elapsed_time); | 474 benchmark->set_score(elapsed_time); |
| 476 } | 475 } |
| 477 | 476 |
| 478 } // namespace dart | 477 } // namespace dart |
| OLD | NEW |