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/ast/scopes.h" | 5 #include "src/ast/scopes.h" |
6 #include "src/compiler/code-generator.h" | 6 #include "src/compiler/code-generator.h" |
7 #include "src/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/osr.h" | 10 #include "src/compiler/osr.h" |
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 | 1639 |
1640 void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { | 1640 void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { |
1641 MipsOperandConverter i(this, instr); | 1641 MipsOperandConverter i(this, instr); |
1642 Register input = i.InputRegister(0); | 1642 Register input = i.InputRegister(0); |
1643 size_t const case_count = instr->InputCount() - 2; | 1643 size_t const case_count = instr->InputCount() - 2; |
1644 Label here; | 1644 Label here; |
1645 | 1645 |
1646 __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count)); | 1646 __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count)); |
1647 __ BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 7); | 1647 __ BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 7); |
1648 // Ensure that dd-ed labels use 8 byte aligned addresses. | 1648 // Ensure that dd-ed labels use 8 byte aligned addresses. |
1649 if ((masm()->pc_offset() & 7) != 0) { | 1649 __ Align(8); |
1650 __ nop(); | |
1651 } | |
1652 __ bal(&here); | 1650 __ bal(&here); |
1653 __ dsll(at, input, 3); // Branch delay slot. | 1651 __ dsll(at, input, 3); // Branch delay slot. |
1654 __ bind(&here); | 1652 __ bind(&here); |
1655 __ daddu(at, at, ra); | 1653 __ daddu(at, at, ra); |
1656 __ ld(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize)); | 1654 __ ld(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize)); |
1657 __ jr(at); | 1655 __ jr(at); |
1658 __ nop(); // Branch delay slot nop. | 1656 __ nop(); // Branch delay slot nop. |
1659 for (size_t index = 0; index < case_count; ++index) { | 1657 for (size_t index = 0; index < case_count; ++index) { |
1660 __ dd(GetLabel(i.InputRpo(index + 2))); | 1658 __ dd(GetLabel(i.InputRpo(index + 2))); |
1661 } | 1659 } |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 padding_size -= v8::internal::Assembler::kInstrSize; | 1970 padding_size -= v8::internal::Assembler::kInstrSize; |
1973 } | 1971 } |
1974 } | 1972 } |
1975 } | 1973 } |
1976 | 1974 |
1977 #undef __ | 1975 #undef __ |
1978 | 1976 |
1979 } // namespace compiler | 1977 } // namespace compiler |
1980 } // namespace internal | 1978 } // namespace internal |
1981 } // namespace v8 | 1979 } // namespace v8 |
OLD | NEW |