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