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_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
10 | 10 |
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2222 } else { | 2222 } else { |
2223 DCHECK( | 2223 DCHECK( |
2224 (instr->representation().IsInteger32() && | 2224 (instr->representation().IsInteger32() && |
2225 !(IsDoubleOrFloatElementsKind(instr->elements_kind()))) || | 2225 !(IsDoubleOrFloatElementsKind(instr->elements_kind()))) || |
2226 (instr->representation().IsDouble() && | 2226 (instr->representation().IsDouble() && |
2227 (IsDoubleOrFloatElementsKind(instr->elements_kind())))); | 2227 (IsDoubleOrFloatElementsKind(instr->elements_kind())))); |
2228 LOperand* backing_store = UseRegister(instr->elements()); | 2228 LOperand* backing_store = UseRegister(instr->elements()); |
2229 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); | 2229 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); |
2230 } | 2230 } |
2231 | 2231 |
2232 if ((instr->is_external() || instr->is_fixed_typed_array()) ? | 2232 bool needs_environment; |
2233 // see LCodeGen::DoLoadKeyedExternalArray | 2233 if (instr->is_external() || instr->is_fixed_typed_array()) { |
2234 ((instr->elements_kind() == EXTERNAL_UINT32_ELEMENTS || | 2234 // see LCodeGen::DoLoadKeyedExternalArray |
2235 instr->elements_kind() == UINT32_ELEMENTS) && | 2235 needs_environment = (elements_kind == EXTERNAL_UINT32_ELEMENTS || |
2236 !instr->CheckFlag(HInstruction::kUint32)) : | 2236 elements_kind == UINT32_ELEMENTS) && |
2237 // see LCodeGen::DoLoadKeyedFixedDoubleArray and | 2237 !instr->CheckFlag(HInstruction::kUint32); |
2238 // LCodeGen::DoLoadKeyedFixedArray | 2238 } else { |
2239 instr->RequiresHoleCheck()) { | 2239 // see LCodeGen::DoLoadKeyedFixedDoubleArray and |
| 2240 // LCodeGen::DoLoadKeyedFixedArray |
| 2241 needs_environment = |
| 2242 instr->RequiresHoleCheck() || |
| 2243 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); |
| 2244 } |
| 2245 |
| 2246 if (needs_environment) { |
2240 result = AssignEnvironment(result); | 2247 result = AssignEnvironment(result); |
2241 } | 2248 } |
2242 return result; | 2249 return result; |
2243 } | 2250 } |
2244 | 2251 |
2245 | 2252 |
2246 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 2253 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
2247 LOperand* context = UseFixed(instr->context(), esi); | 2254 LOperand* context = UseFixed(instr->context(), esi); |
2248 LOperand* object = | 2255 LOperand* object = |
2249 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); | 2256 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2713 LOperand* function = UseRegisterAtStart(instr->function()); | 2720 LOperand* function = UseRegisterAtStart(instr->function()); |
2714 LAllocateBlockContext* result = | 2721 LAllocateBlockContext* result = |
2715 new(zone()) LAllocateBlockContext(context, function); | 2722 new(zone()) LAllocateBlockContext(context, function); |
2716 return MarkAsCall(DefineFixed(result, esi), instr); | 2723 return MarkAsCall(DefineFixed(result, esi), instr); |
2717 } | 2724 } |
2718 | 2725 |
2719 | 2726 |
2720 } } // namespace v8::internal | 2727 } } // namespace v8::internal |
2721 | 2728 |
2722 #endif // V8_TARGET_ARCH_IA32 | 2729 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |