Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: runtime/vm/heap.cc

Issue 1093043004: Do not JSON encode the 'result' of a service rpc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/json_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698