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

Unified Diff: src/a64/macro-assembler-a64.cc

Issue 141713009: A64: Port LSeqStringSetChar optimizations from r16707 and r17521. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: 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
« src/a64/macro-assembler-a64.h ('K') | « src/a64/macro-assembler-a64.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/macro-assembler-a64.cc
diff --git a/src/a64/macro-assembler-a64.cc b/src/a64/macro-assembler-a64.cc
index 685500306046946534f9938f066479752e7c99fe..f13ae64f847e6fcd84e65ea416c2f7edca98d8c8 100644
--- a/src/a64/macro-assembler-a64.cc
+++ b/src/a64/macro-assembler-a64.cc
@@ -3621,11 +3621,14 @@ void MacroAssembler::IndexFromHash(Register hash, Register index) {
void MacroAssembler::EmitSeqStringSetCharCheck(Register string,
Register index,
+ bool index_is_smi,
+ Register scratch,
uint32_t encoding_mask) {
- Register scratch = __ Tmp1();
ASSERT(!AreAliased(string, index, scratch));
- AssertSmi(index);
+ if (index_is_smi) {
+ AssertSmi(index);
+ }
// Check that string is an object.
ThrowIfSmi(string, kNonObject);
@@ -3633,13 +3636,13 @@ void MacroAssembler::EmitSeqStringSetCharCheck(Register string,
// Check that string has an appropriate map.
Ldr(scratch, FieldMemOperand(string, HeapObject::kMapOffset));
Ldrb(scratch, FieldMemOperand(scratch, Map::kInstanceTypeOffset));
+
And(scratch, scratch, kStringRepresentationMask | kStringEncodingMask);
Cmp(scratch, encoding_mask);
ThrowIf(ne, kUnexpectedStringType);
- // Check that the index points inside the string.
Ldr(scratch, FieldMemOperand(string, String::kLengthOffset));
- Cmp(index, scratch);
+ Cmp(index, index_is_smi ? scratch : Operand::UntagSmi(scratch));
ThrowIf(ge, kIndexIsTooLarge);
Cmp(index, Operand(Smi::FromInt(0)));
baptiste.afsa1 2014/02/06 15:48:13 Although it will work, it doesn't really make sens
ulan 2014/02/06 16:06:14 I added assert, but didn't add comment since the a
« src/a64/macro-assembler-a64.h ('K') | « src/a64/macro-assembler-a64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698