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