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

Unified Diff: runtime/vm/locations.cc

Issue 513213002: Generate some intrinsics using our IR. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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
Index: runtime/vm/locations.cc
===================================================================
--- runtime/vm/locations.cc (revision 39726)
+++ runtime/vm/locations.cc (working copy)
@@ -121,24 +121,35 @@
Address Location::ToStackSlotAddress() const {
const intptr_t index = stack_index();
- if (index < 0) {
- const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize;
- return Address(FPREG, offset);
+ const Register base = base_reg();
+ if (base == FPREG) {
+ if (index < 0) {
+ const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize;
+ return Address(base, offset);
+ } else {
+ const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize;
+ return Address(base, offset);
+ }
} else {
- const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize;
- return Address(FPREG, offset);
+ ASSERT(base == SPREG);
+ return Address(base, index * kWordSize);
}
}
intptr_t Location::ToStackSlotOffset() const {
const intptr_t index = stack_index();
- if (index < 0) {
- const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize;
- return offset;
+ if (base_reg() == FPREG) {
+ if (index < 0) {
+ const intptr_t offset = (kParamEndSlotFromFp - index) * kWordSize;
+ return offset;
+ } else {
+ const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize;
+ return offset;
+ }
} else {
- const intptr_t offset = (kFirstLocalSlotFromFp - index) * kWordSize;
- return offset;
+ ASSERT(base_reg() == SPREG);
+ return index * kWordSize;
}
}

Powered by Google App Engine
This is Rietveld 408576698