| 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 "src/crankshaft/ia32/lithium-ia32.h" | 5 #include "src/crankshaft/ia32/lithium-ia32.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
| 10 | 10 |
| (...skipping 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2181 ElementsKind elements_kind = instr->elements_kind(); | 2181 ElementsKind elements_kind = instr->elements_kind(); |
| 2182 bool clobbers_key = ExternalArrayOpRequiresTemp( | 2182 bool clobbers_key = ExternalArrayOpRequiresTemp( |
| 2183 instr->key()->representation(), elements_kind); | 2183 instr->key()->representation(), elements_kind); |
| 2184 LOperand* key = clobbers_key | 2184 LOperand* key = clobbers_key |
| 2185 ? UseTempRegister(instr->key()) | 2185 ? UseTempRegister(instr->key()) |
| 2186 : UseRegisterOrConstantAtStart(instr->key()); | 2186 : UseRegisterOrConstantAtStart(instr->key()); |
| 2187 LInstruction* result = NULL; | 2187 LInstruction* result = NULL; |
| 2188 | 2188 |
| 2189 if (!instr->is_fixed_typed_array()) { | 2189 if (!instr->is_fixed_typed_array()) { |
| 2190 LOperand* obj = UseRegisterAtStart(instr->elements()); | 2190 LOperand* obj = UseRegisterAtStart(instr->elements()); |
| 2191 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); | 2191 result = DefineAsRegister(new (zone()) LLoadKeyed(obj, key, nullptr)); |
| 2192 } else { | 2192 } else { |
| 2193 DCHECK( | 2193 DCHECK( |
| 2194 (instr->representation().IsInteger32() && | 2194 (instr->representation().IsInteger32() && |
| 2195 !(IsDoubleOrFloatElementsKind(instr->elements_kind()))) || | 2195 !(IsDoubleOrFloatElementsKind(instr->elements_kind()))) || |
| 2196 (instr->representation().IsDouble() && | 2196 (instr->representation().IsDouble() && |
| 2197 (IsDoubleOrFloatElementsKind(instr->elements_kind())))); | 2197 (IsDoubleOrFloatElementsKind(instr->elements_kind())))); |
| 2198 LOperand* backing_store = UseRegister(instr->elements()); | 2198 LOperand* backing_store = UseRegister(instr->elements()); |
| 2199 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); | 2199 LOperand* backing_store_owner = UseAny(instr->backing_store_owner()); |
| 2200 result = DefineAsRegister( |
| 2201 new (zone()) LLoadKeyed(backing_store, key, backing_store_owner)); |
| 2200 } | 2202 } |
| 2201 | 2203 |
| 2202 bool needs_environment; | 2204 bool needs_environment; |
| 2203 if (instr->is_fixed_typed_array()) { | 2205 if (instr->is_fixed_typed_array()) { |
| 2204 // see LCodeGen::DoLoadKeyedExternalArray | 2206 // see LCodeGen::DoLoadKeyedExternalArray |
| 2205 needs_environment = elements_kind == UINT32_ELEMENTS && | 2207 needs_environment = elements_kind == UINT32_ELEMENTS && |
| 2206 !instr->CheckFlag(HInstruction::kUint32); | 2208 !instr->CheckFlag(HInstruction::kUint32); |
| 2207 } else { | 2209 } else { |
| 2208 // see LCodeGen::DoLoadKeyedFixedDoubleArray and | 2210 // see LCodeGen::DoLoadKeyedFixedDoubleArray and |
| 2209 // LCodeGen::DoLoadKeyedFixedArray | 2211 // LCodeGen::DoLoadKeyedFixedArray |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2254 if (!instr->is_fixed_typed_array()) { | 2256 if (!instr->is_fixed_typed_array()) { |
| 2255 DCHECK(instr->elements()->representation().IsTagged()); | 2257 DCHECK(instr->elements()->representation().IsTagged()); |
| 2256 DCHECK(instr->key()->representation().IsInteger32() || | 2258 DCHECK(instr->key()->representation().IsInteger32() || |
| 2257 instr->key()->representation().IsSmi()); | 2259 instr->key()->representation().IsSmi()); |
| 2258 | 2260 |
| 2259 if (instr->value()->representation().IsDouble()) { | 2261 if (instr->value()->representation().IsDouble()) { |
| 2260 LOperand* object = UseRegisterAtStart(instr->elements()); | 2262 LOperand* object = UseRegisterAtStart(instr->elements()); |
| 2261 LOperand* val = NULL; | 2263 LOperand* val = NULL; |
| 2262 val = UseRegisterAtStart(instr->value()); | 2264 val = UseRegisterAtStart(instr->value()); |
| 2263 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 2265 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
| 2264 return new(zone()) LStoreKeyed(object, key, val); | 2266 return new (zone()) LStoreKeyed(object, key, val, nullptr); |
| 2265 } else { | 2267 } else { |
| 2266 DCHECK(instr->value()->representation().IsSmiOrTagged()); | 2268 DCHECK(instr->value()->representation().IsSmiOrTagged()); |
| 2267 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 2269 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
| 2268 | 2270 |
| 2269 LOperand* obj = UseRegister(instr->elements()); | 2271 LOperand* obj = UseRegister(instr->elements()); |
| 2270 LOperand* val; | 2272 LOperand* val; |
| 2271 LOperand* key; | 2273 LOperand* key; |
| 2272 if (needs_write_barrier) { | 2274 if (needs_write_barrier) { |
| 2273 val = UseTempRegister(instr->value()); | 2275 val = UseTempRegister(instr->value()); |
| 2274 key = UseTempRegister(instr->key()); | 2276 key = UseTempRegister(instr->key()); |
| 2275 } else { | 2277 } else { |
| 2276 val = UseRegisterOrConstantAtStart(instr->value()); | 2278 val = UseRegisterOrConstantAtStart(instr->value()); |
| 2277 key = UseRegisterOrConstantAtStart(instr->key()); | 2279 key = UseRegisterOrConstantAtStart(instr->key()); |
| 2278 } | 2280 } |
| 2279 return new(zone()) LStoreKeyed(obj, key, val); | 2281 return new (zone()) LStoreKeyed(obj, key, val, nullptr); |
| 2280 } | 2282 } |
| 2281 } | 2283 } |
| 2282 | 2284 |
| 2283 ElementsKind elements_kind = instr->elements_kind(); | 2285 ElementsKind elements_kind = instr->elements_kind(); |
| 2284 DCHECK( | 2286 DCHECK( |
| 2285 (instr->value()->representation().IsInteger32() && | 2287 (instr->value()->representation().IsInteger32() && |
| 2286 !IsDoubleOrFloatElementsKind(elements_kind)) || | 2288 !IsDoubleOrFloatElementsKind(elements_kind)) || |
| 2287 (instr->value()->representation().IsDouble() && | 2289 (instr->value()->representation().IsDouble() && |
| 2288 IsDoubleOrFloatElementsKind(elements_kind))); | 2290 IsDoubleOrFloatElementsKind(elements_kind))); |
| 2289 DCHECK(instr->elements()->representation().IsExternal()); | 2291 DCHECK(instr->elements()->representation().IsExternal()); |
| 2290 | 2292 |
| 2291 LOperand* backing_store = UseRegister(instr->elements()); | 2293 LOperand* backing_store = UseRegister(instr->elements()); |
| 2294 LOperand* backing_store_owner = UseAny(instr->backing_store_owner()); |
| 2292 LOperand* val = GetStoreKeyedValueOperand(instr); | 2295 LOperand* val = GetStoreKeyedValueOperand(instr); |
| 2293 bool clobbers_key = ExternalArrayOpRequiresTemp( | 2296 bool clobbers_key = ExternalArrayOpRequiresTemp( |
| 2294 instr->key()->representation(), elements_kind); | 2297 instr->key()->representation(), elements_kind); |
| 2295 LOperand* key = clobbers_key | 2298 LOperand* key = clobbers_key |
| 2296 ? UseTempRegister(instr->key()) | 2299 ? UseTempRegister(instr->key()) |
| 2297 : UseRegisterOrConstantAtStart(instr->key()); | 2300 : UseRegisterOrConstantAtStart(instr->key()); |
| 2298 return new(zone()) LStoreKeyed(backing_store, key, val); | 2301 return new (zone()) LStoreKeyed(backing_store, key, val, backing_store_owner); |
| 2299 } | 2302 } |
| 2300 | 2303 |
| 2301 | 2304 |
| 2302 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | 2305 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
| 2303 LOperand* context = UseFixed(instr->context(), esi); | 2306 LOperand* context = UseFixed(instr->context(), esi); |
| 2304 LOperand* object = | 2307 LOperand* object = |
| 2305 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); | 2308 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); |
| 2306 LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); | 2309 LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); |
| 2307 LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); | 2310 LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); |
| 2308 | 2311 |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2692 LAllocateBlockContext* result = | 2695 LAllocateBlockContext* result = |
| 2693 new(zone()) LAllocateBlockContext(context, function); | 2696 new(zone()) LAllocateBlockContext(context, function); |
| 2694 return MarkAsCall(DefineFixed(result, esi), instr); | 2697 return MarkAsCall(DefineFixed(result, esi), instr); |
| 2695 } | 2698 } |
| 2696 | 2699 |
| 2697 | 2700 |
| 2698 } // namespace internal | 2701 } // namespace internal |
| 2699 } // namespace v8 | 2702 } // namespace v8 |
| 2700 | 2703 |
| 2701 #endif // V8_TARGET_ARCH_IA32 | 2704 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |