Chromium Code Reviews| 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 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 665 Register value = i.InputRegister(3); \ | 665 Register value = i.InputRegister(3); \ |
| 666 if (mode == kMode_MRI) { \ | 666 if (mode == kMode_MRI) { \ |
| 667 __ asm_instr(value, operand); \ | 667 __ asm_instr(value, operand); \ |
| 668 } else { \ | 668 } else { \ |
| 669 __ asm_instrx(value, operand); \ | 669 __ asm_instrx(value, operand); \ |
| 670 } \ | 670 } \ |
| 671 __ bind(&done); \ | 671 __ bind(&done); \ |
| 672 DCHECK_EQ(LeaveRC, i.OutputRCBit()); \ | 672 DCHECK_EQ(LeaveRC, i.OutputRCBit()); \ |
| 673 } while (0) | 673 } while (0) |
| 674 | 674 |
| 675 #define ASSEMBLE_ATOMIC_LOAD_INTEGER(asm_instr, asm_instrx) \ | |
| 676 do { \ | |
| 677 AddressingMode mode = kMode_None; \ | |
| 678 DCHECK_EQ(kMode_MRR, mode); \ | |
| 679 if (mode == kMode_MRI) { \ | |
| 680 __ asm_instr(i.OutputRegister(), \ | |
| 681 MemOperand(i.InputRegister(0), i.InputRegister(1))); \ | |
|
MTBrandyberry
2016/04/19 14:13:08
If you want to support the non-indexed load form h
| |
| 682 } else { \ | |
| 683 __ asm_instrx(i.OutputRegister(), \ | |
| 684 MemOperand(i.InputRegister(0), i.InputRegister(1))); \ | |
| 685 } \ | |
| 686 __ lwsync(); \ | |
|
MTBrandyberry
2016/04/19 14:13:08
Joran was going to get another opinion on correctn
| |
| 687 } while (0) | |
| 688 | |
| 675 void CodeGenerator::AssembleDeconstructFrame() { | 689 void CodeGenerator::AssembleDeconstructFrame() { |
| 676 __ LeaveFrame(StackFrame::MANUAL); | 690 __ LeaveFrame(StackFrame::MANUAL); |
| 677 } | 691 } |
| 678 | 692 |
| 679 void CodeGenerator::AssembleSetupStackPointer() {} | 693 void CodeGenerator::AssembleSetupStackPointer() {} |
| 680 | 694 |
| 681 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { | 695 void CodeGenerator::AssembleDeconstructActivationRecord(int stack_param_delta) { |
| 682 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); | 696 int sp_slot_delta = TailCallFrameStackSlotDelta(stack_param_delta); |
| 683 if (sp_slot_delta > 0) { | 697 if (sp_slot_delta > 0) { |
| 684 __ Add(sp, sp, sp_slot_delta * kPointerSize, r0); | 698 __ Add(sp, sp, sp_slot_delta * kPointerSize, r0); |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1578 #else | 1592 #else |
| 1579 UNREACHABLE(); | 1593 UNREACHABLE(); |
| 1580 #endif | 1594 #endif |
| 1581 break; | 1595 break; |
| 1582 case kCheckedStoreFloat32: | 1596 case kCheckedStoreFloat32: |
| 1583 ASSEMBLE_CHECKED_STORE_FLOAT32(); | 1597 ASSEMBLE_CHECKED_STORE_FLOAT32(); |
| 1584 break; | 1598 break; |
| 1585 case kCheckedStoreFloat64: | 1599 case kCheckedStoreFloat64: |
| 1586 ASSEMBLE_CHECKED_STORE_DOUBLE(); | 1600 ASSEMBLE_CHECKED_STORE_DOUBLE(); |
| 1587 break; | 1601 break; |
| 1602 | |
| 1603 case kAtomicLoadInt8: | |
| 1604 ASSEMBLE_ATOMIC_LOAD_INTEGER(lbz, lbzx); | |
| 1605 __ extsb(i.OutputRegister(), i.OutputRegister()); | |
| 1606 break; | |
| 1607 case kAtomicLoadUint8: | |
| 1608 ASSEMBLE_ATOMIC_LOAD_INTEGER(lbz, lbzx); | |
| 1609 break; | |
| 1610 case kAtomicLoadInt16: | |
| 1611 ASSEMBLE_ATOMIC_LOAD_INTEGER(lha, lhax); | |
| 1612 break; | |
| 1613 case kAtomicLoadUint16: | |
| 1614 ASSEMBLE_ATOMIC_LOAD_INTEGER(lhz, lhzx); | |
| 1615 break; | |
| 1616 case kAtomicLoadWord32: | |
| 1617 ASSEMBLE_ATOMIC_LOAD_INTEGER(lwa, lwax); | |
| 1618 break; | |
| 1588 default: | 1619 default: |
| 1589 UNREACHABLE(); | 1620 UNREACHABLE(); |
| 1590 break; | 1621 break; |
| 1591 } | 1622 } |
| 1592 } // NOLINT(readability/fn_size) | 1623 } // NOLINT(readability/fn_size) |
| 1593 | 1624 |
| 1594 | 1625 |
| 1595 // Assembles branches after an instruction. | 1626 // Assembles branches after an instruction. |
| 1596 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { | 1627 void CodeGenerator::AssembleArchBranch(Instruction* instr, BranchInfo* branch) { |
| 1597 PPCOperandConverter i(this, instr); | 1628 PPCOperandConverter i(this, instr); |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2045 padding_size -= v8::internal::Assembler::kInstrSize; | 2076 padding_size -= v8::internal::Assembler::kInstrSize; |
| 2046 } | 2077 } |
| 2047 } | 2078 } |
| 2048 } | 2079 } |
| 2049 | 2080 |
| 2050 #undef __ | 2081 #undef __ |
| 2051 | 2082 |
| 2052 } // namespace compiler | 2083 } // namespace compiler |
| 2053 } // namespace internal | 2084 } // namespace internal |
| 2054 } // namespace v8 | 2085 } // namespace v8 |
| OLD | NEW |