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

Unified Diff: runtime/vm/object.cc

Issue 10832214: Move deopt reason into PcDescriptor so the EAX/RAX register is not destroyed. Some cleanups in PC d… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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/stub_code_ia32.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 10420)
+++ runtime/vm/object.cc (working copy)
@@ -6473,22 +6473,23 @@
intptr_t PcDescriptors::DeoptId(intptr_t index) const {
- return Smi::Value(*SmiAddr(index, kDeoptIdEntry));
+ return *(EntryAddr(index, kDeoptIdEntry));
}
void PcDescriptors::SetDeoptId(intptr_t index, intptr_t value) const {
- *SmiAddr(index, kDeoptIdEntry) = Smi::New(value);
+ *(EntryAddr(index, kDeoptIdEntry)) = value;
}
intptr_t PcDescriptors::TokenPos(intptr_t index) const {
- return Smi::Value(*SmiAddr(index, kTokenPosEntry));
+ ASSERT(DescriptorKind(index) != kDeoptIndex);
+ return *(EntryAddr(index, kTokenPosEntry));
}
void PcDescriptors::SetTokenPos(intptr_t index, intptr_t value) const {
- *SmiAddr(index, kTokenPosEntry) = Smi::New(value);
+ *(EntryAddr(index, kTokenPosEntry)) = value;
}
@@ -6498,14 +6499,20 @@
}
+void PcDescriptors::SetTryIndex(intptr_t index, intptr_t value) const {
+ *(EntryAddr(index, kTryIndexEntry)) = value;
+}
+
+
intptr_t PcDescriptors::DeoptIndex(intptr_t index) const {
ASSERT(DescriptorKind(index) == kDeoptIndex);
- return *(EntryAddr(index, kTryIndexEntry));
+ return *(EntryAddr(index, kDeoptIndexEntry));
}
-void PcDescriptors::SetTryIndex(intptr_t index, intptr_t value) const {
- *(EntryAddr(index, kTryIndexEntry)) = value;
+intptr_t PcDescriptors::DeoptReason(intptr_t index) const {
+ ASSERT(DescriptorKind(index) == kDeoptIndex);
+ return *(EntryAddr(index, kDeoptReasonEntry));
}
@@ -6554,20 +6561,32 @@
// First compute the buffer size required.
intptr_t len = 1; // Trailing '\0'.
for (intptr_t i = 0; i < Length(); i++) {
- const intptr_t multi_purpose_index = DescriptorKind(i) == kDeoptIndex ?
+ intptr_t token_pos_or_deopt_reason = DescriptorKind(i) == kDeoptIndex ?
+ DeoptReason(i) : TokenPos(i);
+ intptr_t multi_purpose_index = DescriptorKind(i) == kDeoptIndex ?
DeoptIndex(i) : TryIndex(i);
len += OS::SNPrint(NULL, 0, kFormat,
- PC(i), KindAsStr(i), DeoptId(i), TokenPos(i), multi_purpose_index);
+ PC(i),
+ KindAsStr(i),
+ DeoptId(i),
+ token_pos_or_deopt_reason,
+ multi_purpose_index);
}
// Allocate the buffer.
char* buffer = Isolate::Current()->current_zone()->Alloc<char>(len);
// Layout the fields in the buffer.
intptr_t index = 0;
for (intptr_t i = 0; i < Length(); i++) {
- const intptr_t multi_purpose_index = DescriptorKind(i) == kDeoptIndex ?
+ intptr_t token_pos_or_deopt_reason = DescriptorKind(i) == kDeoptIndex ?
+ DeoptReason(i) : TokenPos(i);
+ intptr_t multi_purpose_index = DescriptorKind(i) == kDeoptIndex ?
DeoptIndex(i) : TryIndex(i);
index += OS::SNPrint((buffer + index), (len - index), kFormat,
- PC(i), KindAsStr(i), DeoptId(i), TokenPos(i), multi_purpose_index);
+ PC(i),
+ KindAsStr(i),
+ DeoptId(i),
+ token_pos_or_deopt_reason,
+ multi_purpose_index);
}
return buffer;
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698