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 2115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2126 } | 2126 } |
2127 result = new(zone()) LLoadKeyed(obj, key); | 2127 result = new(zone()) LLoadKeyed(obj, key); |
2128 } else { | 2128 } else { |
2129 ASSERT( | 2129 ASSERT( |
2130 (instr->representation().IsInteger32() && | 2130 (instr->representation().IsInteger32() && |
2131 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && | 2131 (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
2132 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || | 2132 (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
2133 (instr->representation().IsDouble() && | 2133 (instr->representation().IsDouble() && |
2134 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || | 2134 ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
2135 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); | 2135 (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
2136 // float->double conversion on non-VFP2 requires an extra scratch | 2136 LOperand* external_pointer = UseRegister(instr->elements()); |
2137 // register. For convenience, just mark the elements register as "UseTemp" | |
2138 // so that it can be used as a temp during the float->double conversion | |
2139 // after it's no longer needed after the float load. | |
2140 bool needs_temp = | |
2141 !CpuFeatures::IsSupported(VFP2) && | |
2142 (elements_kind == EXTERNAL_FLOAT_ELEMENTS); | |
2143 LOperand* external_pointer = needs_temp | |
2144 ? UseTempRegister(instr->elements()) | |
2145 : UseRegister(instr->elements()); | |
2146 result = new(zone()) LLoadKeyed(external_pointer, key); | 2137 result = new(zone()) LLoadKeyed(external_pointer, key); |
2147 } | 2138 } |
2148 | 2139 |
2149 DefineAsRegister(result); | 2140 DefineAsRegister(result); |
2150 // An unsigned int array load might overflow and cause a deopt, make sure it | 2141 // An unsigned int array load might overflow and cause a deopt, make sure it |
2151 // has an environment. | 2142 // has an environment. |
2152 bool can_deoptimize = instr->RequiresHoleCheck() || | 2143 bool can_deoptimize = instr->RequiresHoleCheck() || |
2153 (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS); | 2144 (elements_kind == EXTERNAL_UNSIGNED_INT_ELEMENTS); |
2154 return can_deoptimize ? AssignEnvironment(result) : result; | 2145 return can_deoptimize ? AssignEnvironment(result) : result; |
2155 } | 2146 } |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2565 | 2556 |
2566 | 2557 |
2567 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2558 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2568 LOperand* object = UseRegister(instr->object()); | 2559 LOperand* object = UseRegister(instr->object()); |
2569 LOperand* index = UseRegister(instr->index()); | 2560 LOperand* index = UseRegister(instr->index()); |
2570 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2561 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2571 } | 2562 } |
2572 | 2563 |
2573 | 2564 |
2574 } } // namespace v8::internal | 2565 } } // namespace v8::internal |
OLD | NEW |