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

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

Issue 172483002: A64: Fix int32 use in Lithium string functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix typo in assertion. Created 6 years, 10 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/codegen-a64.h ('k') | src/a64/lithium-codegen-a64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/codegen-a64.cc
diff --git a/src/a64/codegen-a64.cc b/src/a64/codegen-a64.cc
index 3f0e2295df5c014d0f60df57883b9fc84d3568ee..f0084947e049cf6d02346c75edecf0fdf091d767 100644
--- a/src/a64/codegen-a64.cc
+++ b/src/a64/codegen-a64.cc
@@ -410,6 +410,7 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm,
Register index,
Register result,
Label* call_runtime) {
+ ASSERT(string.Is64Bits() && index.Is32Bits() && result.Is64Bits());
// Fetch the instance type of the receiver into result register.
__ Ldr(result, FieldMemOperand(string, HeapObject::kMapOffset));
__ Ldrb(result, FieldMemOperand(result, Map::kInstanceTypeOffset));
@@ -424,10 +425,10 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm,
// Handle slices.
Label indirect_string_loaded;
- __ Ldrsw(result,
- UntagSmiFieldMemOperand(string, SlicedString::kOffsetOffset));
+ __ Ldr(result.W(),
+ UntagSmiFieldMemOperand(string, SlicedString::kOffsetOffset));
__ Ldr(string, FieldMemOperand(string, SlicedString::kParentOffset));
- __ Add(index, index, result);
+ __ Add(index, index, result.W());
__ B(&indirect_string_loaded);
// Handle cons strings.
@@ -479,11 +480,11 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm,
STATIC_ASSERT(kTwoByteStringTag == 0);
__ TestAndBranchIfAnySet(result, kStringEncodingMask, &ascii);
// Two-byte string.
- __ Ldrh(result, MemOperand(string, index, LSL, 1));
+ __ Ldrh(result, MemOperand(string, index, SXTW, 1));
__ B(&done);
__ Bind(&ascii);
// Ascii string.
- __ Ldrb(result, MemOperand(string, index));
+ __ Ldrb(result, MemOperand(string, index, SXTW));
__ Bind(&done);
}
« no previous file with comments | « src/a64/codegen-a64.h ('k') | src/a64/lithium-codegen-a64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698