| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <sstream> | 5 #include <sstream> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_MIPS64 | 9 #if V8_TARGET_ARCH_MIPS64 |
| 10 | 10 |
| (...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2183 return DefineAsRegister(new(zone()) LLoadRoot); | 2183 return DefineAsRegister(new(zone()) LLoadRoot); |
| 2184 } | 2184 } |
| 2185 | 2185 |
| 2186 | 2186 |
| 2187 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { | 2187 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { |
| 2188 DCHECK(instr->key()->representation().IsSmiOrInteger32()); | 2188 DCHECK(instr->key()->representation().IsSmiOrInteger32()); |
| 2189 ElementsKind elements_kind = instr->elements_kind(); | 2189 ElementsKind elements_kind = instr->elements_kind(); |
| 2190 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 2190 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
| 2191 LInstruction* result = NULL; | 2191 LInstruction* result = NULL; |
| 2192 | 2192 |
| 2193 if (!instr->is_typed_elements()) { | 2193 if (!instr->is_fixed_typed_array()) { |
| 2194 LOperand* obj = NULL; | 2194 LOperand* obj = NULL; |
| 2195 if (instr->representation().IsDouble()) { | 2195 if (instr->representation().IsDouble()) { |
| 2196 obj = UseRegister(instr->elements()); | 2196 obj = UseRegister(instr->elements()); |
| 2197 } else { | 2197 } else { |
| 2198 DCHECK(instr->representation().IsSmiOrTagged() || | 2198 DCHECK(instr->representation().IsSmiOrTagged() || |
| 2199 instr->representation().IsInteger32()); | 2199 instr->representation().IsInteger32()); |
| 2200 obj = UseRegisterAtStart(instr->elements()); | 2200 obj = UseRegisterAtStart(instr->elements()); |
| 2201 } | 2201 } |
| 2202 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); | 2202 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); |
| 2203 } else { | 2203 } else { |
| 2204 DCHECK( | 2204 DCHECK( |
| 2205 (instr->representation().IsInteger32() && | 2205 (instr->representation().IsInteger32() && |
| 2206 !IsDoubleOrFloatElementsKind(elements_kind)) || | 2206 !IsDoubleOrFloatElementsKind(elements_kind)) || |
| 2207 (instr->representation().IsDouble() && | 2207 (instr->representation().IsDouble() && |
| 2208 IsDoubleOrFloatElementsKind(elements_kind))); | 2208 IsDoubleOrFloatElementsKind(elements_kind))); |
| 2209 LOperand* backing_store = UseRegister(instr->elements()); | 2209 LOperand* backing_store = UseRegister(instr->elements()); |
| 2210 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); | 2210 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); |
| 2211 } | 2211 } |
| 2212 | 2212 |
| 2213 bool needs_environment; | 2213 bool needs_environment; |
| 2214 if (instr->is_external() || instr->is_fixed_typed_array()) { | 2214 if (instr->is_fixed_typed_array()) { |
| 2215 // see LCodeGen::DoLoadKeyedExternalArray | 2215 // see LCodeGen::DoLoadKeyedExternalArray |
| 2216 needs_environment = (elements_kind == EXTERNAL_UINT32_ELEMENTS || | 2216 needs_environment = elements_kind == UINT32_ELEMENTS && |
| 2217 elements_kind == UINT32_ELEMENTS) && | |
| 2218 !instr->CheckFlag(HInstruction::kUint32); | 2217 !instr->CheckFlag(HInstruction::kUint32); |
| 2219 } else { | 2218 } else { |
| 2220 // see LCodeGen::DoLoadKeyedFixedDoubleArray and | 2219 // see LCodeGen::DoLoadKeyedFixedDoubleArray and |
| 2221 // LCodeGen::DoLoadKeyedFixedArray | 2220 // LCodeGen::DoLoadKeyedFixedArray |
| 2222 needs_environment = | 2221 needs_environment = |
| 2223 instr->RequiresHoleCheck() || | 2222 instr->RequiresHoleCheck() || |
| 2224 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); | 2223 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); |
| 2225 } | 2224 } |
| 2226 | 2225 |
| 2227 if (needs_environment) { | 2226 if (needs_environment) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2242 } | 2241 } |
| 2243 | 2242 |
| 2244 LInstruction* result = | 2243 LInstruction* result = |
| 2245 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), | 2244 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), |
| 2246 v0); | 2245 v0); |
| 2247 return MarkAsCall(result, instr); | 2246 return MarkAsCall(result, instr); |
| 2248 } | 2247 } |
| 2249 | 2248 |
| 2250 | 2249 |
| 2251 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { | 2250 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
| 2252 if (!instr->is_typed_elements()) { | 2251 if (!instr->is_fixed_typed_array()) { |
| 2253 DCHECK(instr->elements()->representation().IsTagged()); | 2252 DCHECK(instr->elements()->representation().IsTagged()); |
| 2254 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 2253 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
| 2255 LOperand* object = NULL; | 2254 LOperand* object = NULL; |
| 2256 LOperand* val = NULL; | 2255 LOperand* val = NULL; |
| 2257 LOperand* key = NULL; | 2256 LOperand* key = NULL; |
| 2258 | 2257 |
| 2259 if (instr->value()->representation().IsDouble()) { | 2258 if (instr->value()->representation().IsDouble()) { |
| 2260 object = UseRegisterAtStart(instr->elements()); | 2259 object = UseRegisterAtStart(instr->elements()); |
| 2261 key = UseRegisterOrConstantAtStart(instr->key()); | 2260 key = UseRegisterOrConstantAtStart(instr->key()); |
| 2262 val = UseRegister(instr->value()); | 2261 val = UseRegister(instr->value()); |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2677 LAllocateBlockContext* result = | 2676 LAllocateBlockContext* result = |
| 2678 new(zone()) LAllocateBlockContext(context, function); | 2677 new(zone()) LAllocateBlockContext(context, function); |
| 2679 return MarkAsCall(DefineFixed(result, cp), instr); | 2678 return MarkAsCall(DefineFixed(result, cp), instr); |
| 2680 } | 2679 } |
| 2681 | 2680 |
| 2682 | 2681 |
| 2683 } // namespace internal | 2682 } // namespace internal |
| 2684 } // namespace v8 | 2683 } // namespace v8 |
| 2685 | 2684 |
| 2686 #endif // V8_TARGET_ARCH_MIPS64 | 2685 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |