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

Unified Diff: runtime/vm/assembler_mips.cc

Issue 13094015: Simplifies MIPS LoadWordFromPoolOffset (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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/assembler_mips.h ('k') | runtime/vm/instructions_mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assembler_mips.cc
===================================================================
--- runtime/vm/assembler_mips.cc (revision 20527)
+++ runtime/vm/assembler_mips.cc (working copy)
@@ -29,7 +29,7 @@
while (label->IsLinked()) {
const int32_t position = label->Position();
const int32_t next = buffer_.Load<int32_t>(position);
- // Reletive destination from an instruction after the branch.
+ // Relative destination from an instruction after the branch.
const int32_t dest = bound_pc - (position + Instr::kInstrSize);
const int32_t encoded = Assembler::EncodeBranchOffset(dest, next);
buffer_.Store<int32_t>(position, encoded);
@@ -62,22 +62,15 @@
if (Address::CanHoldOffset(offset)) {
lw(rd, Address(PP, offset));
} else {
- const uint16_t offset_low = Utils::Low16Bits(offset);
- const uint16_t offset_high = Utils::High16Bits(offset);
+ const int16_t offset_low = Utils::Low16Bits(offset); // Signed.
+ offset -= offset_low;
+ const uint16_t offset_high = Utils::High16Bits(offset); // Unsigned.
if (offset_high != 0) {
lui(rd, Immediate(offset_high));
- if (Address::CanHoldOffset(offset_low)) {
- addu(rd, rd, PP);
- lw(rd, Address(rd, offset_low));
- } else {
- ori(rd, rd, Immediate(offset_low));
- addu(rd, rd, PP);
- lw(rd, Address(rd));
- }
- } else {
- ori(rd, ZR, Immediate(offset_low));
addu(rd, rd, PP);
- lw(rd, Address(rd));
+ lw(rd, Address(rd, offset_low));
+ } else {
+ lw(rd, Address(PP, offset_low));
}
}
}
« no previous file with comments | « runtime/vm/assembler_mips.h ('k') | runtime/vm/instructions_mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698