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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 272 |
273 bool worked = bin::DartUtils::SetOriginalWorkingDirectory(); | 273 bool worked = bin::DartUtils::SetOriginalWorkingDirectory(); |
274 EXPECT(worked); | 274 EXPECT(worked); |
275 char buffer[2048]; | 275 char buffer[2048]; |
276 char* executable_path = | 276 char* executable_path = |
277 strdup(File::GetCanonicalPath(Benchmark::Executable())); | 277 strdup(File::GetCanonicalPath(Benchmark::Executable())); |
278 const char* packages_path = "%s%s..%spackages"; | 278 const char* packages_path = "%s%s..%spackages"; |
279 const char* path_separator = File::PathSeparator(); | 279 const char* path_separator = File::PathSeparator(); |
280 OS::SNPrint(buffer, 2048, packages_path, | 280 OS::SNPrint(buffer, 2048, packages_path, |
281 executable_path, path_separator, path_separator); | 281 executable_path, path_separator, path_separator); |
282 bin::DartUtils::PrepareForScriptLoading(buffer, builtin_lib); | 282 bin::DartUtils::PrepareForScriptLoading(buffer, false, builtin_lib); |
283 } | 283 } |
284 | 284 |
285 BENCHMARK(Dart2JSCompileAll) { | 285 BENCHMARK(Dart2JSCompileAll) { |
286 bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary); | 286 bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary); |
287 bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary); | 287 bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary); |
288 SetupDart2JSPackagePath(); | 288 SetupDart2JSPackagePath(); |
289 char* dart_root = ComputeDart2JSPath(Benchmark::Executable()); | 289 char* dart_root = ComputeDart2JSPath(Benchmark::Executable()); |
290 char* script = NULL; | 290 char* script = NULL; |
291 if (dart_root != NULL) { | 291 if (dart_root != NULL) { |
292 Isolate* isolate = Isolate::Current(); | 292 Isolate* isolate = Isolate::Current(); |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 SnapshotReader reader(buffer, buffer_len, Snapshot::kMessage, isolate); | 585 SnapshotReader reader(buffer, buffer_len, Snapshot::kMessage, isolate); |
586 reader.ReadObject(); | 586 reader.ReadObject(); |
587 free(buffer); | 587 free(buffer); |
588 } | 588 } |
589 timer.Stop(); | 589 timer.Stop(); |
590 int64_t elapsed_time = timer.TotalElapsedTime(); | 590 int64_t elapsed_time = timer.TotalElapsedTime(); |
591 benchmark->set_score(elapsed_time); | 591 benchmark->set_score(elapsed_time); |
592 } | 592 } |
593 | 593 |
594 } // namespace dart | 594 } // namespace dart |
OLD | NEW |