OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/service.h" | 5 #include "vm/service.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
10 | 10 |
(...skipping 3459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3470 #endif // defined(DEBUG) | 3470 #endif // defined(DEBUG) |
3471 | 3471 |
3472 | 3472 |
3473 static const MethodParameter* get_heap_map_params[] = { | 3473 static const MethodParameter* get_heap_map_params[] = { |
3474 RUNNABLE_ISOLATE_PARAMETER, NULL, | 3474 RUNNABLE_ISOLATE_PARAMETER, NULL, |
3475 }; | 3475 }; |
3476 | 3476 |
3477 | 3477 |
3478 static bool GetHeapMap(Thread* thread, JSONStream* js) { | 3478 static bool GetHeapMap(Thread* thread, JSONStream* js) { |
3479 Isolate* isolate = thread->isolate(); | 3479 Isolate* isolate = thread->isolate(); |
| 3480 bool should_collect = false; |
| 3481 if (js->HasParam("gc")) { |
| 3482 if (js->ParamIs("gc", "full")) { |
| 3483 should_collect = true; |
| 3484 } else { |
| 3485 PrintInvalidParamError(js, "gc"); |
| 3486 return true; |
| 3487 } |
| 3488 } |
| 3489 if (should_collect) { |
| 3490 isolate->heap()->CollectAllGarbage(); |
| 3491 } |
3480 isolate->heap()->PrintHeapMapToJSONStream(isolate, js); | 3492 isolate->heap()->PrintHeapMapToJSONStream(isolate, js); |
3481 return true; | 3493 return true; |
3482 } | 3494 } |
3483 | 3495 |
3484 | 3496 |
3485 static const char* snapshot_roots_names[] = { | 3497 static const char* snapshot_roots_names[] = { |
3486 "User", "VM", NULL, | 3498 "User", "VM", NULL, |
3487 }; | 3499 }; |
3488 | 3500 |
3489 | 3501 |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4331 if (strcmp(method_name, method.name) == 0) { | 4343 if (strcmp(method_name, method.name) == 0) { |
4332 return &method; | 4344 return &method; |
4333 } | 4345 } |
4334 } | 4346 } |
4335 return NULL; | 4347 return NULL; |
4336 } | 4348 } |
4337 | 4349 |
4338 #endif // !PRODUCT | 4350 #endif // !PRODUCT |
4339 | 4351 |
4340 } // namespace dart | 4352 } // namespace dart |
OLD | NEW |