| 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/base/adapters.h" | 5 #include "src/base/adapters.h" | 
| 6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" | 
| 7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" | 
| 8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" | 
| 9 #include "src/ppc/frames-ppc.h" | 9 #include "src/ppc/frames-ppc.h" | 
| 10 | 10 | 
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 147   } | 147   } | 
| 148 | 148 | 
| 149   DCHECK_NE(0u, input_count); | 149   DCHECK_NE(0u, input_count); | 
| 150   DCHECK_NE(0u, output_count); | 150   DCHECK_NE(0u, output_count); | 
| 151   DCHECK_GE(arraysize(inputs), input_count); | 151   DCHECK_GE(arraysize(inputs), input_count); | 
| 152   DCHECK_GE(arraysize(outputs), output_count); | 152   DCHECK_GE(arraysize(outputs), output_count); | 
| 153 | 153 | 
| 154   opcode = cont->Encode(opcode); | 154   opcode = cont->Encode(opcode); | 
| 155   if (cont->IsDeoptimize()) { | 155   if (cont->IsDeoptimize()) { | 
| 156     selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs, | 156     selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs, | 
| 157                              cont->reason(), cont->frame_state()); | 157                              cont->kind(), cont->reason(), cont->frame_state()); | 
| 158   } else if (cont->IsTrap()) { | 158   } else if (cont->IsTrap()) { | 
| 159     inputs[input_count++] = g.UseImmediate(cont->trap_id()); | 159     inputs[input_count++] = g.UseImmediate(cont->trap_id()); | 
| 160     selector->Emit(opcode, output_count, outputs, input_count, inputs); | 160     selector->Emit(opcode, output_count, outputs, input_count, inputs); | 
| 161   } else { | 161   } else { | 
| 162     selector->Emit(opcode, output_count, outputs, input_count, inputs); | 162     selector->Emit(opcode, output_count, outputs, input_count, inputs); | 
| 163   } | 163   } | 
| 164 } | 164 } | 
| 165 | 165 | 
| 166 | 166 | 
| 167 // Shared routine for multiple binary operations. | 167 // Shared routine for multiple binary operations. | 
| (...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1529 // Shared routine for multiple compare operations. | 1529 // Shared routine for multiple compare operations. | 
| 1530 void VisitCompare(InstructionSelector* selector, InstructionCode opcode, | 1530 void VisitCompare(InstructionSelector* selector, InstructionCode opcode, | 
| 1531                   InstructionOperand left, InstructionOperand right, | 1531                   InstructionOperand left, InstructionOperand right, | 
| 1532                   FlagsContinuation* cont) { | 1532                   FlagsContinuation* cont) { | 
| 1533   PPCOperandGenerator g(selector); | 1533   PPCOperandGenerator g(selector); | 
| 1534   opcode = cont->Encode(opcode); | 1534   opcode = cont->Encode(opcode); | 
| 1535   if (cont->IsBranch()) { | 1535   if (cont->IsBranch()) { | 
| 1536     selector->Emit(opcode, g.NoOutput(), left, right, | 1536     selector->Emit(opcode, g.NoOutput(), left, right, | 
| 1537                    g.Label(cont->true_block()), g.Label(cont->false_block())); | 1537                    g.Label(cont->true_block()), g.Label(cont->false_block())); | 
| 1538   } else if (cont->IsDeoptimize()) { | 1538   } else if (cont->IsDeoptimize()) { | 
| 1539     selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->reason(), | 1539     selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->kind(), | 
| 1540                              cont->frame_state()); | 1540                              cont->reason(), cont->frame_state()); | 
| 1541   } else if (cont->IsSet()) { | 1541   } else if (cont->IsSet()) { | 
| 1542     selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right); | 1542     selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right); | 
| 1543   } else { | 1543   } else { | 
| 1544     DCHECK(cont->IsTrap()); | 1544     DCHECK(cont->IsTrap()); | 
| 1545     selector->Emit(opcode, g.NoOutput(), left, right, | 1545     selector->Emit(opcode, g.NoOutput(), left, right, | 
| 1546                    g.UseImmediate(cont->trap_id())); | 1546                    g.UseImmediate(cont->trap_id())); | 
| 1547   } | 1547   } | 
| 1548 } | 1548 } | 
| 1549 | 1549 | 
| 1550 | 1550 | 
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1778 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, | 1778 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, | 
| 1779                                       BasicBlock* fbranch) { | 1779                                       BasicBlock* fbranch) { | 
| 1780   FlagsContinuation cont(kNotEqual, tbranch, fbranch); | 1780   FlagsContinuation cont(kNotEqual, tbranch, fbranch); | 
| 1781   VisitWord32CompareZero(this, branch, branch->InputAt(0), &cont); | 1781   VisitWord32CompareZero(this, branch, branch->InputAt(0), &cont); | 
| 1782 } | 1782 } | 
| 1783 | 1783 | 
| 1784 void InstructionSelector::VisitDeoptimizeIf(Node* node) { | 1784 void InstructionSelector::VisitDeoptimizeIf(Node* node) { | 
| 1785   DeoptimizeParameters p = DeoptimizeParametersOf(node->op()); | 1785   DeoptimizeParameters p = DeoptimizeParametersOf(node->op()); | 
| 1786   FlagsContinuation cont = FlagsContinuation::ForDeoptimize( | 1786   FlagsContinuation cont = FlagsContinuation::ForDeoptimize( | 
| 1787       kNotEqual, p.kind(), p.reason(), node->InputAt(1)); | 1787       kNotEqual, p.kind(), p.reason(), node->InputAt(1)); | 
| 1788   VisitWordCompareZero(this, node, node->InputAt(0), &cont); | 1788   VisitWord32CompareZero(this, node, node->InputAt(0), &cont); | 
| 1789 } | 1789 } | 
| 1790 | 1790 | 
| 1791 void InstructionSelector::VisitDeoptimizeUnless(Node* node) { | 1791 void InstructionSelector::VisitDeoptimizeUnless(Node* node) { | 
| 1792   DeoptimizeParameters p = DeoptimizeParametersOf(node->op()); | 1792   DeoptimizeParameters p = DeoptimizeParametersOf(node->op()); | 
| 1793   FlagsContinuation cont = FlagsContinuation::ForDeoptimize( | 1793   FlagsContinuation cont = FlagsContinuation::ForDeoptimize( | 
| 1794       kEqual, p.kind(), p.reason(), node->InputAt(1)); | 1794       kEqual, p.kind(), p.reason(), node->InputAt(1)); | 
| 1795   VisitWordCompareZero(this, node, node->InputAt(0), &cont); | 1795   VisitWord32CompareZero(this, node, node->InputAt(0), &cont); | 
| 1796 } | 1796 } | 
| 1797 | 1797 | 
| 1798 void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) { | 1798 void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) { | 
| 1799   FlagsContinuation cont = | 1799   FlagsContinuation cont = | 
| 1800       FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1)); | 1800       FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1)); | 
| 1801   VisitWord32CompareZero(this, node, node->InputAt(0), &cont); | 1801   VisitWord32CompareZero(this, node, node->InputAt(0), &cont); | 
| 1802 } | 1802 } | 
| 1803 | 1803 | 
| 1804 void InstructionSelector::VisitTrapUnless(Node* node, | 1804 void InstructionSelector::VisitTrapUnless(Node* node, | 
| 1805                                           Runtime::FunctionId func_id) { | 1805                                           Runtime::FunctionId func_id) { | 
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2119 // static | 2119 // static | 
| 2120 MachineOperatorBuilder::AlignmentRequirements | 2120 MachineOperatorBuilder::AlignmentRequirements | 
| 2121 InstructionSelector::AlignmentRequirements() { | 2121 InstructionSelector::AlignmentRequirements() { | 
| 2122   return MachineOperatorBuilder::AlignmentRequirements:: | 2122   return MachineOperatorBuilder::AlignmentRequirements:: | 
| 2123       FullUnalignedAccessSupport(); | 2123       FullUnalignedAccessSupport(); | 
| 2124 } | 2124 } | 
| 2125 | 2125 | 
| 2126 }  // namespace compiler | 2126 }  // namespace compiler | 
| 2127 }  // namespace internal | 2127 }  // namespace internal | 
| 2128 }  // namespace v8 | 2128 }  // namespace v8 | 
| OLD | NEW | 
|---|