| 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 #include "bin/isolate_data.h" | 9 #include "bin/isolate_data.h" |
| 10 | 10 |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 | 132 |
| 133 | 133 |
| 134 #ifndef PRODUCT | 134 #ifndef PRODUCT |
| 135 | 135 |
| 136 | 136 |
| 137 BENCHMARK(CorelibCompilerStats) { | 137 BENCHMARK(CorelibCompilerStats) { |
| 138 bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary); | 138 bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary); |
| 139 bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary); | 139 bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary); |
| 140 TransitionNativeToVM transition(thread); | 140 TransitionNativeToVM transition(thread); |
| 141 CompilerStats* stats = thread->isolate()->compiler_stats(); | 141 CompilerStats* stats = thread->isolate()->aggregate_compiler_stats(); |
| 142 ASSERT(stats != NULL); | 142 ASSERT(stats != NULL); |
| 143 stats->EnableBenchmark(); | 143 stats->EnableBenchmark(); |
| 144 Timer timer(true, "Compiler stats compiling all of Core lib"); | 144 Timer timer(true, "Compiler stats compiling all of Core lib"); |
| 145 timer.Start(); | 145 timer.Start(); |
| 146 const Error& error = Error::Handle(Library::CompileAll()); | 146 const Error& error = Error::Handle(Library::CompileAll()); |
| 147 if (!error.IsNull()) { | 147 if (!error.IsNull()) { |
| 148 OS::PrintErr("Unexpected error in CorelibCompileAll benchmark:\n%s", | 148 OS::PrintErr("Unexpected error in CorelibCompileAll benchmark:\n%s", |
| 149 error.ToErrorCString()); | 149 error.ToErrorCString()); |
| 150 } | 150 } |
| 151 timer.Stop(); | 151 timer.Stop(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 167 Dart_Handle lib = TestCase::LoadTestScript( | 167 Dart_Handle lib = TestCase::LoadTestScript( |
| 168 script, | 168 script, |
| 169 reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver)); | 169 reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver)); |
| 170 EXPECT_VALID(lib); | 170 EXPECT_VALID(lib); |
| 171 } else { | 171 } else { |
| 172 Dart_Handle lib = TestCase::LoadTestScript( | 172 Dart_Handle lib = TestCase::LoadTestScript( |
| 173 "import 'pkg/compiler/lib/compiler.dart';", | 173 "import 'pkg/compiler/lib/compiler.dart';", |
| 174 reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver)); | 174 reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver)); |
| 175 EXPECT_VALID(lib); | 175 EXPECT_VALID(lib); |
| 176 } | 176 } |
| 177 CompilerStats* stats = thread->isolate()->compiler_stats(); | 177 CompilerStats* stats = thread->isolate()->aggregate_compiler_stats(); |
| 178 ASSERT(stats != NULL); | 178 ASSERT(stats != NULL); |
| 179 stats->EnableBenchmark(); | 179 stats->EnableBenchmark(); |
| 180 Timer timer(true, "Compile all of dart2js benchmark"); | 180 Timer timer(true, "Compile all of dart2js benchmark"); |
| 181 timer.Start(); | 181 timer.Start(); |
| 182 #if !defined(PRODUCT) | 182 #if !defined(PRODUCT) |
| 183 // Constant in product mode. | 183 // Constant in product mode. |
| 184 const bool old_flag = FLAG_background_compilation; | 184 const bool old_flag = FLAG_background_compilation; |
| 185 FLAG_background_compilation = false; | 185 FLAG_background_compilation = false; |
| 186 #endif | 186 #endif |
| 187 Dart_Handle result = Dart_CompileAll(); | 187 Dart_Handle result = Dart_CompileAll(); |
| (...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 thread); | 725 thread); |
| 726 reader.ReadObject(); | 726 reader.ReadObject(); |
| 727 free(buffer); | 727 free(buffer); |
| 728 } | 728 } |
| 729 timer.Stop(); | 729 timer.Stop(); |
| 730 int64_t elapsed_time = timer.TotalElapsedTime(); | 730 int64_t elapsed_time = timer.TotalElapsedTime(); |
| 731 benchmark->set_score(elapsed_time); | 731 benchmark->set_score(elapsed_time); |
| 732 } | 732 } |
| 733 | 733 |
| 734 } // namespace dart | 734 } // namespace dart |
| OLD | NEW |