OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #include "src/hydrogen-osr.h" | 9 #include "src/hydrogen-osr.h" |
10 #include "src/lithium-inl.h" | 10 #include "src/lithium-inl.h" |
(...skipping 2172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2183 result = DefineAsRegister(new (zone()) LLoadKeyed(obj, key)); | 2183 result = DefineAsRegister(new (zone()) LLoadKeyed(obj, key)); |
2184 } else { | 2184 } else { |
2185 DCHECK((instr->representation().IsInteger32() && | 2185 DCHECK((instr->representation().IsInteger32() && |
2186 !IsDoubleOrFloatElementsKind(elements_kind)) || | 2186 !IsDoubleOrFloatElementsKind(elements_kind)) || |
2187 (instr->representation().IsDouble() && | 2187 (instr->representation().IsDouble() && |
2188 IsDoubleOrFloatElementsKind(elements_kind))); | 2188 IsDoubleOrFloatElementsKind(elements_kind))); |
2189 LOperand* backing_store = UseRegister(instr->elements()); | 2189 LOperand* backing_store = UseRegister(instr->elements()); |
2190 result = DefineAsRegister(new (zone()) LLoadKeyed(backing_store, key)); | 2190 result = DefineAsRegister(new (zone()) LLoadKeyed(backing_store, key)); |
2191 } | 2191 } |
2192 | 2192 |
2193 if ((instr->is_external() || instr->is_fixed_typed_array()) | 2193 bool needs_environment; |
2194 ? | 2194 if (instr->is_external() || instr->is_fixed_typed_array()) { |
2195 // see LCodeGen::DoLoadKeyedExternalArray | 2195 // see LCodeGen::DoLoadKeyedExternalArray |
2196 ((elements_kind == EXTERNAL_UINT32_ELEMENTS || | 2196 needs_environment = (elements_kind == EXTERNAL_UINT32_ELEMENTS || |
2197 elements_kind == UINT32_ELEMENTS) && | 2197 elements_kind == UINT32_ELEMENTS) && |
2198 !instr->CheckFlag(HInstruction::kUint32)) | 2198 !instr->CheckFlag(HInstruction::kUint32); |
2199 : | 2199 } else { |
2200 // see LCodeGen::DoLoadKeyedFixedDoubleArray and | 2200 // see LCodeGen::DoLoadKeyedFixedDoubleArray and |
2201 // LCodeGen::DoLoadKeyedFixedArray | 2201 // LCodeGen::DoLoadKeyedFixedArray |
2202 instr->RequiresHoleCheck()) { | 2202 needs_environment = |
| 2203 instr->RequiresHoleCheck() || |
| 2204 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); |
| 2205 } |
| 2206 |
| 2207 if (needs_environment) { |
2203 result = AssignEnvironment(result); | 2208 result = AssignEnvironment(result); |
2204 } | 2209 } |
2205 return result; | 2210 return result; |
2206 } | 2211 } |
2207 | 2212 |
2208 | 2213 |
2209 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { | 2214 LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
2210 LOperand* context = UseFixed(instr->context(), cp); | 2215 LOperand* context = UseFixed(instr->context(), cp); |
2211 LOperand* object = | 2216 LOperand* object = |
2212 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); | 2217 UseFixed(instr->object(), LoadDescriptor::ReceiverRegister()); |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2599 LInstruction* LChunkBuilder::DoAllocateBlockContext( | 2604 LInstruction* LChunkBuilder::DoAllocateBlockContext( |
2600 HAllocateBlockContext* instr) { | 2605 HAllocateBlockContext* instr) { |
2601 LOperand* context = UseFixed(instr->context(), cp); | 2606 LOperand* context = UseFixed(instr->context(), cp); |
2602 LOperand* function = UseRegisterAtStart(instr->function()); | 2607 LOperand* function = UseRegisterAtStart(instr->function()); |
2603 LAllocateBlockContext* result = | 2608 LAllocateBlockContext* result = |
2604 new (zone()) LAllocateBlockContext(context, function); | 2609 new (zone()) LAllocateBlockContext(context, function); |
2605 return MarkAsCall(DefineFixed(result, cp), instr); | 2610 return MarkAsCall(DefineFixed(result, cp), instr); |
2606 } | 2611 } |
2607 } | 2612 } |
2608 } // namespace v8::internal | 2613 } // namespace v8::internal |
OLD | NEW |