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 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1480 } | 1480 } |
1481 __ nop(); // Branch delay slot of the last beq. | 1481 __ nop(); // Branch delay slot of the last beq. |
1482 AssembleArchJump(i.InputRpo(1)); | 1482 AssembleArchJump(i.InputRpo(1)); |
1483 } | 1483 } |
1484 | 1484 |
1485 | 1485 |
1486 void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { | 1486 void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { |
1487 MipsOperandConverter i(this, instr); | 1487 MipsOperandConverter i(this, instr); |
1488 Register input = i.InputRegister(0); | 1488 Register input = i.InputRegister(0); |
1489 size_t const case_count = instr->InputCount() - 2; | 1489 size_t const case_count = instr->InputCount() - 2; |
1490 Label here; | |
1491 __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count)); | 1490 __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count)); |
1492 __ BlockTrampolinePoolFor(case_count + 6); | 1491 __ GenerateSwitchTable(input, case_count, [&i, this](size_t index) { |
1493 __ bal(&here); | 1492 return GetLabel(i.InputRpo(index + 2)); |
1494 __ sll(at, input, 2); // Branch delay slot. | 1493 }); |
1495 __ bind(&here); | |
1496 __ addu(at, at, ra); | |
1497 __ lw(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize)); | |
1498 __ jr(at); | |
1499 __ nop(); // Branch delay slot nop. | |
1500 for (size_t index = 0; index < case_count; ++index) { | |
1501 __ dd(GetLabel(i.InputRpo(index + 2))); | |
1502 } | |
1503 } | 1494 } |
1504 | 1495 |
1505 | 1496 |
1506 void CodeGenerator::AssembleDeoptimizerCall( | 1497 void CodeGenerator::AssembleDeoptimizerCall( |
1507 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { | 1498 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { |
1508 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( | 1499 Address deopt_entry = Deoptimizer::GetDeoptimizationEntry( |
1509 isolate(), deoptimization_id, bailout_type); | 1500 isolate(), deoptimization_id, bailout_type); |
1510 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); | 1501 __ Call(deopt_entry, RelocInfo::RUNTIME_ENTRY); |
1511 } | 1502 } |
1512 | 1503 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 padding_size -= v8::internal::Assembler::kInstrSize; | 1806 padding_size -= v8::internal::Assembler::kInstrSize; |
1816 } | 1807 } |
1817 } | 1808 } |
1818 } | 1809 } |
1819 | 1810 |
1820 #undef __ | 1811 #undef __ |
1821 | 1812 |
1822 } // namespace compiler | 1813 } // namespace compiler |
1823 } // namespace internal | 1814 } // namespace internal |
1824 } // namespace v8 | 1815 } // namespace v8 |
OLD | NEW |