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

Unified Diff: src/a64/lithium-codegen-a64.cc

Issue 197763006: A64: Relax the register constraints for LSeqStringGetChar. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « src/a64/lithium-a64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/lithium-codegen-a64.cc
diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc
index 4766fa55fd078d3ad2d902732094fec8dc38cc0e..ad0ccfe8153e51afeea0811c688d509214e867a6 100644
--- a/src/a64/lithium-codegen-a64.cc
+++ b/src/a64/lithium-codegen-a64.cc
@@ -4643,8 +4643,7 @@ MemOperand LCodeGen::BuildSeqStringOperand(Register string,
STATIC_ASSERT(kCharSize == 1);
return FieldMemOperand(string, SeqString::kHeaderSize + offset);
}
- ASSERT(!temp.is(string));
- ASSERT(!temp.is(ToRegister(index)));
+
if (encoding == String::ONE_BYTE_ENCODING) {
__ Add(temp, string, Operand(ToRegister32(index), SXTW));
} else {
@@ -4662,15 +4661,21 @@ void LCodeGen::DoSeqStringGetChar(LSeqStringGetChar* instr) {
Register temp = ToRegister(instr->temp());
if (FLAG_debug_code) {
- __ Ldr(temp, FieldMemOperand(string, HeapObject::kMapOffset));
- __ Ldrb(temp, FieldMemOperand(temp, Map::kInstanceTypeOffset));
+ // Even though this lithium instruction comes with a temp register, we
+ // can't use it here because we want to use "AtStart" constraints on the
+ // inputs and the debug code here needs a scratch register.
+ UseScratchRegisterScope temps(masm());
+ Register dbg_temp = temps.AcquireX();
+
+ __ Ldr(dbg_temp, FieldMemOperand(string, HeapObject::kMapOffset));
+ __ Ldrb(dbg_temp, FieldMemOperand(dbg_temp, Map::kInstanceTypeOffset));
- __ And(temp, temp,
+ __ And(dbg_temp, dbg_temp,
Operand(kStringRepresentationMask | kStringEncodingMask));
static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
- __ Cmp(temp, Operand(encoding == String::ONE_BYTE_ENCODING
- ? one_byte_seq_type : two_byte_seq_type));
+ __ Cmp(dbg_temp, Operand(encoding == String::ONE_BYTE_ENCODING
+ ? one_byte_seq_type : two_byte_seq_type));
__ Check(eq, kUnexpectedStringType);
}
« no previous file with comments | « src/a64/lithium-a64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698