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_X64 | 9 #if V8_TARGET_ARCH_X64 |
10 | 10 |
(...skipping 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2231 instr->key()->representation(), elements_kind); | 2231 instr->key()->representation(), elements_kind); |
2232 key = clobbers_key | 2232 key = clobbers_key |
2233 ? UseTempRegister(instr->key()) | 2233 ? UseTempRegister(instr->key()) |
2234 : UseRegisterOrConstantAtStart(instr->key()); | 2234 : UseRegisterOrConstantAtStart(instr->key()); |
2235 } | 2235 } |
2236 | 2236 |
2237 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) { | 2237 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) { |
2238 FindDehoistedKeyDefinitions(instr->key()); | 2238 FindDehoistedKeyDefinitions(instr->key()); |
2239 } | 2239 } |
2240 | 2240 |
2241 if (!instr->is_typed_elements()) { | 2241 if (!instr->is_fixed_typed_array()) { |
2242 LOperand* obj = UseRegisterAtStart(instr->elements()); | 2242 LOperand* obj = UseRegisterAtStart(instr->elements()); |
2243 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); | 2243 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); |
2244 } else { | 2244 } else { |
2245 DCHECK( | 2245 DCHECK( |
2246 (instr->representation().IsInteger32() && | 2246 (instr->representation().IsInteger32() && |
2247 !(IsDoubleOrFloatElementsKind(elements_kind))) || | 2247 !(IsDoubleOrFloatElementsKind(elements_kind))) || |
2248 (instr->representation().IsDouble() && | 2248 (instr->representation().IsDouble() && |
2249 (IsDoubleOrFloatElementsKind(elements_kind)))); | 2249 (IsDoubleOrFloatElementsKind(elements_kind)))); |
2250 LOperand* backing_store = UseRegister(instr->elements()); | 2250 LOperand* backing_store = UseRegister(instr->elements()); |
2251 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); | 2251 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); |
2252 } | 2252 } |
2253 | 2253 |
2254 bool needs_environment; | 2254 bool needs_environment; |
2255 if (instr->is_external() || instr->is_fixed_typed_array()) { | 2255 if (instr->is_fixed_typed_array()) { |
2256 // see LCodeGen::DoLoadKeyedExternalArray | 2256 // see LCodeGen::DoLoadKeyedExternalArray |
2257 needs_environment = (elements_kind == EXTERNAL_UINT32_ELEMENTS || | 2257 needs_environment = elements_kind == UINT32_ELEMENTS && |
2258 elements_kind == UINT32_ELEMENTS) && | |
2259 !instr->CheckFlag(HInstruction::kUint32); | 2258 !instr->CheckFlag(HInstruction::kUint32); |
2260 } else { | 2259 } else { |
2261 // see LCodeGen::DoLoadKeyedFixedDoubleArray and | 2260 // see LCodeGen::DoLoadKeyedFixedDoubleArray and |
2262 // LCodeGen::DoLoadKeyedFixedArray | 2261 // LCodeGen::DoLoadKeyedFixedArray |
2263 needs_environment = | 2262 needs_environment = |
2264 instr->RequiresHoleCheck() || | 2263 instr->RequiresHoleCheck() || |
2265 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); | 2264 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); |
2266 } | 2265 } |
2267 | 2266 |
2268 if (needs_environment) { | 2267 if (needs_environment) { |
(...skipping 19 matching lines...) Expand all Loading... |
2288 } | 2287 } |
2289 | 2288 |
2290 | 2289 |
2291 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { | 2290 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
2292 ElementsKind elements_kind = instr->elements_kind(); | 2291 ElementsKind elements_kind = instr->elements_kind(); |
2293 | 2292 |
2294 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) { | 2293 if ((kPointerSize == kInt64Size) && instr->IsDehoisted()) { |
2295 FindDehoistedKeyDefinitions(instr->key()); | 2294 FindDehoistedKeyDefinitions(instr->key()); |
2296 } | 2295 } |
2297 | 2296 |
2298 if (!instr->is_typed_elements()) { | 2297 if (!instr->is_fixed_typed_array()) { |
2299 DCHECK(instr->elements()->representation().IsTagged()); | 2298 DCHECK(instr->elements()->representation().IsTagged()); |
2300 bool needs_write_barrier = instr->NeedsWriteBarrier(); | 2299 bool needs_write_barrier = instr->NeedsWriteBarrier(); |
2301 LOperand* object = NULL; | 2300 LOperand* object = NULL; |
2302 LOperand* key = NULL; | 2301 LOperand* key = NULL; |
2303 LOperand* val = NULL; | 2302 LOperand* val = NULL; |
2304 | 2303 |
2305 Representation value_representation = instr->value()->representation(); | 2304 Representation value_representation = instr->value()->representation(); |
2306 if (value_representation.IsDouble()) { | 2305 if (value_representation.IsDouble()) { |
2307 object = UseRegisterAtStart(instr->elements()); | 2306 object = UseRegisterAtStart(instr->elements()); |
2308 val = UseRegisterAtStart(instr->value()); | 2307 val = UseRegisterAtStart(instr->value()); |
(...skipping 14 matching lines...) Expand all Loading... |
2323 | 2322 |
2324 return new(zone()) LStoreKeyed(object, key, val); | 2323 return new(zone()) LStoreKeyed(object, key, val); |
2325 } | 2324 } |
2326 | 2325 |
2327 DCHECK( | 2326 DCHECK( |
2328 (instr->value()->representation().IsInteger32() && | 2327 (instr->value()->representation().IsInteger32() && |
2329 !IsDoubleOrFloatElementsKind(elements_kind)) || | 2328 !IsDoubleOrFloatElementsKind(elements_kind)) || |
2330 (instr->value()->representation().IsDouble() && | 2329 (instr->value()->representation().IsDouble() && |
2331 IsDoubleOrFloatElementsKind(elements_kind))); | 2330 IsDoubleOrFloatElementsKind(elements_kind))); |
2332 DCHECK(instr->elements()->representation().IsExternal()); | 2331 DCHECK(instr->elements()->representation().IsExternal()); |
2333 bool val_is_temp_register = | 2332 bool val_is_temp_register = elements_kind == UINT8_CLAMPED_ELEMENTS || |
2334 elements_kind == EXTERNAL_UINT8_CLAMPED_ELEMENTS || | 2333 elements_kind == FLOAT32_ELEMENTS; |
2335 elements_kind == EXTERNAL_FLOAT32_ELEMENTS || | |
2336 elements_kind == FLOAT32_ELEMENTS; | |
2337 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) | 2334 LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) |
2338 : UseRegister(instr->value()); | 2335 : UseRegister(instr->value()); |
2339 LOperand* key = NULL; | 2336 LOperand* key = NULL; |
2340 if (kPointerSize == kInt64Size) { | 2337 if (kPointerSize == kInt64Size) { |
2341 key = UseRegisterOrConstantAtStart(instr->key()); | 2338 key = UseRegisterOrConstantAtStart(instr->key()); |
2342 } else { | 2339 } else { |
2343 bool clobbers_key = ExternalArrayOpRequiresTemp( | 2340 bool clobbers_key = ExternalArrayOpRequiresTemp( |
2344 instr->key()->representation(), elements_kind); | 2341 instr->key()->representation(), elements_kind); |
2345 key = clobbers_key | 2342 key = clobbers_key |
2346 ? UseTempRegister(instr->key()) | 2343 ? UseTempRegister(instr->key()) |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2766 LAllocateBlockContext* result = | 2763 LAllocateBlockContext* result = |
2767 new(zone()) LAllocateBlockContext(context, function); | 2764 new(zone()) LAllocateBlockContext(context, function); |
2768 return MarkAsCall(DefineFixed(result, rsi), instr); | 2765 return MarkAsCall(DefineFixed(result, rsi), instr); |
2769 } | 2766 } |
2770 | 2767 |
2771 | 2768 |
2772 } // namespace internal | 2769 } // namespace internal |
2773 } // namespace v8 | 2770 } // namespace v8 |
2774 | 2771 |
2775 #endif // V8_TARGET_ARCH_X64 | 2772 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |