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 #include "src/arm/lithium-codegen-arm.h" | 9 #include "src/arm/lithium-codegen-arm.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 2219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2230 return DefineAsRegister(new(zone()) LLoadRoot); | 2230 return DefineAsRegister(new(zone()) LLoadRoot); |
2231 } | 2231 } |
2232 | 2232 |
2233 | 2233 |
2234 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { | 2234 LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { |
2235 DCHECK(instr->key()->representation().IsSmiOrInteger32()); | 2235 DCHECK(instr->key()->representation().IsSmiOrInteger32()); |
2236 ElementsKind elements_kind = instr->elements_kind(); | 2236 ElementsKind elements_kind = instr->elements_kind(); |
2237 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); | 2237 LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
2238 LInstruction* result = NULL; | 2238 LInstruction* result = NULL; |
2239 | 2239 |
2240 if (!instr->is_typed_elements()) { | 2240 if (!instr->is_fixed_typed_array()) { |
2241 LOperand* obj = NULL; | 2241 LOperand* obj = NULL; |
2242 if (instr->representation().IsDouble()) { | 2242 if (instr->representation().IsDouble()) { |
2243 obj = UseRegister(instr->elements()); | 2243 obj = UseRegister(instr->elements()); |
2244 } else { | 2244 } else { |
2245 DCHECK(instr->representation().IsSmiOrTagged()); | 2245 DCHECK(instr->representation().IsSmiOrTagged()); |
2246 obj = UseRegisterAtStart(instr->elements()); | 2246 obj = UseRegisterAtStart(instr->elements()); |
2247 } | 2247 } |
2248 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); | 2248 result = DefineAsRegister(new(zone()) LLoadKeyed(obj, key)); |
2249 } else { | 2249 } else { |
2250 DCHECK( | 2250 DCHECK( |
2251 (instr->representation().IsInteger32() && | 2251 (instr->representation().IsInteger32() && |
2252 !IsDoubleOrFloatElementsKind(elements_kind)) || | 2252 !IsDoubleOrFloatElementsKind(elements_kind)) || |
2253 (instr->representation().IsDouble() && | 2253 (instr->representation().IsDouble() && |
2254 IsDoubleOrFloatElementsKind(elements_kind))); | 2254 IsDoubleOrFloatElementsKind(elements_kind))); |
2255 LOperand* backing_store = UseRegister(instr->elements()); | 2255 LOperand* backing_store = UseRegister(instr->elements()); |
2256 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); | 2256 result = DefineAsRegister(new(zone()) LLoadKeyed(backing_store, key)); |
2257 } | 2257 } |
2258 | 2258 |
2259 bool needs_environment; | 2259 bool needs_environment; |
2260 if (instr->is_external() || instr->is_fixed_typed_array()) { | 2260 if (instr->is_fixed_typed_array()) { |
2261 // see LCodeGen::DoLoadKeyedExternalArray | 2261 // see LCodeGen::DoLoadKeyedExternalArray |
2262 needs_environment = (elements_kind == EXTERNAL_UINT32_ELEMENTS || | 2262 needs_environment = elements_kind == UINT32_ELEMENTS && |
2263 elements_kind == UINT32_ELEMENTS) && | |
2264 !instr->CheckFlag(HInstruction::kUint32); | 2263 !instr->CheckFlag(HInstruction::kUint32); |
2265 } else { | 2264 } else { |
2266 // see LCodeGen::DoLoadKeyedFixedDoubleArray and | 2265 // see LCodeGen::DoLoadKeyedFixedDoubleArray and |
2267 // LCodeGen::DoLoadKeyedFixedArray | 2266 // LCodeGen::DoLoadKeyedFixedArray |
2268 needs_environment = | 2267 needs_environment = |
2269 instr->RequiresHoleCheck() || | 2268 instr->RequiresHoleCheck() || |
2270 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); | 2269 (instr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED && info()->IsStub()); |
2271 } | 2270 } |
2272 | 2271 |
2273 if (needs_environment) { | 2272 if (needs_environment) { |
(...skipping 14 matching lines...) Expand all Loading... |
2288 } | 2287 } |
2289 | 2288 |
2290 LInstruction* result = | 2289 LInstruction* result = |
2291 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), | 2290 DefineFixed(new(zone()) LLoadKeyedGeneric(context, object, key, vector), |
2292 r0); | 2291 r0); |
2293 return MarkAsCall(result, instr); | 2292 return MarkAsCall(result, instr); |
2294 } | 2293 } |
2295 | 2294 |
2296 | 2295 |
2297 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { | 2296 LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { |
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 if (instr->value()->representation().IsDouble()) { | 2304 if (instr->value()->representation().IsDouble()) { |
2306 object = UseRegisterAtStart(instr->elements()); | 2305 object = UseRegisterAtStart(instr->elements()); |
2307 val = UseRegister(instr->value()); | 2306 val = UseRegister(instr->value()); |
2308 key = UseRegisterOrConstantAtStart(instr->key()); | 2307 key = UseRegisterOrConstantAtStart(instr->key()); |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2719 HAllocateBlockContext* instr) { | 2718 HAllocateBlockContext* instr) { |
2720 LOperand* context = UseFixed(instr->context(), cp); | 2719 LOperand* context = UseFixed(instr->context(), cp); |
2721 LOperand* function = UseRegisterAtStart(instr->function()); | 2720 LOperand* function = UseRegisterAtStart(instr->function()); |
2722 LAllocateBlockContext* result = | 2721 LAllocateBlockContext* result = |
2723 new(zone()) LAllocateBlockContext(context, function); | 2722 new(zone()) LAllocateBlockContext(context, function); |
2724 return MarkAsCall(DefineFixed(result, cp), instr); | 2723 return MarkAsCall(DefineFixed(result, cp), instr); |
2725 } | 2724 } |
2726 | 2725 |
2727 } // namespace internal | 2726 } // namespace internal |
2728 } // namespace v8 | 2727 } // namespace v8 |
OLD | NEW |