| 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 } | 314 } |
| 315 | 315 |
| 316 // Get the information for the current isolate. | 316 // Get the information for the current isolate. |
| 317 // We only need to check the current isolate since all tasks are spawned | 317 // We only need to check the current isolate since all tasks are spawned |
| 318 // inside this single isolate. | 318 // inside this single isolate. |
| 319 JSONStream stream; | 319 JSONStream stream; |
| 320 isolate->PrintJSON(&stream, false); | 320 isolate->PrintJSON(&stream, false); |
| 321 const char* json = stream.ToCString(); | 321 const char* json = stream.ToCString(); |
| 322 | 322 |
| 323 Thread* current_thread = Thread::Current(); | 323 Thread* current_thread = Thread::Current(); |
| 324 { | |
| 325 StackZone stack_zone(current_thread); | |
| 326 char* isolate_info_buf = OS::SCreate(current_thread->zone(), | |
| 327 "\"_memoryHighWatermark\":" | |
| 328 "\"%" Pu "\"", | |
| 329 isolate->memory_high_watermark()); | |
| 330 EXPECT_SUBSTRING(isolate_info_buf, json); | |
| 331 } | |
| 332 | 324 |
| 333 // Confirm all expected entries are in the JSON output. | 325 // Confirm all expected entries are in the JSON output. |
| 334 for (intptr_t i = 0; i < kTaskCount + 1; i++) { | 326 for (intptr_t i = 0; i < kTaskCount + 1; i++) { |
| 335 Thread* thread = threads[i]; | 327 Thread* thread = threads[i]; |
| 336 Zone* top_zone = thread->zone(); | 328 Zone* top_zone = thread->zone(); |
| 337 | 329 |
| 338 StackZone stack_zone(current_thread); | 330 StackZone stack_zone(current_thread); |
| 339 Zone* current_zone = current_thread->zone(); | 331 Zone* current_zone = current_thread->zone(); |
| 340 | 332 |
| 341 // Check that all zones are present with correct sizes. | 333 // Check that all zones are present with correct sizes. |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 803 TransitionVMToBlocked transition(thread); | 795 TransitionVMToBlocked transition(thread); |
| 804 MonitorLocker ml(&done_monitor); | 796 MonitorLocker ml(&done_monitor); |
| 805 if (done) { | 797 if (done) { |
| 806 break; | 798 break; |
| 807 } | 799 } |
| 808 } | 800 } |
| 809 } | 801 } |
| 810 } | 802 } |
| 811 | 803 |
| 812 } // namespace dart | 804 } // namespace dart |
| OLD | NEW |