| 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 "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/isolate.h" | 6 #include "vm/isolate.h" |
| 7 #include "vm/lockers.h" | 7 #include "vm/lockers.h" |
| 8 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
| 9 #include "vm/profiler.h" | 9 #include "vm/profiler.h" |
| 10 #include "vm/thread_pool.h" | 10 #include "vm/thread_pool.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 // to get their verification done and exit. Use a specific UserTag | 351 // to get their verification done and exit. Use a specific UserTag |
| 352 // to enable the helpers to verify that the main thread is | 352 // to enable the helpers to verify that the main thread is |
| 353 // successfully interrupted in the pure Dart loop. | 353 // successfully interrupted in the pure Dart loop. |
| 354 #if defined(USING_SIMULATOR) | 354 #if defined(USING_SIMULATOR) |
| 355 const intptr_t kLoopCount = 12345678; | 355 const intptr_t kLoopCount = 12345678; |
| 356 #else | 356 #else |
| 357 const intptr_t kLoopCount = 1234567890; | 357 const intptr_t kLoopCount = 1234567890; |
| 358 #endif // USING_SIMULATOR | 358 #endif // USING_SIMULATOR |
| 359 char buffer[1024]; | 359 char buffer[1024]; |
| 360 OS::SNPrint(buffer, sizeof(buffer), | 360 OS::SNPrint(buffer, sizeof(buffer), |
| 361 "import 'dart:profiler';\n" | 361 "import 'dart:developer';\n" |
| 362 "int dummy = 0;\n" | 362 "int dummy = 0;\n" |
| 363 "main() {\n" | 363 "main() {\n" |
| 364 " new UserTag('foo').makeCurrent();\n" | 364 " new UserTag('foo').makeCurrent();\n" |
| 365 " for (dummy = 0; dummy < %" Pd "; ++dummy) {\n" | 365 " for (dummy = 0; dummy < %" Pd "; ++dummy) {\n" |
| 366 " dummy += (dummy & 1);\n" | 366 " dummy += (dummy & 1);\n" |
| 367 " }\n" | 367 " }\n" |
| 368 "}\n", kLoopCount); | 368 "}\n", kLoopCount); |
| 369 Dart_Handle lib = TestCase::LoadTestScript(buffer, NULL); | 369 Dart_Handle lib = TestCase::LoadTestScript(buffer, NULL); |
| 370 EXPECT_VALID(lib); | 370 EXPECT_VALID(lib); |
| 371 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); | 371 Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 isolate->thread_registry()->CheckSafepoint(); | 500 isolate->thread_registry()->CheckSafepoint(); |
| 501 MonitorLocker ml(&done_monitor); | 501 MonitorLocker ml(&done_monitor); |
| 502 if (done) { | 502 if (done) { |
| 503 break; | 503 break; |
| 504 } | 504 } |
| 505 } | 505 } |
| 506 } | 506 } |
| 507 } | 507 } |
| 508 | 508 |
| 509 } // namespace dart | 509 } // namespace dart |
| OLD | NEW |