| 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 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 | 32 |
| 33 | 33 |
| 34 // | 34 // |
| 35 // Measure compile of all functions in dart core lib classes. | 35 // Measure compile of all functions in dart core lib classes. |
| 36 // | 36 // |
| 37 BENCHMARK(CorelibCompileAll) { | 37 BENCHMARK(CorelibCompileAll) { |
| 38 bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary); | 38 bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary); |
| 39 bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary); | 39 bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary); |
| 40 NativeToVmTimerScope scope_timer(Isolate::Current()); | |
| 41 Timer timer(true, "Compile all of Core lib benchmark"); | 40 Timer timer(true, "Compile all of Core lib benchmark"); |
| 42 timer.Start(); | 41 timer.Start(); |
| 43 const Error& error = Error::Handle(benchmark->isolate(), | 42 const Error& error = Error::Handle(benchmark->isolate(), |
| 44 Library::CompileAll()); | 43 Library::CompileAll()); |
| 45 if (!error.IsNull()) { | 44 if (!error.IsNull()) { |
| 46 OS::PrintErr("Unexpected error in CorelibCompileAll benchmark:\n%s", | 45 OS::PrintErr("Unexpected error in CorelibCompileAll benchmark:\n%s", |
| 47 error.ToErrorCString()); | 46 error.ToErrorCString()); |
| 48 } | 47 } |
| 49 EXPECT(error.IsNull()); | 48 EXPECT(error.IsNull()); |
| 50 timer.Stop(); | 49 timer.Stop(); |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 for (intptr_t i = 0; i < kLoopCount; i++) { | 496 for (intptr_t i = 0; i < kLoopCount; i++) { |
| 498 Dart_ExitIsolate(); | 497 Dart_ExitIsolate(); |
| 499 Dart_EnterIsolate(isolate); | 498 Dart_EnterIsolate(isolate); |
| 500 } | 499 } |
| 501 timer.Stop(); | 500 timer.Stop(); |
| 502 int64_t elapsed_time = timer.TotalElapsedTime(); | 501 int64_t elapsed_time = timer.TotalElapsedTime(); |
| 503 benchmark->set_score(elapsed_time); | 502 benchmark->set_score(elapsed_time); |
| 504 } | 503 } |
| 505 | 504 |
| 506 } // namespace dart | 505 } // namespace dart |
| OLD | NEW |