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

Unified Diff: runtime/vm/object.cc

Issue 875443002: Store pc offset instead of absolute pc in the pc descriptors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed arm/mips/arm64 build Created 5 years, 11 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/object_test.cc » ('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 43041)
+++ runtime/vm/object.cc (working copy)
@@ -10647,7 +10647,7 @@
Iterator iter(*this, RawPcDescriptors::kAnyKind);
while (iter.MoveNext()) {
len += OS::SNPrint(NULL, 0, kFormat, addr_width,
- iter.Pc(),
+ iter.PcOffset(),
KindAsStr(iter.Kind()),
iter.DeoptId(),
iter.TokenPos(),
@@ -10661,7 +10661,7 @@
Iterator iter(*this, RawPcDescriptors::kAnyKind);
while (iter.MoveNext()) {
index += OS::SNPrint((buffer + index), (len - index), kFormat, addr_width,
- iter.Pc(),
+ iter.PcOffset(),
KindAsStr(iter.Kind()),
iter.DeoptId(),
iter.TokenPos(),
@@ -10688,7 +10688,7 @@
Iterator iter(*this, RawPcDescriptors::kAnyKind);
while (iter.MoveNext()) {
JSONObject descriptor(&members);
- descriptor.AddPropertyF("pc", "%" Px "", iter.Pc());
+ descriptor.AddPropertyF("pc_offset", "%" Px "", iter.PcOffset());
descriptor.AddProperty("kind", KindAsStr(iter.Kind()));
descriptor.AddProperty("deoptId", iter.DeoptId());
descriptor.AddProperty("tokenPos", iter.TokenPos());
@@ -10743,15 +10743,6 @@
}
-uword PcDescriptors::GetPcForKind(RawPcDescriptors::Kind kind) const {
- Iterator iter(*this, kind);
- if (iter.MoveNext()) {
- return iter.Pc();
- }
- return 0;
-}
-
-
bool Stackmap::GetBit(intptr_t bit_index) const {
ASSERT(InRange(bit_index));
int byte_index = bit_index >> kBitsPerByteLog2;
@@ -12439,10 +12430,11 @@
intptr_t Code::GetTokenIndexOfPC(uword pc) const {
+ uword pc_offset = pc - EntryPoint();
const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors());
PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind);
while (iter.MoveNext()) {
- if (iter.Pc() == pc) {
+ if (iter.PcOffset() == pc_offset) {
return iter.TokenPos();
}
}
@@ -12456,7 +12448,8 @@
PcDescriptors::Iterator iter(descriptors, kind);
while (iter.MoveNext()) {
if (iter.DeoptId() == deopt_id) {
- uword pc = iter.Pc();
+ uword pc_offset = iter.PcOffset();
+ uword pc = EntryPoint() + pc_offset;
ASSERT(ContainsInstructionAt(pc));
return pc;
}
@@ -12466,10 +12459,11 @@
intptr_t Code::GetDeoptIdForOsr(uword pc) const {
+ uword pc_offset = pc - EntryPoint();
const PcDescriptors& descriptors = PcDescriptors::Handle(pc_descriptors());
PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kOsrEntry);
while (iter.MoveNext()) {
- if (iter.Pc() == pc) {
+ if (iter.PcOffset() == pc_offset) {
return iter.DeoptId();
}
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698