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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 const int kNumIterations = 1000; | 60 const int kNumIterations = 1000; |
61 Timer timer(true, "CorelibIsolateStartup"); | 61 Timer timer(true, "CorelibIsolateStartup"); |
62 Isolate* isolate = Isolate::Current(); | 62 Isolate* isolate = Isolate::Current(); |
63 for (int i = 0; i < kNumIterations; i++) { | 63 for (int i = 0; i < kNumIterations; i++) { |
64 timer.Start(); | 64 timer.Start(); |
65 TestCase::CreateTestIsolate(); | 65 TestCase::CreateTestIsolate(); |
66 timer.Stop(); | 66 timer.Stop(); |
67 Dart_ShutdownIsolate(); | 67 Dart_ShutdownIsolate(); |
68 } | 68 } |
69 benchmark->set_score(timer.TotalElapsedTime() / kNumIterations); | 69 benchmark->set_score(timer.TotalElapsedTime() / kNumIterations); |
70 Isolate::SetCurrent(isolate); | 70 Thread::EnterIsolate(isolate); |
71 } | 71 } |
72 | 72 |
73 | 73 |
74 // | 74 // |
75 // Measure invocation of Dart API functions. | 75 // Measure invocation of Dart API functions. |
76 // | 76 // |
77 static void InitNativeFields(Dart_NativeArguments args) { | 77 static void InitNativeFields(Dart_NativeArguments args) { |
78 Dart_EnterScope(); | 78 Dart_EnterScope(); |
79 int count = Dart_GetNativeArgumentCount(args); | 79 int count = Dart_GetNativeArgumentCount(args); |
80 EXPECT_EQ(1, count); | 80 EXPECT_EQ(1, count); |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 zone.GetZone()); | 588 zone.GetZone()); |
589 reader.ReadObject(); | 589 reader.ReadObject(); |
590 free(buffer); | 590 free(buffer); |
591 } | 591 } |
592 timer.Stop(); | 592 timer.Stop(); |
593 int64_t elapsed_time = timer.TotalElapsedTime(); | 593 int64_t elapsed_time = timer.TotalElapsedTime(); |
594 benchmark->set_score(elapsed_time); | 594 benchmark->set_score(elapsed_time); |
595 } | 595 } |
596 | 596 |
597 } // namespace dart | 597 } // namespace dart |
OLD | NEW |