Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index cafde512246b5a81f6f21e2b39e5ff04724ddc92..ba8ccc5cc995ceade12a62eb68048aa4b5a0d726 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -1732,17 +1732,14 @@ void LCodeGen::DoSeqStringSetChar(LSeqStringSetChar* instr) { |
Register string = ToRegister(instr->string()); |
if (FLAG_debug_code) { |
- __ push(string); |
- __ movq(string, FieldOperand(string, HeapObject::kMapOffset)); |
- __ movzxbq(string, FieldOperand(string, Map::kInstanceTypeOffset)); |
- |
- __ andb(string, Immediate(kStringRepresentationMask | kStringEncodingMask)); |
+ Register value = ToRegister(instr->value()); |
+ 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; |
- __ cmpq(string, Immediate(encoding == String::ONE_BYTE_ENCODING |
- ? one_byte_seq_type : two_byte_seq_type)); |
- __ Check(equal, kUnexpectedStringType); |
- __ pop(string); |
+ int encoding_mask = |
+ instr->hydrogen()->encoding() == String::ONE_BYTE_ENCODING |
+ ? one_byte_seq_type : two_byte_seq_type; |
+ __ EmitSeqStringSetCharCheck(string, index, value, encoding_mask); |
} |
Operand operand = BuildSeqStringOperand(string, instr->index(), encoding); |