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

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

Issue 6368009: ARM: Implement StringLength and StringCharCodeAt in the lithium-arm (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 9 years, 11 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/arm/macro-assembler-arm.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
index 1c35b682ef93b90f7c2fbf961eac5a42778192e2..0fc3f2541b57525d1406372b82a427c10276a623 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -2656,8 +2656,8 @@ void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
LStringCharCodeAt* instr_;
};
- DeferredStringCharCodeAt* deferred = new DeferredStringCharCodeAt(this,
- instr);
+ DeferredStringCharCodeAt* deferred
+ = new DeferredStringCharCodeAt(this, instr);
Register string = ToRegister(instr->string());
Register index = no_reg;
@@ -2710,26 +2710,29 @@ void LCodeGen::DoStringCharCodeAt(LStringCharCodeAt* instr) {
// 2-byte string.
// Load the 2-byte character code into the result register.
STATIC_ASSERT(kSmiTag == 0 && kSmiTagSize == 1);
- if (index.is_valid()) {
+ if (instr->index()->IsConstantOperand()) {
+ __ movzx_w(result,
+ FieldOperand(string,
+ SeqTwoByteString::kHeaderSize + 2 * const_index));
+ } else {
__ movzx_w(result, FieldOperand(string,
- index, times_2,
+ index,
+ times_2,
SeqTwoByteString::kHeaderSize));
- } else {
- __ movzx_w(result, FieldOperand(
- string, SeqTwoByteString::kHeaderSize + 2 * const_index));
}
__ jmp(&done);
// ASCII string.
// Load the byte into the result register.
__ bind(&ascii_string);
- if (index.is_valid()) {
+ if (instr->index()->IsConstantOperand()) {
__ movzx_b(result, FieldOperand(string,
- index, times_1,
- SeqAsciiString::kHeaderSize));
+ SeqAsciiString::kHeaderSize + const_index));
} else {
__ movzx_b(result, FieldOperand(string,
- SeqAsciiString::kHeaderSize + const_index));
+ index,
+ times_1,
+ SeqAsciiString::kHeaderSize));
}
__ bind(&done);
__ bind(deferred->exit());
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698