OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1995 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 1995 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
1996 LLoadKeyedFastDoubleElement* result = | 1996 LLoadKeyedFastDoubleElement* result = |
1997 new(zone()) LLoadKeyedFastDoubleElement(elements, key); | 1997 new(zone()) LLoadKeyedFastDoubleElement(elements, key); |
1998 return AssignEnvironment(DefineAsRegister(result)); | 1998 return AssignEnvironment(DefineAsRegister(result)); |
1999 } | 1999 } |
2000 | 2000 |
2001 | 2001 |
2002 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( | 2002 LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( |
2003 HLoadKeyedSpecializedArrayElement* instr) { | 2003 HLoadKeyedSpecializedArrayElement* instr) { |
2004 ElementsKind elements_kind = instr->elements_kind(); | 2004 ElementsKind elements_kind = instr->elements_kind(); |
2005 Representation representation(instr->representation()); | |
2006 ASSERT( | 2005 ASSERT( |
2007 (representation.IsInteger32() && | 2006 (instr->representation().IsInteger32() && |
2008 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && | 2007 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
2009 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || | 2008 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
2010 (representation.IsDouble() && | 2009 (instr->representation().IsDouble() && |
2011 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || | 2010 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
2012 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); | 2011 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
2013 ASSERT(instr->key()->representation().IsInteger32()); | 2012 ASSERT(instr->key()->representation().IsInteger32()); |
2014 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 2013 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
2015 LOperand* key = UseRegisterOrConstant(instr->key()); | 2014 LOperand* key = UseRegisterOrConstant(instr->key()); |
2016 LLoadKeyedSpecializedArrayElement* result = | 2015 LLoadKeyedSpecializedArrayElement* result = |
2017 new(zone()) LLoadKeyedSpecializedArrayElement(external_pointer, | 2016 new(zone()) LLoadKeyedSpecializedArrayElement(external_pointer, |
2018 key); | 2017 key); |
2019 LInstruction* load_instr = DefineAsRegister(result); | 2018 LInstruction* load_instr = DefineAsRegister(result); |
2020 // An unsigned int array load might overflow and cause a deopt, make sure it | 2019 // An unsigned int array load might overflow and cause a deopt, make sure it |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2063 LOperand* elements = UseRegisterAtStart(instr->elements()); | 2062 LOperand* elements = UseRegisterAtStart(instr->elements()); |
2064 LOperand* val = UseTempRegister(instr->value()); | 2063 LOperand* val = UseTempRegister(instr->value()); |
2065 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 2064 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
2066 | 2065 |
2067 return new(zone()) LStoreKeyedFastDoubleElement(elements, key, val); | 2066 return new(zone()) LStoreKeyedFastDoubleElement(elements, key, val); |
2068 } | 2067 } |
2069 | 2068 |
2070 | 2069 |
2071 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( | 2070 LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( |
2072 HStoreKeyedSpecializedArrayElement* instr) { | 2071 HStoreKeyedSpecializedArrayElement* instr) { |
2073 Representation representation(instr->value()->representation()); | |
2074 ElementsKind elements_kind = instr->elements_kind(); | 2072 ElementsKind elements_kind = instr->elements_kind(); |
2075 ASSERT( | 2073 ASSERT( |
2076 (representation.IsInteger32() && | 2074 (instr->value()->representation().IsInteger32() && |
2077 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && | 2075 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
2078 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || | 2076 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
2079 (representation.IsDouble() && | 2077 (instr->value()->representation().IsDouble() && |
2080 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || | 2078 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
2081 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); | 2079 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
2082 ASSERT(instr->external_pointer()->representation().IsExternal()); | 2080 ASSERT(instr->external_pointer()->representation().IsExternal()); |
2083 ASSERT(instr->key()->representation().IsInteger32()); | 2081 ASSERT(instr->key()->representation().IsInteger32()); |
2084 | 2082 |
2085 LOperand* external_pointer = UseRegister(instr->external_pointer()); | 2083 LOperand* external_pointer = UseRegister(instr->external_pointer()); |
2086 LOperand* key = UseRegisterOrConstant(instr->key()); | 2084 LOperand* key = UseRegisterOrConstant(instr->key()); |
2087 LOperand* val = NULL; | 2085 LOperand* val = NULL; |
2088 if (elements_kind == EXTERNAL_BYTE_ELEMENTS || | 2086 if (elements_kind == EXTERNAL_BYTE_ELEMENTS || |
2089 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || | 2087 elements_kind == EXTERNAL_UNSIGNED_BYTE_ELEMENTS || |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2401 LOperand* key = UseOrConstantAtStart(instr->key()); | 2399 LOperand* key = UseOrConstantAtStart(instr->key()); |
2402 LOperand* object = UseOrConstantAtStart(instr->object()); | 2400 LOperand* object = UseOrConstantAtStart(instr->object()); |
2403 LIn* result = new(zone()) LIn(context, key, object); | 2401 LIn* result = new(zone()) LIn(context, key, object); |
2404 return MarkAsCall(DefineFixed(result, eax), instr); | 2402 return MarkAsCall(DefineFixed(result, eax), instr); |
2405 } | 2403 } |
2406 | 2404 |
2407 | 2405 |
2408 } } // namespace v8::internal | 2406 } } // namespace v8::internal |
2409 | 2407 |
2410 #endif // V8_TARGET_ARCH_IA32 | 2408 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |