OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 if (mode == kMode_MRI) { \ | 668 if (mode == kMode_MRI) { \ |
669 __ asm_instr(result, operand); \ | 669 __ asm_instr(result, operand); \ |
670 } else { \ | 670 } else { \ |
671 __ asm_instrx(result, operand); \ | 671 __ asm_instrx(result, operand); \ |
672 } \ | 672 } \ |
673 __ bind(&done); \ | 673 __ bind(&done); \ |
674 __ cmp(result, result); \ | 674 __ cmp(result, result); \ |
675 __ bne(&done); \ | 675 __ bne(&done); \ |
676 __ isync(); \ | 676 __ isync(); \ |
677 } while (0) | 677 } while (0) |
| 678 #define ASSEMBLE_ATOMIC_STORE_INTEGER(asm_instr, asm_instrx) \ |
| 679 do { \ |
| 680 size_t index = 0; \ |
| 681 AddressingMode mode = kMode_None; \ |
| 682 MemOperand operand = i.MemoryOperand(&mode, &index); \ |
| 683 Register value = i.InputRegister(index); \ |
| 684 __ sync(); \ |
| 685 if (mode == kMode_MRI) { \ |
| 686 __ asm_instr(value, operand); \ |
| 687 } else { \ |
| 688 __ asm_instrx(value, operand); \ |
| 689 } \ |
| 690 DCHECK_EQ(LeaveRC, i.OutputRCBit()); \ |
| 691 } while (0) |
678 | 692 |
679 void CodeGenerator::AssembleDeconstructFrame() { | 693 void CodeGenerator::AssembleDeconstructFrame() { |
680 __ LeaveFrame(StackFrame::MANUAL); | 694 __ LeaveFrame(StackFrame::MANUAL); |
681 } | 695 } |
682 | 696 |
683 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { | 697 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
684 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 698 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
685 if (sp_slot_delta > 0) { | 699 if (sp_slot_delta > 0) { |
686 __ Add(sp, sp, sp_slot_delta * kPointerSize, r0); | 700 __ Add(sp, sp, sp_slot_delta * kPointerSize, r0); |
687 } | 701 } |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1603 break; | 1617 break; |
1604 case kAtomicLoadInt16: | 1618 case kAtomicLoadInt16: |
1605 ASSEMBLE_ATOMIC_LOAD_INTEGER(lha, lhax); | 1619 ASSEMBLE_ATOMIC_LOAD_INTEGER(lha, lhax); |
1606 break; | 1620 break; |
1607 case kAtomicLoadUint16: | 1621 case kAtomicLoadUint16: |
1608 ASSEMBLE_ATOMIC_LOAD_INTEGER(lhz, lhzx); | 1622 ASSEMBLE_ATOMIC_LOAD_INTEGER(lhz, lhzx); |
1609 break; | 1623 break; |
1610 case kAtomicLoadWord32: | 1624 case kAtomicLoadWord32: |
1611 ASSEMBLE_ATOMIC_LOAD_INTEGER(lwz, lwzx); | 1625 ASSEMBLE_ATOMIC_LOAD_INTEGER(lwz, lwzx); |
1612 break; | 1626 break; |
| 1627 |
| 1628 case kAtomicStoreWord8: |
| 1629 ASSEMBLE_ATOMIC_STORE_INTEGER(stb, stbx); |
| 1630 break; |
| 1631 case kAtomicStoreWord16: |
| 1632 ASSEMBLE_ATOMIC_STORE_INTEGER(sth, sthx); |
| 1633 break; |
| 1634 case kAtomicStoreWord32: |
| 1635 ASSEMBLE_ATOMIC_STORE_INTEGER(stw, stwx); |
| 1636 break; |
1613 default: | 1637 default: |
1614 UNREACHABLE(); | 1638 UNREACHABLE(); |
1615 break; | 1639 break; |
1616 } | 1640 } |
1617 return kSuccess; | 1641 return kSuccess; |
1618 } // NOLINT(readability/fn_size) | 1642 } // NOLINT(readability/fn_size) |
1619 | 1643 |
1620 | 1644 |
1621 // Assembles branches after an instruction. | 1645 // Assembles branches after an instruction. |
1622 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { | 1646 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2083 padding_size -= v8::internal::Assembler::kInstrSize; | 2107 padding_size -= v8::internal::Assembler::kInstrSize; |
2084 } | 2108 } |
2085 } | 2109 } |
2086 } | 2110 } |
2087 | 2111 |
2088 #undef __ | 2112 #undef __ |
2089 | 2113 |
2090 } // namespace compiler | 2114 } // namespace compiler |
2091 } // namespace internal | 2115 } // namespace internal |
2092 } // namespace v8 | 2116 } // namespace v8 |
OLD | NEW |