Index: runtime/vm/heap.cc |
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc |
index 20c79d72f021c5198814b4af4abb67c95881ebf0..4ff00802fd58ff3f9f8845c29ab441d81187b43c 100644 |
--- a/runtime/vm/heap.cc |
+++ b/runtime/vm/heap.cc |
@@ -16,6 +16,7 @@ |
#include "vm/raw_object.h" |
#include "vm/scavenger.h" |
#include "vm/service.h" |
+#include "vm/service_event.h" |
#include "vm/stack_frame.h" |
#include "vm/tags.h" |
#include "vm/verifier.h" |
@@ -620,8 +621,9 @@ void Heap::RecordAfterGC() { |
ASSERT(gc_in_progress_); |
gc_in_progress_ = false; |
if (Service::NeedsEvents()) { |
- GCEvent event(stats_); |
- Service::HandleGCEvent(&event); |
+ ServiceEvent event(Isolate::Current(), ServiceEvent::kGC); |
+ event.set_gc_stats(&stats_); |
+ Service::HandleEvent(&event); |
} |
} |
@@ -680,21 +682,6 @@ void Heap::PrintStats() { |
} |
-void GCEvent::PrintJSON(JSONStream* js) const { |
- Isolate* isolate = Isolate::Current(); |
- { |
- JSONObject jsobj(js); |
- jsobj.AddProperty("type", "ServiceEvent"); |
- jsobj.AddPropertyF("id", "gc/%" Pd, stats_.num_); |
- jsobj.AddProperty("eventType", "GC"); // TODO(koda): "GarbageCollected" |
- jsobj.AddProperty("isolate", isolate); |
- jsobj.AddProperty("reason", Heap::GCReasonToString(stats_.reason_)); |
- isolate->heap()->PrintToJSONObject(Heap::kNew, &jsobj); |
- isolate->heap()->PrintToJSONObject(Heap::kOld, &jsobj); |
- } |
-} |
- |
- |
#if defined(DEBUG) |
NoSafepointScope::NoSafepointScope() : StackResource(Isolate::Current()) { |
isolate()->IncrementNoSafepointScopeDepth(); |