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

Unified Diff: src/a64/lithium-codegen-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: Use enum instead of bool 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/full-codegen-a64.cc ('k') | src/a64/macro-assembler-a64.h » ('j') | 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 0756ff9883d8c21afecf843de56b6982c5b25178..2d48c10924f803a77007167d869b76e11d90746b 100644
--- a/src/a64/lithium-codegen-a64.cc
+++ b/src/a64/lithium-codegen-a64.cc
@@ -4522,30 +4522,27 @@ void LCodeGen::DoSeqStringGetChar(LSeqStringGetChar* instr) {
void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) {
- // TODO(all): Port ARM optimizations from r16707.
-
String::Encoding encoding = instr->encoding();
Register string = ToRegister(instr->string());
- Register index = ToRegister(instr->index());
Register value = ToRegister(instr->value());
Register temp = ToRegister(instr->temp());
if (FLAG_debug_code) {
- if (encoding == String::ONE_BYTE_ENCODING) {
- __ EmitSeqStringSetCharCheck(
- string, index, kSeqStringTag | kOneByteStringTag);
- } else {
- ASSERT(encoding == String::TWO_BYTE_ENCODING);
- __ EmitSeqStringSetCharCheck(
- string, index, kSeqStringTag | kTwoByteStringTag);
- }
+ Register index = ToRegister(instr->index());
+ static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag;
+ static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag;
+ int encoding_mask =
+ instr->hydrogen()->encoding() == String::ONE_BYTE_ENCODING
+ ? one_byte_seq_type : two_byte_seq_type;
+ __ EmitSeqStringSetCharCheck(string, index, kIndexIsInteger32, temp,
+ encoding_mask);
}
-
- __ Add(temp, string, SeqString::kHeaderSize - kHeapObjectTag);
+ MemOperand operand =
+ BuildSeqStringOperand(string, temp, instr->index(), encoding);
if (encoding == String::ONE_BYTE_ENCODING) {
- __ Strb(value, MemOperand(temp, index));
+ __ Strb(value, operand);
} else {
- __ Strh(value, MemOperand(temp, index, LSL, 1));
+ __ Strh(value, operand);
}
}
« no previous file with comments | « src/a64/full-codegen-a64.cc ('k') | src/a64/macro-assembler-a64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698