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 "src/crankshaft/mips64/lithium-codegen-mips64.h" | 5 #include "src/crankshaft/mips64/lithium-codegen-mips64.h" |
6 | 6 |
7 #include "src/builtins/builtins-constructor.h" | 7 #include "src/builtins/builtins-constructor.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/crankshaft/hydrogen-osr.h" | 10 #include "src/crankshaft/hydrogen-osr.h" |
(...skipping 2589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2600 | 2600 |
2601 __ Jump(ra); | 2601 __ Jump(ra); |
2602 } | 2602 } |
2603 | 2603 |
2604 | 2604 |
2605 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2605 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2606 Register context = ToRegister(instr->context()); | 2606 Register context = ToRegister(instr->context()); |
2607 Register result = ToRegister(instr->result()); | 2607 Register result = ToRegister(instr->result()); |
2608 | 2608 |
2609 __ ld(result, ContextMemOperand(context, instr->slot_index())); | 2609 __ ld(result, ContextMemOperand(context, instr->slot_index())); |
| 2610 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2611 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
| 2612 |
| 2613 if (instr->hydrogen()->DeoptimizesOnHole()) { |
| 2614 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole, result, Operand(at)); |
| 2615 } else { |
| 2616 Label is_not_hole; |
| 2617 __ Branch(&is_not_hole, ne, result, Operand(at)); |
| 2618 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
| 2619 __ bind(&is_not_hole); |
| 2620 } |
| 2621 } |
2610 } | 2622 } |
2611 | 2623 |
2612 | 2624 |
2613 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { | 2625 void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
2614 Register context = ToRegister(instr->context()); | 2626 Register context = ToRegister(instr->context()); |
2615 Register value = ToRegister(instr->value()); | 2627 Register value = ToRegister(instr->value()); |
| 2628 Register scratch = scratch0(); |
2616 MemOperand target = ContextMemOperand(context, instr->slot_index()); | 2629 MemOperand target = ContextMemOperand(context, instr->slot_index()); |
2617 | 2630 |
| 2631 Label skip_assignment; |
| 2632 |
| 2633 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 2634 __ ld(scratch, target); |
| 2635 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
| 2636 |
| 2637 if (instr->hydrogen()->DeoptimizesOnHole()) { |
| 2638 DeoptimizeIf(eq, instr, DeoptimizeReason::kHole, scratch, Operand(at)); |
| 2639 } else { |
| 2640 __ Branch(&skip_assignment, ne, scratch, Operand(at)); |
| 2641 } |
| 2642 } |
| 2643 |
2618 __ sd(value, target); | 2644 __ sd(value, target); |
2619 if (instr->hydrogen()->NeedsWriteBarrier()) { | 2645 if (instr->hydrogen()->NeedsWriteBarrier()) { |
2620 SmiCheck check_needed = | 2646 SmiCheck check_needed = |
2621 instr->hydrogen()->value()->type().IsHeapObject() | 2647 instr->hydrogen()->value()->type().IsHeapObject() |
2622 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; | 2648 ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
2623 __ RecordWriteContextSlot(context, | 2649 __ RecordWriteContextSlot(context, |
2624 target.offset(), | 2650 target.offset(), |
2625 value, | 2651 value, |
2626 scratch0(), | 2652 scratch0(), |
2627 GetRAState(), | 2653 GetRAState(), |
2628 kSaveFPRegs, | 2654 kSaveFPRegs, |
2629 EMIT_REMEMBERED_SET, | 2655 EMIT_REMEMBERED_SET, |
2630 check_needed); | 2656 check_needed); |
2631 } | 2657 } |
| 2658 |
| 2659 __ bind(&skip_assignment); |
2632 } | 2660 } |
2633 | 2661 |
2634 | 2662 |
2635 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { | 2663 void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { |
2636 HObjectAccess access = instr->hydrogen()->access(); | 2664 HObjectAccess access = instr->hydrogen()->access(); |
2637 int offset = access.offset(); | 2665 int offset = access.offset(); |
2638 Register object = ToRegister(instr->object()); | 2666 Register object = ToRegister(instr->object()); |
2639 if (access.IsExternalMemory()) { | 2667 if (access.IsExternalMemory()) { |
2640 Register result = ToRegister(instr->result()); | 2668 Register result = ToRegister(instr->result()); |
2641 MemOperand operand = MemOperand(object, offset); | 2669 MemOperand operand = MemOperand(object, offset); |
(...skipping 2954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5596 __ ld(result, FieldMemOperand(scratch, | 5624 __ ld(result, FieldMemOperand(scratch, |
5597 FixedArray::kHeaderSize - kPointerSize)); | 5625 FixedArray::kHeaderSize - kPointerSize)); |
5598 __ bind(deferred->exit()); | 5626 __ bind(deferred->exit()); |
5599 __ bind(&done); | 5627 __ bind(&done); |
5600 } | 5628 } |
5601 | 5629 |
5602 #undef __ | 5630 #undef __ |
5603 | 5631 |
5604 } // namespace internal | 5632 } // namespace internal |
5605 } // namespace v8 | 5633 } // namespace v8 |
OLD | NEW |