Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1176)

Side by Side Diff: src/compiler/mips64/code-generator-mips64.cc

Issue 1628453002: MIPS: Use PC realitive instructions on r6. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1646 } 1646 }
1647 __ nop(); // Branch delay slot of the last beq. 1647 __ nop(); // Branch delay slot of the last beq.
1648 AssembleArchJump(i.InputRpo(1)); 1648 AssembleArchJump(i.InputRpo(1));
1649 } 1649 }
1650 1650
1651 1651
1652 void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { 1652 void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) {
1653 MipsOperandConverter i(this, instr); 1653 MipsOperandConverter i(this, instr);
1654 Register input = i.InputRegister(0); 1654 Register input = i.InputRegister(0);
1655 size_t const case_count = instr->InputCount() - 2; 1655 size_t const case_count = instr->InputCount() - 2;
1656 Label here;
1657 1656
1658 __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count)); 1657 __ Branch(GetLabel(i.InputRpo(1)), hs, input, Operand(case_count));
1659 __ BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 7); 1658 __ BlockTrampolinePoolFor(static_cast<int>(case_count) * 2 + 7);
1660 // Ensure that dd-ed labels use 8 byte aligned addresses. 1659 // Ensure that dd-ed labels use 8 bytes aligned addresses.
1661 __ Align(8); 1660 if (kArchVariant >= kMips64r6) {
ivica.bogosavljevic 2016/01/25 11:40:03 Also, I am not sure if this is a best way to do t
balazs.kilvady 2016/01/25 12:46:17 if (VERSION >= 7) {} code is quite common in sever
1662 __ bal(&here); 1661 // Opposite of Align(8) as we have unaligned number of instructions before
1663 __ dsll(at, input, 3); // Branch delay slot. 1662 // the first dd().
1664 __ bind(&here); 1663 if ((masm()->pc_offset() & 7) == 0) {
ivica.bogosavljevic 2016/01/25 11:40:03 I think you should call Align(8) + additional nop(
balazs.kilvady 2016/01/25 12:46:17 I don't think so. We don't need 1 or 2 nops as add
ivica.bogosavljevic 2016/01/26 08:32:29 I am not sure what to think about this. On one han
balazs.kilvady 2016/01/26 18:40:05 I see.
1665 __ daddu(at, at, ra); 1664 __ nop();
1666 __ ld(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize)); 1665 }
1666 __ addiupc(at, 5);
1667 __ dlsa(at, at, input, 3);
1668 __ ld(at, MemOperand(at));
1669 } else {
1670 Label here;
1671 __ Align(8);
1672 __ bal(&here);
1673 __ dsll(at, input, 3); // Branch delay slot.
1674 __ bind(&here);
1675 __ daddu(at, at, ra);
1676 __ ld(at, MemOperand(at, 4 * v8::internal::Assembler::kInstrSize));
1677 }
1667 __ jr(at); 1678 __ jr(at);
1668 __ nop(); // Branch delay slot nop. 1679 __ nop(); // Branch delay slot nop.
1669 for (size_t index = 0; index < case_count; ++index) { 1680 for (size_t index = 0; index < case_count; ++index) {
1670 __ dd(GetLabel(i.InputRpo(index + 2))); 1681 __ dd(GetLabel(i.InputRpo(index + 2)));
1671 } 1682 }
1672 } 1683 }
1673 1684
1674 1685
1675 void CodeGenerator::AssembleDeoptimizerCall( 1686 void CodeGenerator::AssembleDeoptimizerCall(
1676 int deoptimization_id, Deoptimizer::BailoutType bailout_type) { 1687 int deoptimization_id, Deoptimizer::BailoutType bailout_type) {
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1981 padding_size -= v8::internal::Assembler::kInstrSize; 1992 padding_size -= v8::internal::Assembler::kInstrSize;
1982 } 1993 }
1983 } 1994 }
1984 } 1995 }
1985 1996
1986 #undef __ 1997 #undef __
1987 1998
1988 } // namespace compiler 1999 } // namespace compiler
1989 } // namespace internal 2000 } // namespace internal
1990 } // namespace v8 2001 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/mips/macro-assembler-mips.h » ('j') | test/cctest/test-macro-assembler-mips64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698