Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: runtime/vm/benchmark_test.cc

Issue 1041523002: Refactor Thread lifecycle interface, add Thread::Enter/ExitIsolate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/dart.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/dart.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698