OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1771 } | 1771 } |
1772 | 1772 |
1773 | 1773 |
1774 LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) { | 1774 LInstruction* LChunkBuilder::DoCheckMap(HCheckMap* instr) { |
1775 LOperand* value = UseRegisterAtStart(instr->value()); | 1775 LOperand* value = UseRegisterAtStart(instr->value()); |
1776 LCheckMap* result = new LCheckMap(value); | 1776 LCheckMap* result = new LCheckMap(value); |
1777 return AssignEnvironment(result); | 1777 return AssignEnvironment(result); |
1778 } | 1778 } |
1779 | 1779 |
1780 | 1780 |
| 1781 LInstruction* LChunkBuilder::DoClampToUint8(HClampToUint8* instr) { |
| 1782 HValue* value = instr->value(); |
| 1783 Representation rep = value->representation(); |
| 1784 if (rep.IsDouble()) { |
| 1785 LOperand* reg = UseRegister(value); |
| 1786 return DefineAsRegister(new LClampDoubleToUint8(reg)); |
| 1787 } else if (rep.IsInteger32()) { |
| 1788 LOperand* reg = UseFixed(value, eax); |
| 1789 return DefineFixed(new LClampIToUint8(reg), eax); |
| 1790 } else { |
| 1791 ASSERT(rep.IsTagged()); |
| 1792 LOperand* reg = UseFixed(value, eax); |
| 1793 LOperand* temp = FixedTemp(xmm1); |
| 1794 LClampTaggedToUint8* result = new LClampTaggedToUint8(reg, temp); |
| 1795 return AssignEnvironment(DefineFixed(result, eax)); |
| 1796 } |
| 1797 } |
| 1798 |
| 1799 |
1781 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { | 1800 LInstruction* LChunkBuilder::DoReturn(HReturn* instr) { |
1782 return new LReturn(UseFixed(instr->value(), eax)); | 1801 return new LReturn(UseFixed(instr->value(), eax)); |
1783 } | 1802 } |
1784 | 1803 |
1785 | 1804 |
1786 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { | 1805 LInstruction* LChunkBuilder::DoConstant(HConstant* instr) { |
1787 Representation r = instr->representation(); | 1806 Representation r = instr->representation(); |
1788 if (r.IsInteger32()) { | 1807 if (r.IsInteger32()) { |
1789 return DefineAsRegister(new LConstantI); | 1808 return DefineAsRegister(new LConstantI); |
1790 } else if (r.IsDouble()) { | 1809 } else if (r.IsDouble()) { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1981 (representation.IsInteger32() && (array_type != kExternalFloatArray && | 2000 (representation.IsInteger32() && (array_type != kExternalFloatArray && |
1982 array_type != kExternalDoubleArray)) || | 2001 array_type != kExternalDoubleArray)) || |
1983 (representation.IsDouble() && (array_type == kExternalFloatArray || | 2002 (representation.IsDouble() && (array_type == kExternalFloatArray || |
1984 array_type == kExternalDoubleArray))); | 2003 array_type == kExternalDoubleArray))); |
1985 ASSERT(instr->external_pointer()->representation().IsExternal()); | 2004 ASSERT(instr->external_pointer()->representation().IsExternal()); |
1986 ASSERT(instr->key()->representation().IsInteger32()); | 2005 ASSERT(instr->key()->representation().IsInteger32()); |
1987 | 2006 |
1988 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 2007 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
1989 LOperand* key = UseRegisterOrConstant(instr->key()); | 2008 LOperand* key = UseRegisterOrConstant(instr->key()); |
1990 LOperand* temp = NULL; | 2009 LOperand* temp = NULL; |
1991 | |
1992 if (array_type == kExternalPixelArray) { | |
1993 // The generated code for pixel array stores requires that the clamped value | |
1994 // is in a byte register. eax is an arbitrary choice to satisfy this | |
1995 // requirement. | |
1996 temp = FixedTemp(eax); | |
1997 } | |
1998 | |
1999 LOperand* val = NULL; | 2010 LOperand* val = NULL; |
2000 if (array_type == kExternalByteArray || | 2011 if (array_type == kExternalByteArray || |
2001 array_type == kExternalUnsignedByteArray) { | 2012 array_type == kExternalUnsignedByteArray) { |
2002 // We need a byte register in this case for the value. | 2013 // We need a byte register in this case for the value. |
2003 val = UseFixed(instr->value(), eax); | 2014 val = UseFixed(instr->value(), eax); |
2004 } else { | 2015 } else { |
2005 val = UseRegister(instr->value()); | 2016 val = UseRegister(instr->value()); |
2006 } | 2017 } |
2007 | 2018 |
2008 return new LStoreKeyedSpecializedArrayElement(external_pointer, | 2019 return new LStoreKeyedSpecializedArrayElement(external_pointer, |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2245 LOperand* key = UseOrConstantAtStart(instr->key()); | 2256 LOperand* key = UseOrConstantAtStart(instr->key()); |
2246 LOperand* object = UseOrConstantAtStart(instr->object()); | 2257 LOperand* object = UseOrConstantAtStart(instr->object()); |
2247 LIn* result = new LIn(key, object); | 2258 LIn* result = new LIn(key, object); |
2248 return MarkAsCall(DefineFixed(result, eax), instr); | 2259 return MarkAsCall(DefineFixed(result, eax), instr); |
2249 } | 2260 } |
2250 | 2261 |
2251 | 2262 |
2252 } } // namespace v8::internal | 2263 } } // namespace v8::internal |
2253 | 2264 |
2254 #endif // V8_TARGET_ARCH_IA32 | 2265 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |