Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index 4acbf7201799b93f429461a3d712fa89c3011671..ee4f5c66826a5a8ebe1ba50630e6ec58c17d7ac5 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -1778,6 +1778,27 @@ LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) { |
} |
+LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { |
+ HValue* value = instr->value(); |
+ Representation input_rep = value->representation(); |
+ if (input_rep.IsDouble()) { |
+ LOperand* reg = UseRegister(value); |
+ return DefineAsRegister(new LClampDoubleToUint8(reg)); |
+ } else if (input_rep.IsInteger32()) { |
+ LOperand* reg = UseFixed(value, eax); |
+ return DefineFixed(new LClampIToUint8(reg), eax); |
+ } else { |
+ ASSERT(input_rep.IsTagged()); |
+ LOperand* reg = UseFixed(value, eax); |
+ // Register allocator doesn't (yet) support allocation of double |
+ // temps. Reserve xmm1 explicitly. |
+ LOperand* temp = FixedTemp(xmm1); |
+ LClampTaggedToUint8* result = new LClampTaggedToUint8(reg, temp); |
+ return AssignEnvironment(DefineFixed(result, eax)); |
+ } |
+} |
+ |
+ |
LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { |
return new LReturn(UseFixed(instr->value(), eax)); |
} |
@@ -1988,14 +2009,6 @@ LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( |
LOperand* external_pointer = UseRegister(instr->external_pointer()); |
LOperand* key = UseRegisterOrConstant(instr->key()); |
LOperand* temp = NULL; |
- |
- if (array_type == kExternalPixelArray) { |
- // The generated code for pixel array stores requires that the clamped value |
- // is in a byte register. eax is an arbitrary choice to satisfy this |
- // requirement. |
- temp = FixedTemp(eax); |
- } |
- |
LOperand* val = NULL; |
if (array_type == kExternalByteArray || |
array_type == kExternalUnsignedByteArray) { |