| 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/safepoint.h" | 10 #include "vm/safepoint.h" |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 328 |
| 329 Thread* current_thread = Thread::Current(); | 329 Thread* current_thread = Thread::Current(); |
| 330 StackZone stack_zone(current_thread); | 330 StackZone stack_zone(current_thread); |
| 331 Zone* current_zone = current_thread->zone(); | 331 Zone* current_zone = current_thread->zone(); |
| 332 | 332 |
| 333 // Check that all zones are present with correct sizes. | 333 // Check that all zones are present with correct sizes. |
| 334 while (top_zone != NULL) { | 334 while (top_zone != NULL) { |
| 335 char* zone_info_buf = | 335 char* zone_info_buf = |
| 336 OS::SCreate(current_zone, | 336 OS::SCreate(current_zone, |
| 337 "\"type\":\"_Zone\"," | 337 "\"type\":\"_Zone\"," |
| 338 "\"capacity\":%ld," | 338 "\"capacity\":%" Pd |
| 339 "\"used\":%ld", | 339 "," |
| 340 "\"used\":%" Pd "", |
| 340 top_zone->SizeInBytes(), top_zone->UsedSizeInBytes()); | 341 top_zone->SizeInBytes(), top_zone->UsedSizeInBytes()); |
| 341 EXPECT_SUBSTRING(zone_info_buf, json); | 342 EXPECT_SUBSTRING(zone_info_buf, json); |
| 342 top_zone = top_zone->previous(); | 343 top_zone = top_zone->previous(); |
| 343 } | 344 } |
| 344 | 345 |
| 345 // Check the thread exists and is the correct size. | 346 // Check the thread exists and is the correct size. |
| 346 char* thread_info_buf = OS::SCreate(current_zone, | 347 char* thread_info_buf = OS::SCreate( |
| 347 "\"type\":\"_Thread\"," | 348 current_zone, |
| 348 "\"id\":\"threads\\/%" Pd64 "", | 349 "\"type\":\"_Thread\"," |
| 349 thread->os_thread()->trace_id()); | 350 "\"id\":\"threads\\/%" Pd "", |
| 351 OSThread::ThreadIdToIntPtr(thread->os_thread()->trace_id())); |
| 350 | 352 |
| 351 // Ensure the isolate for each thread is valid. | 353 // Ensure the isolate for each thread is valid. |
| 352 | 354 |
| 353 char* isolate_info_buf = | 355 char* isolate_info_buf = |
| 354 OS::SCreate(current_zone, | 356 OS::SCreate(current_zone, |
| 355 "\"type\":\"Isolate\"," | 357 "\"type\":\"Isolate\"," |
| 356 "\"fixedId\":true," | 358 "\"fixedId\":true," |
| 357 "\"id\":\"isolates\\/%" Pd64 "", | 359 "\"id\":\"isolates\\/%" Pd64 "", |
| 358 static_cast<int64_t>(thread_isolate->main_port())); | 360 static_cast<int64_t>(thread_isolate->main_port())); |
| 359 | 361 |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 TransitionVMToBlocked transition(thread); | 800 TransitionVMToBlocked transition(thread); |
| 799 MonitorLocker ml(&done_monitor); | 801 MonitorLocker ml(&done_monitor); |
| 800 if (done) { | 802 if (done) { |
| 801 break; | 803 break; |
| 802 } | 804 } |
| 803 } | 805 } |
| 804 } | 806 } |
| 805 } | 807 } |
| 806 | 808 |
| 807 } // namespace dart | 809 } // namespace dart |
| OLD | NEW |