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_MIPS | 9 #if V8_TARGET_ARCH_MIPS |
10 | 10 |
(...skipping 2166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2177 return DefineAsRegister(new(zone()) LLoadRoot); | 2177 return DefineAsRegister(new(zone()) LLoadRoot); |
2178 } | 2178 } |
2179 | 2179 |
2180 | 2180 |
2181 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { | 2181 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { |
2182 DCHECK(instr->key()->representation().IsSmiOrInteger32()); | 2182 DCHECK(instr->key()->representation().IsSmiOrInteger32()); |
2183 ElementsKind elements_kind = instr->elements_kind(); | 2183 ElementsKind elements_kind = instr->elements_kind(); |
2184 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 2184 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
2185 LInstruction* result = NULL; | 2185 LInstruction* result = NULL; |
2186 | 2186 |
2187 if (!instr->is_typed_elements()) { | 2187 if (!instr->is_fixed_typed_array()) { |
2188 LOperand* obj = NULL; | 2188 LOperand* obj = NULL; |
2189 if (instr->representation().IsDouble()) { | 2189 if (instr->representation().IsDouble()) { |
2190 obj = UseRegister(instr->elements()); | 2190 obj = UseRegister(instr->elements()); |
2191 } else { | 2191 } else { |
2192 DCHECK(instr->representation().IsSmiOrTagged()); | 2192 DCHECK(instr->representation().IsSmiOrTagged()); |
2193 obj = UseRegisterAtStart(instr->elements()); | 2193 obj = UseRegisterAtStart(instr->elements()); |
2194 } | 2194 } |
2195 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); | 2195 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); |
2196 } else { | 2196 } else { |
2197 DCHECK( | 2197 DCHECK( |
2198 (instr->representation().IsInteger32() && | 2198 (instr->representation().IsInteger32() && |
2199 !IsDoubleOrFloatElementsKind(elements_kind)) || | 2199 !IsDoubleOrFloatElementsKind(elements_kind)) || |
2200 (instr->representation().IsDouble() && | 2200 (instr->representation().IsDouble() && |
2201 IsDoubleOrFloatElementsKind(elements_kind))); | 2201 IsDoubleOrFloatElementsKind(elements_kind))); |
2202 LOperand* backing_store = UseRegister(instr->elements()); | 2202 LOperand* backing_store = UseRegister(instr->elements()); |
2203 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); | 2203 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); |
2204 } | 2204 } |
2205 | 2205 |
2206 bool needs_environment; | 2206 bool needs_environment; |
2207 if (instr->is_external() || instr->is_fixed_typed_array()) { | 2207 if (instr->is_fixed_typed_array()) { |
2208 // see LCodeGen::DoLoadKeyedExternalArray | 2208 // see LCodeGen::DoLoadKeyedExternalArray |
2209 needs_environment = (elements_kind == EXTERNAL_UINT32_ELEMENTS || | 2209 needs_environment = elements_kind == UINT32_ELEMENTS && |
2210 elements_kind == UINT32_ELEMENTS) && | |
2211 !instr->CheckFlag(HInstruction::kUint32); | 2210 !instr->CheckFlag(HInstruction::kUint32); |
2212 } else { | 2211 } else { |
2213 // see LCodeGen::DoLoadKeyedFixedDoubleArray and | 2212 // see LCodeGen::DoLoadKeyedFixedDoubleArray and |
2214 // LCodeGen::DoLoadKeyedFixedArray | 2213 // LCodeGen::DoLoadKeyedFixedArray |
2215 needs_environment = | 2214 needs_environment = |
2216 instr->RequiresHoleCheck() || | 2215 instr->RequiresHoleCheck() || |
2217 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); | 2216 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); |
2218 } | 2217 } |
2219 | 2218 |
2220 if (needs_environment) { | 2219 if (needs_environment) { |
(...skipping 14 matching lines...) Expand all Loading... |
2235 } | 2234 } |
2236 | 2235 |
2237 LInstruction* result = | 2236 LInstruction* result = |
2238 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), | 2237 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), |
2239 v0); | 2238 v0); |
2240 return MarkAsCall(result, instr); | 2239 return MarkAsCall(result, instr); |
2241 } | 2240 } |
2242 | 2241 |
2243 | 2242 |
2244 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { | 2243 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
2245 if (!instr->is_typed_elements()) { | 2244 if (!instr->is_fixed_typed_array()) { |
2246 DCHECK(instr->elements()->representation().IsTagged()); | 2245 DCHECK(instr->elements()->representation().IsTagged()); |
2247 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 2246 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
2248 LOperand* object = NULL; | 2247 LOperand* object = NULL; |
2249 LOperand* val = NULL; | 2248 LOperand* val = NULL; |
2250 LOperand* key = NULL; | 2249 LOperand* key = NULL; |
2251 | 2250 |
2252 if (instr->value()->representation().IsDouble()) { | 2251 if (instr->value()->representation().IsDouble()) { |
2253 object = UseRegisterAtStart(instr->elements()); | 2252 object = UseRegisterAtStart(instr->elements()); |
2254 key = UseRegisterOrConstantAtStart(instr->key()); | 2253 key = UseRegisterOrConstantAtStart(instr->key()); |
2255 val = UseRegister(instr->value()); | 2254 val = UseRegister(instr->value()); |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2669 LOperand* function = UseRegisterAtStart(instr->function()); | 2668 LOperand* function = UseRegisterAtStart(instr->function()); |
2670 LAllocateBlockContext* result = | 2669 LAllocateBlockContext* result = |
2671 new(zone()) LAllocateBlockContext(context, function); | 2670 new(zone()) LAllocateBlockContext(context, function); |
2672 return MarkAsCall(DefineFixed(result, cp), instr); | 2671 return MarkAsCall(DefineFixed(result, cp), instr); |
2673 } | 2672 } |
2674 | 2673 |
2675 } // namespace internal | 2674 } // namespace internal |
2676 } // namespace v8 | 2675 } // namespace v8 |
2677 | 2676 |
2678 #endif // V8_TARGET_ARCH_MIPS | 2677 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |