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

Side by Side Diff: src/compiler/s390/instruction-selector-s390.cc

Issue 2161543002: [turbofan] Add support for eager/soft deoptimization reasons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Do the ports properly Created 4 years, 5 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
« no previous file with comments | « src/compiler/s390/code-generator-s390.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 DCHECK_NE(0u, input_count); 143 DCHECK_NE(0u, input_count);
144 DCHECK_NE(0u, output_count); 144 DCHECK_NE(0u, output_count);
145 DCHECK_GE(arraysize(inputs), input_count); 145 DCHECK_GE(arraysize(inputs), input_count);
146 DCHECK_GE(arraysize(outputs), output_count); 146 DCHECK_GE(arraysize(outputs), output_count);
147 147
148 opcode = cont->Encode(opcode); 148 opcode = cont->Encode(opcode);
149 if (cont->IsDeoptimize()) { 149 if (cont->IsDeoptimize()) {
150 selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs, 150 selector->EmitDeoptimize(opcode, output_count, outputs, input_count, inputs,
151 cont->frame_state()); 151 cont->reason(), cont->frame_state());
152 } else { 152 } else {
153 selector->Emit(opcode, output_count, outputs, input_count, inputs); 153 selector->Emit(opcode, output_count, outputs, input_count, inputs);
154 } 154 }
155 } 155 }
156 156
157 // Shared routine for multiple binary operations. 157 // Shared routine for multiple binary operations.
158 template <typename Matcher> 158 template <typename Matcher>
159 void VisitBinop(InstructionSelector* selector, Node* node, ArchOpcode opcode, 159 void VisitBinop(InstructionSelector* selector, Node* node, ArchOpcode opcode,
160 ImmediateMode operand_mode) { 160 ImmediateMode operand_mode) {
161 FlagsContinuation cont; 161 FlagsContinuation cont;
(...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after
1358 // Shared routine for multiple compare operations. 1358 // Shared routine for multiple compare operations.
1359 void VisitCompare(InstructionSelector* selector, InstructionCode opcode, 1359 void VisitCompare(InstructionSelector* selector, InstructionCode opcode,
1360 InstructionOperand left, InstructionOperand right, 1360 InstructionOperand left, InstructionOperand right,
1361 FlagsContinuation* cont) { 1361 FlagsContinuation* cont) {
1362 S390OperandGenerator g(selector); 1362 S390OperandGenerator g(selector);
1363 opcode = cont->Encode(opcode); 1363 opcode = cont->Encode(opcode);
1364 if (cont->IsBranch()) { 1364 if (cont->IsBranch()) {
1365 selector->Emit(opcode, g.NoOutput(), left, right, 1365 selector->Emit(opcode, g.NoOutput(), left, right,
1366 g.Label(cont->true_block()), g.Label(cont->false_block())); 1366 g.Label(cont->true_block()), g.Label(cont->false_block()));
1367 } else if (cont->IsDeoptimize()) { 1367 } else if (cont->IsDeoptimize()) {
1368 selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, 1368 selector->EmitDeoptimize(opcode, g.NoOutput(), left, right, cont->reason(),
1369 cont->frame_state()); 1369 cont->frame_state());
1370 } else { 1370 } else {
1371 DCHECK(cont->IsSet()); 1371 DCHECK(cont->IsSet());
1372 selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right); 1372 selector->Emit(opcode, g.DefineAsRegister(cont->result()), left, right);
1373 } 1373 }
1374 } 1374 }
1375 1375
1376 // Shared routine for multiple word compare operations. 1376 // Shared routine for multiple word compare operations.
1377 void VisitWordCompare(InstructionSelector* selector, Node* node, 1377 void VisitWordCompare(InstructionSelector* selector, Node* node,
1378 InstructionCode opcode, FlagsContinuation* cont, 1378 InstructionCode opcode, FlagsContinuation* cont,
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 1590
1591 } // namespace 1591 } // namespace
1592 1592
1593 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, 1593 void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch,
1594 BasicBlock* fbranch) { 1594 BasicBlock* fbranch) {
1595 FlagsContinuation cont(kNotEqual, tbranch, fbranch); 1595 FlagsContinuation cont(kNotEqual, tbranch, fbranch);
1596 VisitWord32CompareZero(this, branch, branch->InputAt(0), &cont); 1596 VisitWord32CompareZero(this, branch, branch->InputAt(0), &cont);
1597 } 1597 }
1598 1598
1599 void InstructionSelector::VisitDeoptimizeIf(Node* node) { 1599 void InstructionSelector::VisitDeoptimizeIf(Node* node) {
1600 FlagsContinuation cont = 1600 FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
1601 FlagsContinuation::ForDeoptimize(kNotEqual, node->InputAt(1)); 1601 kNotEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1));
1602 VisitWord32CompareZero(this, node, node->InputAt(0), &cont); 1602 VisitWord32CompareZero(this, node, node->InputAt(0), &cont);
1603 } 1603 }
1604 1604
1605 void InstructionSelector::VisitDeoptimizeUnless(Node* node) { 1605 void InstructionSelector::VisitDeoptimizeUnless(Node* node) {
1606 FlagsContinuation cont = 1606 FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
1607 FlagsContinuation::ForDeoptimize(kEqual, node->InputAt(1)); 1607 kEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1));
1608 VisitWord32CompareZero(this, node, node->InputAt(0), &cont); 1608 VisitWord32CompareZero(this, node, node->InputAt(0), &cont);
1609 } 1609 }
1610 1610
1611 void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) { 1611 void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
1612 S390OperandGenerator g(this); 1612 S390OperandGenerator g(this);
1613 InstructionOperand value_operand = g.UseRegister(node->InputAt(0)); 1613 InstructionOperand value_operand = g.UseRegister(node->InputAt(0));
1614 1614
1615 // Emit either ArchTableSwitch or ArchLookupSwitch. 1615 // Emit either ArchTableSwitch or ArchLookupSwitch.
1616 size_t table_space_cost = 4 + sw.value_range; 1616 size_t table_space_cost = 4 + sw.value_range;
1617 size_t table_time_cost = 3; 1617 size_t table_time_cost = 3;
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1897 // static 1897 // static
1898 MachineOperatorBuilder::AlignmentRequirements 1898 MachineOperatorBuilder::AlignmentRequirements
1899 InstructionSelector::AlignmentRequirements() { 1899 InstructionSelector::AlignmentRequirements() {
1900 return MachineOperatorBuilder::AlignmentRequirements:: 1900 return MachineOperatorBuilder::AlignmentRequirements::
1901 FullUnalignedAccessSupport(); 1901 FullUnalignedAccessSupport();
1902 } 1902 }
1903 1903
1904 } // namespace compiler 1904 } // namespace compiler
1905 } // namespace internal 1905 } // namespace internal
1906 } // namespace v8 1906 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/s390/code-generator-s390.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698