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

Unified Diff: runtime/vm/object.cc

Issue 817823002: Add inlining ranges/intervals to code objects so that we can map a pc to the inlined stack. The map… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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
===================================================================
--- runtime/vm/object.cc (revision 42521)
+++ runtime/vm/object.cc (working copy)
@@ -12257,10 +12257,9 @@
const Instructions& instr = Instructions::Handle(instructions());
uword start = instr.EntryPoint();
if (formatter == NULL) {
- Disassembler::Disassemble(start, start + instr.size(), comments());
+ Disassembler::Disassemble(start, start + instr.size(), *this);
} else {
- Disassembler::Disassemble(start, start + instr.size(), formatter,
- comments());
+ Disassembler::Disassemble(start, start + instr.size(), formatter, *this);
}
if (fix_patch) {
// Redo the patch.
@@ -12281,6 +12280,12 @@
}
+void Code::set_inlined_intervals(const Array& value) const {
+ ASSERT(value.IsOld());
+ StorePointer(&raw_ptr()->inlined_intervals_, value.raw());
+}
+
+
RawCode* Code::New(intptr_t pointer_offsets_length) {
if (pointer_offsets_length < 0 || pointer_offsets_length > kMaxElements) {
// This should be caught before we reach here.
@@ -12631,6 +12636,44 @@
}
+void Code::GetInlinedFunctionsAt(
+ intptr_t offset, GrowableArray<Function*>* fs) const {
+ fs->Clear();
+ const Array& intervals = Array::Handle(inlined_intervals());
+ Smi& start = Smi::Handle();
+ Smi& end = Smi::Handle();
+ Function& function = Function::Handle();
+ for (intptr_t i = 0; i < intervals.Length(); i += Code::kInlIntNumEntries) {
+ start ^= intervals.At(i + Code::kInlIntStart);
+ if (!start.IsNull()) {
+ end ^= intervals.At(i + Code::kInlIntEnd);
+ if ((start.Value() <= offset) && (offset < end.Value())) {
+ function ^= intervals.At(i + Code::kInlIntFunction);
+ fs->Add(&Function::ZoneHandle(function.raw()));
+ }
+ }
+ }
+}
+
+
+void Code::DumpInlinedIntervals() const {
+ OS::Print("Inlined intervals:\n");
+ const Array& intervals = Array::Handle(inlined_intervals());
+ Smi& start = Smi::Handle();
+ Smi& end = Smi::Handle();
+ Function& function = Function::Handle();
+ for (intptr_t i = 0; i < intervals.Length(); i += Code::kInlIntNumEntries) {
+ start ^= intervals.At(i + Code::kInlIntStart);
+ if (!start.IsNull()) {
+ end ^= intervals.At(i + Code::kInlIntEnd);
+ function ^= intervals.At(i + Code::kInlIntFunction);
+ OS::Print("%" Pd " .. %" Pd " %s\n",
+ start.Value(), end.Value(), function.ToQualifiedCString());
+ }
+ }
+}
+
+
RawContext* Context::New(intptr_t num_variables, Heap::Space space) {
ASSERT(num_variables >= 0);
ASSERT(Object::context_class() != Class::null());
« 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