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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/crankshaft/x64/lithium-codegen-x64.h" | 7 #include "src/crankshaft/x64/lithium-codegen-x64.h" |
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 3103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3114 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 3114 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
3115 DeoptimizeIf(equal, instr, Deoptimizer::kHole); | 3115 DeoptimizeIf(equal, instr, Deoptimizer::kHole); |
3116 } | 3116 } |
3117 } else if (hinstr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { | 3117 } else if (hinstr->hole_mode() == CONVERT_HOLE_TO_UNDEFINED) { |
3118 DCHECK(hinstr->elements_kind() == FAST_HOLEY_ELEMENTS); | 3118 DCHECK(hinstr->elements_kind() == FAST_HOLEY_ELEMENTS); |
3119 Label done; | 3119 Label done; |
3120 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); | 3120 __ CompareRoot(result, Heap::kTheHoleValueRootIndex); |
3121 __ j(not_equal, &done); | 3121 __ j(not_equal, &done); |
3122 if (info()->IsStub()) { | 3122 if (info()->IsStub()) { |
3123 // A stub can safely convert the hole to undefined only if the array | 3123 // A stub can safely convert the hole to undefined only if the array |
3124 // protector cell contains (Smi) Isolate::kArrayProtectorValid. Otherwise | 3124 // protector cell contains (Smi) Isolate::kArrayElementsProtectorValid. |
| 3125 // Otherwise |
3125 // it needs to bail out. | 3126 // it needs to bail out. |
3126 __ LoadRoot(result, Heap::kArrayProtectorRootIndex); | 3127 __ LoadRoot(result, Heap::kArrayElementsProtectorRootIndex); |
3127 __ Cmp(FieldOperand(result, Cell::kValueOffset), | 3128 __ Cmp(FieldOperand(result, Cell::kValueOffset), |
3128 Smi::FromInt(Isolate::kArrayProtectorValid)); | 3129 Smi::FromInt(Isolate::kArrayElementsProtectorValid)); |
3129 DeoptimizeIf(not_equal, instr, Deoptimizer::kHole); | 3130 DeoptimizeIf(not_equal, instr, Deoptimizer::kHole); |
3130 } | 3131 } |
3131 __ Move(result, isolate()->factory()->undefined_value()); | 3132 __ Move(result, isolate()->factory()->undefined_value()); |
3132 __ bind(&done); | 3133 __ bind(&done); |
3133 } | 3134 } |
3134 } | 3135 } |
3135 | 3136 |
3136 | 3137 |
3137 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { | 3138 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { |
3138 if (instr->is_fixed_typed_array()) { | 3139 if (instr->is_fixed_typed_array()) { |
(...skipping 2730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5869 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5870 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5870 } | 5871 } |
5871 | 5872 |
5872 | 5873 |
5873 #undef __ | 5874 #undef __ |
5874 | 5875 |
5875 } // namespace internal | 5876 } // namespace internal |
5876 } // namespace v8 | 5877 } // namespace v8 |
5877 | 5878 |
5878 #endif // V8_TARGET_ARCH_X64 | 5879 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |