Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index fdddef3f479a6eb3af46d21f3b98bb9e2d8877c0..3390aa6127275e35a96ed90452b6688f1331840f 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -580,6 +580,14 @@ LOperand* LChunkBuilder::UseOrConstantAtStart(HValue* value) { |
} |
+LOperand* LChunkBuilder::UseFixedOrConstant(HValue* value, |
+ Register fixed_register) { |
+ return CanBeImmediateConstant(value) |
+ ? chunk_->DefineConstantOperand(HConstant::cast(value)) |
+ : UseFixed(value, fixed_register); |
+} |
+ |
+ |
LOperand* LChunkBuilder::UseRegisterOrConstant(HValue* value) { |
return CanBeImmediateConstant(value) |
? chunk_->DefineConstantOperand(HConstant::cast(value)) |
@@ -1866,13 +1874,12 @@ LInstruction* LChunkBuilder::DoDateField(HDateField* instr) { |
LInstruction* LChunkBuilder::DoSeqStringSetChar(HSeqStringSetChar* instr) { |
- LOperand* string = UseRegister(instr->string()); |
- LOperand* index = UseRegister(instr->index()); |
- ASSERT(ecx.is_byte_register()); |
- LOperand* value = UseFixed(instr->value(), ecx); |
- LSeqStringSetChar* result = |
- new(zone()) LSeqStringSetChar(instr->encoding(), string, index, value); |
- return DefineSameAsFirst(result); |
+ LOperand* string = UseRegisterAtStart(instr->string()); |
+ LOperand* index = UseRegisterOrConstantAtStart(instr->index()); |
+ LOperand* value = (instr->encoding() == String::ONE_BYTE_ENCODING) |
+ ? UseFixedOrConstant(instr->value(), eax) |
Yang
2013/11/06 09:55:09
Why does this have to be fixed to eax, why not Use
Benedikt Meurer
2013/11/06 10:06:36
Because mov_b() requires a byte register.
|
+ : UseRegisterOrConstantAtStart(instr->value()); |
+ return new(zone()) LSeqStringSetChar(string, index, value); |
} |