Chromium Code Reviews| 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/x64/lithium-x64.h" | 5 #include "src/crankshaft/x64/lithium-x64.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 | 8 |
| 9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
| 10 | 10 |
| (...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2183 ? UseTempRegister(instr->key()) | 2183 ? UseTempRegister(instr->key()) |
| 2184 : UseRegisterOrConstantAtStart(instr->key()); | 2184 : UseRegisterOrConstantAtStart(instr->key()); |
| 2185 } | 2185 } |
| 2186 | 2186 |
| 2187 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) { | 2187 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) { |
| 2188 FindDehoistedKeyDefinitions(instr->key()); | 2188 FindDehoistedKeyDefinitions(instr->key()); |
| 2189 } | 2189 } |
| 2190 | 2190 |
| 2191 if (!instr->is_fixed_typed_array()) { | 2191 if (!instr->is_fixed_typed_array()) { |
| 2192 LOperand* obj = UseRegisterAtStart(instr->elements()); | 2192 LOperand* obj = UseRegisterAtStart(instr->elements()); |
| 2193 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); | 2193 result = DefineAsRegister(new (zone()) LLoadKeyed(obj, key, nullptr)); |
| 2194 } else { | 2194 } else { |
| 2195 DCHECK( | 2195 DCHECK( |
| 2196 (instr->representation().IsInteger32() && | 2196 (instr->representation().IsInteger32() && |
| 2197 !(IsDoubleOrFloatElementsKind(elements_kind))) || | 2197 !(IsDoubleOrFloatElementsKind(elements_kind))) || |
| 2198 (instr->representation().IsDouble() && | 2198 (instr->representation().IsDouble() && |
| 2199 (IsDoubleOrFloatElementsKind(elements_kind)))); | 2199 (IsDoubleOrFloatElementsKind(elements_kind)))); |
| 2200 LOperand* backing_store = UseRegister(instr->elements()); | 2200 LOperand* backing_store = UseRegister(instr->elements()); |
| 2201 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); | 2201 LOperand* backing_store_owner = UseAny(instr->backing_store_owner()); |
|
Benedikt Meurer
2015/12/07 05:02:03
I think UseAny in this case will prevent aliasing
| |
| 2202 result = DefineAsRegister( | |
| 2203 new (zone()) LLoadKeyed(backing_store, key, backing_store_owner)); | |
| 2202 } | 2204 } |
| 2203 | 2205 |
| 2204 bool needs_environment; | 2206 bool needs_environment; |
| 2205 if (instr->is_fixed_typed_array()) { | 2207 if (instr->is_fixed_typed_array()) { |
| 2206 // see LCodeGen::DoLoadKeyedExternalArray | 2208 // see LCodeGen::DoLoadKeyedExternalArray |
| 2207 needs_environment = elements_kind == UINT32_ELEMENTS && | 2209 needs_environment = elements_kind == UINT32_ELEMENTS && |
| 2208 !instr->CheckFlag(HInstruction::kUint32); | 2210 !instr->CheckFlag(HInstruction::kUint32); |
| 2209 } else { | 2211 } else { |
| 2210 // see LCodeGen::DoLoadKeyedFixedDoubleArray and | 2212 // see LCodeGen::DoLoadKeyedFixedDoubleArray and |
| 2211 // LCodeGen::DoLoadKeyedFixedArray | 2213 // LCodeGen::DoLoadKeyedFixedArray |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2263 object = UseTempRegister(instr->elements()); | 2265 object = UseTempRegister(instr->elements()); |
| 2264 val = UseTempRegister(instr->value()); | 2266 val = UseTempRegister(instr->value()); |
| 2265 key = UseTempRegister(instr->key()); | 2267 key = UseTempRegister(instr->key()); |
| 2266 } else { | 2268 } else { |
| 2267 object = UseRegisterAtStart(instr->elements()); | 2269 object = UseRegisterAtStart(instr->elements()); |
| 2268 val = UseRegisterOrConstantAtStart(instr->value()); | 2270 val = UseRegisterOrConstantAtStart(instr->value()); |
| 2269 key = UseRegisterOrConstantAtStart(instr->key()); | 2271 key = UseRegisterOrConstantAtStart(instr->key()); |
| 2270 } | 2272 } |
| 2271 } | 2273 } |
| 2272 | 2274 |
| 2273 return new(zone()) LStoreKeyed(object, key, val); | 2275 return new (zone()) LStoreKeyed(object, key, val, nullptr); |
| 2274 } | 2276 } |
| 2275 | 2277 |
| 2276 DCHECK( | 2278 DCHECK( |
| 2277 (instr->value()->representation().IsInteger32() && | 2279 (instr->value()->representation().IsInteger32() && |
| 2278 !IsDoubleOrFloatElementsKind(elements_kind)) || | 2280 !IsDoubleOrFloatElementsKind(elements_kind)) || |
| 2279 (instr->value()->representation().IsDouble() && | 2281 (instr->value()->representation().IsDouble() && |
| 2280 IsDoubleOrFloatElementsKind(elements_kind))); | 2282 IsDoubleOrFloatElementsKind(elements_kind))); |
| 2281 DCHECK(instr->elements()->representation().IsExternal()); | 2283 DCHECK(instr->elements()->representation().IsExternal()); |
| 2282 bool val_is_temp_register = elements_kind == UINT8_CLAMPED_ELEMENTS || | 2284 bool val_is_temp_register = elements_kind == UINT8_CLAMPED_ELEMENTS || |
| 2283 elements_kind == FLOAT32_ELEMENTS; | 2285 elements_kind == FLOAT32_ELEMENTS; |
| 2284 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) | 2286 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) |
| 2285 : UseRegister(instr->value()); | 2287 : UseRegister(instr->value()); |
| 2286 LOperand* key = NULL; | 2288 LOperand* key = NULL; |
| 2287 if (kPointerSize == kInt64Size) { | 2289 if (kPointerSize == kInt64Size) { |
| 2288 key = UseRegisterOrConstantAtStart(instr->key()); | 2290 key = UseRegisterOrConstantAtStart(instr->key()); |
| 2289 } else { | 2291 } else { |
| 2290 bool clobbers_key = ExternalArrayOpRequiresTemp( | 2292 bool clobbers_key = ExternalArrayOpRequiresTemp( |
| 2291 instr->key()->representation(), elements_kind); | 2293 instr->key()->representation(), elements_kind); |
| 2292 key = clobbers_key | 2294 key = clobbers_key |
| 2293 ? UseTempRegister(instr->key()) | 2295 ? UseTempRegister(instr->key()) |
| 2294 : UseRegisterOrConstantAtStart(instr->key()); | 2296 : UseRegisterOrConstantAtStart(instr->key()); |
| 2295 } | 2297 } |
| 2296 LOperand* backing_store = UseRegister(instr->elements()); | 2298 LOperand* backing_store = UseRegister(instr->elements()); |
| 2297 return new(zone()) LStoreKeyed(backing_store, key, val); | 2299 LOperand* backing_store_owner = UseAny(instr->backing_store_owner()); |
|
Benedikt Meurer
2015/12/07 05:02:03
Hm, I'm not sure if UseAny is the ideal choice her
| |
| 2300 return new (zone()) LStoreKeyed(backing_store, key, val, backing_store_owner); | |
| 2298 } | 2301 } |
| 2299 | 2302 |
| 2300 | 2303 |
| 2301 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { | 2304 LInstruction* LChunkBuilder::DoStoreKeyedGeneric(HStoreKeyedGeneric* instr) { |
| 2302 LOperand* context = UseFixed(instr->context(), rsi); | 2305 LOperand* context = UseFixed(instr->context(), rsi); |
| 2303 LOperand* object = | 2306 LOperand* object = |
| 2304 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); | 2307 UseFixed(instr->object(), StoreDescriptor::ReceiverRegister()); |
| 2305 LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); | 2308 LOperand* key = UseFixed(instr->key(), StoreDescriptor::NameRegister()); |
| 2306 LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); | 2309 LOperand* value = UseFixed(instr->value(), StoreDescriptor::ValueRegister()); |
| 2307 | 2310 |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2680 LAllocateBlockContext* result = | 2683 LAllocateBlockContext* result = |
| 2681 new(zone()) LAllocateBlockContext(context, function); | 2684 new(zone()) LAllocateBlockContext(context, function); |
| 2682 return MarkAsCall(DefineFixed(result, rsi), instr); | 2685 return MarkAsCall(DefineFixed(result, rsi), instr); |
| 2683 } | 2686 } |
| 2684 | 2687 |
| 2685 | 2688 |
| 2686 } // namespace internal | 2689 } // namespace internal |
| 2687 } // namespace v8 | 2690 } // namespace v8 |
| 2688 | 2691 |
| 2689 #endif // V8_TARGET_ARCH_X64 | 2692 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |