| 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 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 | 35 |
| 36 // | 36 // |
| 37 // Measure compile of all functions in dart core lib classes. | 37 // Measure compile of all functions in dart core lib classes. |
| 38 // | 38 // |
| 39 BENCHMARK(CorelibCompileAll) { | 39 BENCHMARK(CorelibCompileAll) { |
| 40 bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary); | 40 bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary); |
| 41 bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary); | 41 bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary); |
| 42 Timer timer(true, "Compile all of Core lib benchmark"); | 42 Timer timer(true, "Compile all of Core lib benchmark"); |
| 43 timer.Start(); | 43 timer.Start(); |
| 44 const Error& error = Error::Handle(benchmark->isolate(), | 44 const Error& error = Error::Handle(benchmark->isolate()->current_zone(), |
| 45 Library::CompileAll()); | 45 Library::CompileAll()); |
| 46 if (!error.IsNull()) { | 46 if (!error.IsNull()) { |
| 47 OS::PrintErr("Unexpected error in CorelibCompileAll benchmark:\n%s", | 47 OS::PrintErr("Unexpected error in CorelibCompileAll benchmark:\n%s", |
| 48 error.ToErrorCString()); | 48 error.ToErrorCString()); |
| 49 } | 49 } |
| 50 timer.Stop(); | 50 timer.Stop(); |
| 51 int64_t elapsed_time = timer.TotalElapsedTime(); | 51 int64_t elapsed_time = timer.TotalElapsedTime(); |
| 52 benchmark->set_score(elapsed_time); | 52 benchmark->set_score(elapsed_time); |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 BENCHMARK(CorelibCompilerStats) { | 56 BENCHMARK(CorelibCompilerStats) { |
| 57 bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary); | 57 bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary); |
| 58 bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary); | 58 bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary); |
| 59 CompilerStats* stats = Isolate::Current()->compiler_stats(); | 59 CompilerStats* stats = Isolate::Current()->compiler_stats(); |
| 60 ASSERT(stats != NULL); | 60 ASSERT(stats != NULL); |
| 61 stats->EnableBenchmark(); | 61 stats->EnableBenchmark(); |
| 62 Timer timer(true, "Compiler stats compiling all of Core lib"); | 62 Timer timer(true, "Compiler stats compiling all of Core lib"); |
| 63 timer.Start(); | 63 timer.Start(); |
| 64 const Error& error = Error::Handle(benchmark->isolate(), | 64 const Error& error = Error::Handle(benchmark->isolate()->current_zone(), |
| 65 Library::CompileAll()); | 65 Library::CompileAll()); |
| 66 if (!error.IsNull()) { | 66 if (!error.IsNull()) { |
| 67 OS::PrintErr("Unexpected error in CorelibCompileAll benchmark:\n%s", | 67 OS::PrintErr("Unexpected error in CorelibCompileAll benchmark:\n%s", |
| 68 error.ToErrorCString()); | 68 error.ToErrorCString()); |
| 69 } | 69 } |
| 70 timer.Stop(); | 70 timer.Stop(); |
| 71 int64_t elapsed_time = timer.TotalElapsedTime(); | 71 int64_t elapsed_time = timer.TotalElapsedTime(); |
| 72 benchmark->set_score(elapsed_time); | 72 benchmark->set_score(elapsed_time); |
| 73 } | 73 } |
| 74 | 74 |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 thread); | 750 thread); |
| 751 reader.ReadObject(); | 751 reader.ReadObject(); |
| 752 free(buffer); | 752 free(buffer); |
| 753 } | 753 } |
| 754 timer.Stop(); | 754 timer.Stop(); |
| 755 int64_t elapsed_time = timer.TotalElapsedTime(); | 755 int64_t elapsed_time = timer.TotalElapsedTime(); |
| 756 benchmark->set_score(elapsed_time); | 756 benchmark->set_score(elapsed_time); |
| 757 } | 757 } |
| 758 | 758 |
| 759 } // namespace dart | 759 } // namespace dart |
| OLD | NEW |