OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 3245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3256 | 3256 |
3257 // Check for the hole value. | 3257 // Check for the hole value. |
3258 if (requires_hole_check) { | 3258 if (requires_hole_check) { |
3259 if (IsFastSmiElementsKind(hinstr->elements_kind())) { | 3259 if (IsFastSmiElementsKind(hinstr->elements_kind())) { |
3260 Condition smi = __ CheckSmi(result); | 3260 Condition smi = __ CheckSmi(result); |
3261 DeoptimizeIf(NegateCondition(smi), instr, Deoptimizer::kNotASmi); | 3261 DeoptimizeIf(NegateCondition(smi), instr, Deoptimizer::kNotASmi); |
3262 } else { | 3262 } else { |
3263 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 3263 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
3264 DeoptimizeIf(equal, instr, Deoptimizer::kHole); | 3264 DeoptimizeIf(equal, instr, Deoptimizer::kHole); |
3265 } | 3265 } |
| 3266 } else if (hinstr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { |
| 3267 DCHECK(hinstr->elements_kind() == FAST_HOLEY_ELEMENTS); |
| 3268 Label done; |
| 3269 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
| 3270 __ j(not_equal, &done); |
| 3271 if (info()->IsStub()) { |
| 3272 // A stub can safely convert the hole to undefined only if the array |
| 3273 // protector cell contains (Smi) Isolate::kArrayProtectorValid. Otherwise |
| 3274 // it needs to bail out. |
| 3275 __ LoadRoot(result, Heap::kArrayProtectorRootIndex); |
| 3276 __ Cmp(FieldOperand(result, Cell::kValueOffset), |
| 3277 Smi::FromInt(Isolate::kArrayProtectorValid)); |
| 3278 DeoptimizeIf(not_equal, instr, Deoptimizer::kHole); |
| 3279 } |
| 3280 __ Move(result, isolate()->factory()->undefined_value()); |
| 3281 __ bind(&done); |
3266 } | 3282 } |
3267 } | 3283 } |
3268 | 3284 |
3269 | 3285 |
3270 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { | 3286 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { |
3271 if (instr->is_typed_elements()) { | 3287 if (instr->is_typed_elements()) { |
3272 DoLoadKeyedExternalArray(instr); | 3288 DoLoadKeyedExternalArray(instr); |
3273 } else if (instr->hydrogen()->representation().IsDouble()) { | 3289 } else if (instr->hydrogen()->representation().IsDouble()) { |
3274 DoLoadKeyedFixedDoubleArray(instr); | 3290 DoLoadKeyedFixedDoubleArray(instr); |
3275 } else { | 3291 } else { |
(...skipping 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5917 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5933 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5918 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5934 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5919 } | 5935 } |
5920 | 5936 |
5921 | 5937 |
5922 #undef __ | 5938 #undef __ |
5923 | 5939 |
5924 } } // namespace v8::internal | 5940 } } // namespace v8::internal |
5925 | 5941 |
5926 #endif // V8_TARGET_ARCH_X64 | 5942 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |