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 #include "src/arm64/lithium-codegen-arm64.h" | 7 #include "src/arm64/lithium-codegen-arm64.h" |
8 #include "src/arm64/lithium-gap-resolver-arm64.h" | 8 #include "src/arm64/lithium-gap-resolver-arm64.h" |
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 3597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3608 | 3608 |
3609 __ Load(result, mem_op, representation); | 3609 __ Load(result, mem_op, representation); |
3610 | 3610 |
3611 if (instr->hydrogen()->RequiresHoleCheck()) { | 3611 if (instr->hydrogen()->RequiresHoleCheck()) { |
3612 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { | 3612 if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) { |
3613 DeoptimizeIfNotSmi(result, instr, Deoptimizer::kNotASmi); | 3613 DeoptimizeIfNotSmi(result, instr, Deoptimizer::kNotASmi); |
3614 } else { | 3614 } else { |
3615 DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr, | 3615 DeoptimizeIfRoot(result, Heap::kTheHoleValueRootIndex, instr, |
3616 Deoptimizer::kHole); | 3616 Deoptimizer::kHole); |
3617 } | 3617 } |
| 3618 } else if (instr->hydrogen()->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { |
| 3619 DCHECK(instr->hydrogen()->elements_kind() == FAST_HOLEY_ELEMENTS); |
| 3620 Label done; |
| 3621 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
| 3622 __ B(ne, &done); |
| 3623 if (info()->IsStub()) { |
| 3624 // A stub can safely convert the hole to undefined only if the array |
| 3625 // protector cell contains (Smi) Isolate::kArrayProtectorValid. Otherwise |
| 3626 // it needs to bail out. |
| 3627 __ LoadRoot(result, Heap::kArrayProtectorRootIndex); |
| 3628 __ Ldr(result, FieldMemOperand(result, Cell::kValueOffset)); |
| 3629 __ Cmp(result, Operand(Smi::FromInt(Isolate::kArrayProtectorValid))); |
| 3630 DeoptimizeIf(ne, instr, Deoptimizer::kHole); |
| 3631 } |
| 3632 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
| 3633 __ Bind(&done); |
3618 } | 3634 } |
3619 } | 3635 } |
3620 | 3636 |
3621 | 3637 |
3622 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { | 3638 void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
3623 DCHECK(ToRegister(instr->context()).is(cp)); | 3639 DCHECK(ToRegister(instr->context()).is(cp)); |
3624 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); | 3640 DCHECK(ToRegister(instr->object()).is(LoadDescriptor::ReceiverRegister())); |
3625 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); | 3641 DCHECK(ToRegister(instr->key()).is(LoadDescriptor::NameRegister())); |
3626 | 3642 |
3627 if (instr->hydrogen()->HasVectorAndSlot()) { | 3643 if (instr->hydrogen()->HasVectorAndSlot()) { |
(...skipping 2384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6012 Handle<ScopeInfo> scope_info = instr->scope_info(); | 6028 Handle<ScopeInfo> scope_info = instr->scope_info(); |
6013 __ Push(scope_info); | 6029 __ Push(scope_info); |
6014 __ Push(ToRegister(instr->function())); | 6030 __ Push(ToRegister(instr->function())); |
6015 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6031 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6016 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6032 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6017 } | 6033 } |
6018 | 6034 |
6019 | 6035 |
6020 | 6036 |
6021 } } // namespace v8::internal | 6037 } } // namespace v8::internal |
OLD | NEW |