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

Unified Diff: runtime/vm/object.cc

Issue 197803004: Add dead CodeRegionTable for tracking overwritten Dart code (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/profiler.cc » ('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 b21541259bf1ea245d6af70f56172bf9c45605f0..a71f4941a8f829ae7e1176319f419fb820196b46 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -10392,6 +10392,24 @@ RawCode* Code::LookupCodeInVmIsolate(uword pc) {
}
+// Given a pc and a timestamp, lookup the code.
+RawCode* Code::FindCode(uword pc, int64_t timestamp) {
+ Code& code = Code::Handle(Code::LookupCode(pc));
+ if (!code.IsNull() && (code.compile_timestamp() == timestamp) &&
+ (code.EntryPoint() == pc)) {
+ // Found code in isolate.
+ return code.raw();
+ }
+ code ^= Code::LookupCodeInVmIsolate(pc);
+ if (!code.IsNull() && (code.compile_timestamp() == timestamp) &&
+ (code.EntryPoint() == pc)) {
+ // Found code in VM isolate.
+ return code.raw();
+ }
+ return Code::null();
+}
+
+
intptr_t Code::GetTokenIndexOfPC(uword pc) const {
intptr_t token_pos = -1;
const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors());
@@ -10485,11 +10503,13 @@ RawString* Code::UserName() const {
void Code::PrintToJSONStream(JSONStream* stream, bool ref) const {
JSONObject jsobj(stream);
jsobj.AddProperty("type", JSONType(ref));
- jsobj.AddPropertyF("id", "code/%" Px "", EntryPoint());
+ jsobj.AddPropertyF("id", "code/%" Px64"-%" Px "", compile_timestamp(),
+ EntryPoint());
jsobj.AddPropertyF("start", "%" Px "", EntryPoint());
jsobj.AddPropertyF("end", "%" Px "", EntryPoint() + Size());
jsobj.AddProperty("is_optimized", is_optimized());
jsobj.AddProperty("is_alive", is_alive());
+ jsobj.AddProperty("kind", "Dart");
const String& name = String::Handle(Name());
const String& user_name = String::Handle(UserName());
const char* name_prefix = is_optimized() ? "*" : "";
@@ -10503,7 +10523,7 @@ void Code::PrintToJSONStream(JSONStream* stream, bool ref) const {
JSONObject func(&jsobj, "function");
func.AddProperty("type", "@Function");
func.AddProperty("kind", "Stub");
- func.AddPropertyF("id", "stub/functions/%" Pd "", EntryPoint());
+ func.AddPropertyF("id", "functions/stub-%" Pd "", EntryPoint());
func.AddProperty("user_name", user_name.ToCString());
func.AddProperty("name", name.ToCString());
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698