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

Unified Diff: runtime/vm/object.cc

Issue 227423005: Add TraceBuffer log to all Functions (plus small tweaks to function-view) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 0bd36a0199cd97ddfc3270eabbfb256b16355a30..026030e42722f1d0a9b16b015008cb50742f8e6c 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -43,6 +43,7 @@
#include "vm/symbols.h"
#include "vm/tags.h"
#include "vm/timer.h"
+#include "vm/trace_buffer.h"
#include "vm/unicode.h"
namespace dart {
@@ -5889,6 +5890,7 @@ RawFunction* Function::New(const String& name,
result.set_is_optimizable(is_native ? false : true);
result.set_is_inlinable(true);
result.set_allows_hoisting_check_class(true);
+ result.set_log(new TraceBuffer());
if (kind == RawFunction::kClosureFunction) {
const ClosureData& data = ClosureData::Handle(ClosureData::New());
result.set_data(data);
@@ -5917,6 +5919,7 @@ RawFunction* Function::Clone(const Class& new_owner) const {
clone.set_deoptimization_counter(0);
clone.set_optimized_instruction_count(0);
clone.set_optimized_call_site_count(0);
+ clone.set_log(new TraceBuffer());
return clone.raw();
}
@@ -6450,10 +6453,12 @@ void Function::PrintToJSONStream(JSONStream* stream, bool ref) const {
jsobj.AddProperty("is_const", is_const());
jsobj.AddProperty("is_optimizable", is_optimizable());
jsobj.AddProperty("is_inlinable", IsInlineable());
- jsobj.AddProperty("unoptimized_code", Object::Handle(unoptimized_code()));
+ jsobj.AddProperty("code", Object::Handle(unoptimized_code()));
+ if (HasOptimizedCode()) {
+ jsobj.AddProperty("optimizedCode", Object::Handle(CurrentCode()));
+ }
jsobj.AddProperty("usage_counter", usage_counter());
jsobj.AddProperty("optimized_call_site_count", optimized_call_site_count());
- jsobj.AddProperty("code", Object::Handle(CurrentCode()));
jsobj.AddProperty("deoptimizations",
static_cast<intptr_t>(deoptimization_counter()));
@@ -6463,6 +6468,10 @@ void Function::PrintToJSONStream(JSONStream* stream, bool ref) const {
jsobj.AddProperty("tokenPos", token_pos());
jsobj.AddProperty("endTokenPos", end_token_pos());
}
+ if (log() != NULL) {
+ JSONObject l(&jsobj, "log");
+ log()->PrintToJSONObject(&l);
+ }
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698