| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/s390/frames-s390.h" | 9 #include "src/s390/frames-s390.h" |
| 10 | 10 |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 } | 423 } |
| 424 | 424 |
| 425 DCHECK_NE(0u, input_count); | 425 DCHECK_NE(0u, input_count); |
| 426 DCHECK_NE(0u, output_count); | 426 DCHECK_NE(0u, output_count); |
| 427 DCHECK_GE(arraysize(inputs), input_count); | 427 DCHECK_GE(arraysize(inputs), input_count); |
| 428 DCHECK_GE(arraysize(outputs), output_count); | 428 DCHECK_GE(arraysize(outputs), output_count); |
| 429 | 429 |
| 430 opcode = cont->Encode(opcode); | 430 opcode = cont->Encode(opcode); |
| 431 if (cont->IsDeoptimize()) { | 431 if (cont->IsDeoptimize()) { |
| 432 selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs, | 432 selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs, |
| 433 cont->kind(), cont->reason(), cont->frame_state()); | 433 cont->reason(), cont->frame_state()); |
| 434 } else if (cont->IsTrap()) { | 434 } else if (cont->IsTrap()) { |
| 435 inputs[input_count++] = g.UseImmediate(cont->trap_id()); | 435 inputs[input_count++] = g.UseImmediate(cont->trap_id()); |
| 436 selector->Emit(opcode, output_count, outputs, input_count, inputs); | 436 selector->Emit(opcode, output_count, outputs, input_count, inputs); |
| 437 } else { | 437 } else { |
| 438 selector->Emit(opcode, output_count, outputs, input_count, inputs); | 438 selector->Emit(opcode, output_count, outputs, input_count, inputs); |
| 439 } | 439 } |
| 440 } | 440 } |
| 441 | 441 |
| 442 // Shared routine for multiple binary operations. | 442 // Shared routine for multiple binary operations. |
| 443 template <typename Matcher> | 443 template <typename Matcher> |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 | 561 |
| 562 DCHECK_NE(0u, input_count); | 562 DCHECK_NE(0u, input_count); |
| 563 DCHECK_NE(0u, output_count); | 563 DCHECK_NE(0u, output_count); |
| 564 DCHECK_GE(arraysize(inputs), input_count); | 564 DCHECK_GE(arraysize(inputs), input_count); |
| 565 DCHECK_GE(arraysize(outputs), output_count); | 565 DCHECK_GE(arraysize(outputs), output_count); |
| 566 | 566 |
| 567 opcode = cont->Encode(opcode); | 567 opcode = cont->Encode(opcode); |
| 568 | 568 |
| 569 if (cont->IsDeoptimize()) { | 569 if (cont->IsDeoptimize()) { |
| 570 selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs, | 570 selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs, |
| 571 cont->kind(), cont->reason(), cont->frame_state()); | 571 cont->reason(), cont->frame_state()); |
| 572 } else if (cont->IsTrap()) { | 572 } else if (cont->IsTrap()) { |
| 573 inputs[input_count++] = g.UseImmediate(cont->trap_id()); | 573 inputs[input_count++] = g.UseImmediate(cont->trap_id()); |
| 574 selector->Emit(opcode, output_count, outputs, input_count, inputs); | 574 selector->Emit(opcode, output_count, outputs, input_count, inputs); |
| 575 } else { | 575 } else { |
| 576 selector->Emit(opcode, output_count, outputs, input_count, inputs); | 576 selector->Emit(opcode, output_count, outputs, input_count, inputs); |
| 577 } | 577 } |
| 578 } | 578 } |
| 579 | 579 |
| 580 void VisitBin32op(InstructionSelector* selector, Node* node, ArchOpcode opcode, | 580 void VisitBin32op(InstructionSelector* selector, Node* node, ArchOpcode opcode, |
| 581 OperandModes operand_mode) { | 581 OperandModes operand_mode) { |
| (...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1723 // Shared routine for multiple compare operations. | 1723 // Shared routine for multiple compare operations. |
| 1724 void VisitCompare(InstructionSelector* selector, InstructionCode opcode, | 1724 void VisitCompare(InstructionSelector* selector, InstructionCode opcode, |
| 1725 InstructionOperand left, InstructionOperand right, | 1725 InstructionOperand left, InstructionOperand right, |
| 1726 FlagsContinuation* cont) { | 1726 FlagsContinuation* cont) { |
| 1727 S390OperandGenerator g(selector); | 1727 S390OperandGenerator g(selector); |
| 1728 opcode = cont->Encode(opcode); | 1728 opcode = cont->Encode(opcode); |
| 1729 if (cont->IsBranch()) { | 1729 if (cont->IsBranch()) { |
| 1730 selector->Emit(opcode, g.NoOutput(), left, right, | 1730 selector->Emit(opcode, g.NoOutput(), left, right, |
| 1731 g.Label(cont->true_block()), g.Label(cont->false_block())); | 1731 g.Label(cont->true_block()), g.Label(cont->false_block())); |
| 1732 } else if (cont->IsDeoptimize()) { | 1732 } else if (cont->IsDeoptimize()) { |
| 1733 selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->kind(), | 1733 selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->reason(), |
| 1734 cont->reason(), cont->frame_state()); | 1734 cont->frame_state()); |
| 1735 } else if (cont->IsSet()) { | 1735 } else if (cont->IsSet()) { |
| 1736 selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right); | 1736 selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right); |
| 1737 } else { | 1737 } else { |
| 1738 DCHECK(cont->IsTrap()); | 1738 DCHECK(cont->IsTrap()); |
| 1739 selector->Emit(opcode, g.NoOutput(), left, right, | 1739 selector->Emit(opcode, g.NoOutput(), left, right, |
| 1740 g.UseImmediate(cont->trap_id())); | 1740 g.UseImmediate(cont->trap_id())); |
| 1741 } | 1741 } |
| 1742 } | 1742 } |
| 1743 | 1743 |
| 1744 // Shared routine for multiple word compare operations. | 1744 // Shared routine for multiple word compare operations. |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1999 | 1999 |
| 2000 } // namespace | 2000 } // namespace |
| 2001 | 2001 |
| 2002 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, | 2002 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, |
| 2003 BasicBlock* fbranch) { | 2003 BasicBlock* fbranch) { |
| 2004 FlagsContinuation cont(kNotEqual, tbranch, fbranch); | 2004 FlagsContinuation cont(kNotEqual, tbranch, fbranch); |
| 2005 VisitWord32CompareZero(this, branch, branch->InputAt(0), &cont); | 2005 VisitWord32CompareZero(this, branch, branch->InputAt(0), &cont); |
| 2006 } | 2006 } |
| 2007 | 2007 |
| 2008 void InstructionSelector::VisitDeoptimizeIf(Node* node) { | 2008 void InstructionSelector::VisitDeoptimizeIf(Node* node) { |
| 2009 DeoptimizeParameters p = DeoptimizeParametersOf(node->op()); | |
| 2010 FlagsContinuation cont = FlagsContinuation::ForDeoptimize( | 2009 FlagsContinuation cont = FlagsContinuation::ForDeoptimize( |
| 2011 kNotEqual, p.kind(), p.reason(), node->InputAt(1)); | 2010 kNotEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); |
| 2012 VisitWordCompareZero(this, node, node->InputAt(0), &cont); | 2011 VisitWord32CompareZero(this, node, node->InputAt(0), &cont); |
| 2013 } | 2012 } |
| 2014 | 2013 |
| 2015 void InstructionSelector::VisitDeoptimizeUnless(Node* node) { | 2014 void InstructionSelector::VisitDeoptimizeUnless(Node* node) { |
| 2016 DeoptimizeParameters p = DeoptimizeParametersOf(node->op()); | |
| 2017 FlagsContinuation cont = FlagsContinuation::ForDeoptimize( | 2015 FlagsContinuation cont = FlagsContinuation::ForDeoptimize( |
| 2018 kEqual, p.kind(), p.reason(), node->InputAt(1)); | 2016 kEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); |
| 2019 VisitWordCompareZero(this, node, node->InputAt(0), &cont); | 2017 VisitWord32CompareZero(this, node, node->InputAt(0), &cont); |
| 2020 } | 2018 } |
| 2021 | 2019 |
| 2022 void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) { | 2020 void InstructionSelector::VisitTrapIf(Node* node, Runtime::FunctionId func_id) { |
| 2023 FlagsContinuation cont = | 2021 FlagsContinuation cont = |
| 2024 FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1)); | 2022 FlagsContinuation::ForTrap(kNotEqual, func_id, node->InputAt(1)); |
| 2025 VisitWord32CompareZero(this, node, node->InputAt(0), &cont); | 2023 VisitWord32CompareZero(this, node, node->InputAt(0), &cont); |
| 2026 } | 2024 } |
| 2027 | 2025 |
| 2028 void InstructionSelector::VisitTrapUnless(Node* node, | 2026 void InstructionSelector::VisitTrapUnless(Node* node, |
| 2029 Runtime::FunctionId func_id) { | 2027 Runtime::FunctionId func_id) { |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2319 // static | 2317 // static |
| 2320 MachineOperatorBuilder::AlignmentRequirements | 2318 MachineOperatorBuilder::AlignmentRequirements |
| 2321 InstructionSelector::AlignmentRequirements() { | 2319 InstructionSelector::AlignmentRequirements() { |
| 2322 return MachineOperatorBuilder::AlignmentRequirements:: | 2320 return MachineOperatorBuilder::AlignmentRequirements:: |
| 2323 FullUnalignedAccessSupport(); | 2321 FullUnalignedAccessSupport(); |
| 2324 } | 2322 } |
| 2325 | 2323 |
| 2326 } // namespace compiler | 2324 } // namespace compiler |
| 2327 } // namespace internal | 2325 } // namespace internal |
| 2328 } // namespace v8 | 2326 } // namespace v8 |
| OLD | NEW |