| Index: runtime/vm/heap.cc
|
| diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
|
| index d2f16159afb2e63da022d3d5fafdd49fb40ba368..9db0ad964a3b835ad6e1cadf47bdbbde80957455 100644
|
| --- a/runtime/vm/heap.cc
|
| +++ b/runtime/vm/heap.cc
|
| @@ -286,6 +286,21 @@ void Heap::Profile(Dart_FileWriteCallback callback, void* stream) const {
|
| }
|
|
|
|
|
| +void Heap::ProfileToFile(const char* filename) const {
|
| + Dart_FileOpenCallback file_open = Isolate::file_open_callback();
|
| + ASSERT(file_open != NULL);
|
| + Dart_FileWriteCallback file_write = Isolate::file_write_callback();
|
| + ASSERT(file_write != NULL);
|
| + Dart_FileCloseCallback file_close = Isolate::file_close_callback();
|
| + ASSERT(file_close != NULL);
|
| + void* file = (*file_open)(filename);
|
| + if (file != NULL) {
|
| + Profile(file_write, file);
|
| + (*file_close)(file);
|
| + }
|
| +}
|
| +
|
| +
|
| const char* Heap::GCReasonToString(GCReason gc_reason) {
|
| switch (gc_reason) {
|
| case kNewSpace:
|
|
|