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

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

Issue 15085026: ARM: Smi refactoring and improvements. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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: src/arm/codegen-arm.cc
diff --git a/src/arm/codegen-arm.cc b/src/arm/codegen-arm.cc
index 9d773d4cc35d912120787eaa26f67ad91a19c974..7bf253a333315be948cc1125b42da7ce646b9ff2 100644
--- a/src/arm/codegen-arm.cc
+++ b/src/arm/codegen-arm.cc
@@ -440,7 +440,7 @@ void StringCharLoadGenerator::Generate(MacroAssembler* masm,
Label indirect_string_loaded;
__ ldr(result, FieldMemOperand(string, SlicedString::kOffsetOffset));
__ ldr(string, FieldMemOperand(string, SlicedString::kParentOffset));
- __ add(index, index, Operand(result, ASR, kSmiTagSize));
+ __ add(index, index, Operand::SmiUntag(result));
__ jmp(&indirect_string_loaded);
// Handle cons strings.
@@ -510,9 +510,9 @@ void SeqStringSetCharGenerator::Generate(MacroAssembler* masm,
Register index,
Register value) {
if (FLAG_debug_code) {
- __ tst(index, Operand(kSmiTagMask));
+ __ SmiTst(index);
__ Check(eq, "Non-smi index");
- __ tst(value, Operand(kSmiTagMask));
+ __ SmiTst(value);
__ Check(eq, "Non-smi value");
__ ldr(ip, FieldMemOperand(string, String::kLengthOffset));
@@ -540,10 +540,10 @@ void SeqStringSetCharGenerator::Generate(MacroAssembler* masm,
STATIC_ASSERT(kSmiTagSize == 1 && kSmiTag == 0);
if (encoding == String::ONE_BYTE_ENCODING) {
// Smis are tagged by left shift by 1, thus LSR by 1 to smi-untag inline.
- __ strb(value, MemOperand(ip, index, LSR, 1));
+ __ strb(value, MemOperand(ip, index, LSR, kSmiTagSize));
} else {
// No need to untag a smi for two-byte addressing.
- __ strh(value, MemOperand(ip, index));
+ __ strh(value, MemOperand(ip, index)); // LSL(1 - kSmiTagSize).
}
}
« no previous file with comments | « src/arm/code-stubs-arm.cc ('k') | src/arm/debug-arm.cc » ('j') | src/arm/macro-assembler-arm.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698