Index: src/mips/full-codegen-mips.cc |
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc |
index 1859bc8852f806b51e2e8f14db0bfa294153d916..9d93aafb9d6aed3b8148de70d9ddae680b0f899f 100644 |
--- a/src/mips/full-codegen-mips.cc |
+++ b/src/mips/full-codegen-mips.cc |
@@ -3516,29 +3516,6 @@ void FullCodeGenerator::EmitDateField(CallRuntime* expr) { |
} |
-void FullCodeGenerator::EmitSeqStringSetCharCheck(Register string, |
- Register index, |
- Register value, |
- uint32_t encoding_mask) { |
- __ And(at, index, Operand(kSmiTagMask)); |
- __ Check(eq, kNonSmiIndex, at, Operand(zero_reg)); |
- __ And(at, value, Operand(kSmiTagMask)); |
- __ Check(eq, kNonSmiValue, at, Operand(zero_reg)); |
- |
- __ lw(at, FieldMemOperand(string, String::kLengthOffset)); |
- __ Check(lt, kIndexIsTooLarge, index, Operand(at)); |
- |
- __ Check(ge, kIndexIsNegative, index, Operand(zero_reg)); |
- |
- __ lw(at, FieldMemOperand(string, HeapObject::kMapOffset)); |
- __ lbu(at, FieldMemOperand(at, Map::kInstanceTypeOffset)); |
- |
- __ And(at, at, Operand(kStringRepresentationMask | kStringEncodingMask)); |
- __ Subu(at, at, Operand(encoding_mask)); |
- __ Check(eq, kUnexpectedStringType, at, Operand(zero_reg)); |
-} |
- |
- |
void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { |
ZoneList<Expression*>* args = expr->arguments(); |
ASSERT_EQ(3, args->length()); |
@@ -3553,8 +3530,16 @@ void FullCodeGenerator::EmitOneByteSeqStringSetChar(CallRuntime* expr) { |
__ Pop(index, value); |
if (FLAG_debug_code) { |
+ __ And(at, value, Operand(kSmiTagMask)); |
+ __ ThrowIf(ne, kNonSmiValue, at, Operand(zero_reg)); |
+ __ And(at, index, Operand(kSmiTagMask)); |
+ __ ThrowIf(ne, kNonSmiIndex, at, Operand(zero_reg)); |
+ __ SmiUntag(index, index); |
static const uint32_t one_byte_seq_type = kSeqStringTag | kOneByteStringTag; |
- EmitSeqStringSetCharCheck(string, index, value, one_byte_seq_type); |
+ Register scratch = t5; |
+ __ EmitSeqStringSetCharCheck( |
+ string, index, value, scratch, one_byte_seq_type); |
+ __ SmiTag(index, index); |
} |
__ SmiUntag(value, value); |
@@ -3582,8 +3567,16 @@ void FullCodeGenerator::EmitTwoByteSeqStringSetChar(CallRuntime* expr) { |
__ Pop(index, value); |
if (FLAG_debug_code) { |
+ __ And(at, value, Operand(kSmiTagMask)); |
+ __ ThrowIf(ne, kNonSmiValue, at, Operand(zero_reg)); |
+ __ And(at, index, Operand(kSmiTagMask)); |
+ __ ThrowIf(ne, kNonSmiIndex, at, Operand(zero_reg)); |
+ __ SmiUntag(index, index); |
static const uint32_t two_byte_seq_type = kSeqStringTag | kTwoByteStringTag; |
- EmitSeqStringSetCharCheck(string, index, value, two_byte_seq_type); |
+ Register scratch = t5; |
+ __ EmitSeqStringSetCharCheck( |
+ string, index, value, scratch, two_byte_seq_type); |
+ __ SmiTag(index, index); |
} |
__ SmiUntag(value, value); |