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

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

Issue 2562393002: [wasm] Introduce the TrapIf and TrapUnless operators to generate trap code. (Closed)
Patch Set: Copy the trap-location.js mjsunit test to use trap-if Created 4 years 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/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 9
10 namespace v8 { 10 namespace v8 {
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
1509 kNotEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); 1509 kNotEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1));
1510 VisitWordCompareZero(this, node, node->InputAt(0), &cont); 1510 VisitWordCompareZero(this, node, node->InputAt(0), &cont);
1511 } 1511 }
1512 1512
1513 void InstructionSelector::VisitDeoptimizeUnless(Node* node) { 1513 void InstructionSelector::VisitDeoptimizeUnless(Node* node) {
1514 FlagsContinuation cont = FlagsContinuation::ForDeoptimize( 1514 FlagsContinuation cont = FlagsContinuation::ForDeoptimize(
1515 kEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1)); 1515 kEqual, DeoptimizeReasonOf(node->op()), node->InputAt(1));
1516 VisitWordCompareZero(this, node, node->InputAt(0), &cont); 1516 VisitWordCompareZero(this, node, node->InputAt(0), &cont);
1517 } 1517 }
1518 1518
1519 void InstructionSelector::VisitTrapIf(Node* node) { UNREACHABLE(); }
1520
1521 void InstructionSelector::VisitTrapUnless(Node* node) { UNREACHABLE(); }
1522
1519 void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) { 1523 void InstructionSelector::VisitSwitch(Node* node, const SwitchInfo& sw) {
1520 IA32OperandGenerator g(this); 1524 IA32OperandGenerator g(this);
1521 InstructionOperand value_operand = g.UseRegister(node->InputAt(0)); 1525 InstructionOperand value_operand = g.UseRegister(node->InputAt(0));
1522 1526
1523 // Emit either ArchTableSwitch or ArchLookupSwitch. 1527 // Emit either ArchTableSwitch or ArchLookupSwitch.
1524 size_t table_space_cost = 4 + sw.value_range; 1528 size_t table_space_cost = 4 + sw.value_range;
1525 size_t table_time_cost = 3; 1529 size_t table_time_cost = 3;
1526 size_t lookup_space_cost = 3 + 2 * sw.case_count; 1530 size_t lookup_space_cost = 3 + 2 * sw.case_count;
1527 size_t lookup_time_cost = sw.case_count; 1531 size_t lookup_time_cost = sw.case_count;
1528 if (sw.case_count > 4 && 1532 if (sw.case_count > 4 &&
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 // static 1766 // static
1763 MachineOperatorBuilder::AlignmentRequirements 1767 MachineOperatorBuilder::AlignmentRequirements
1764 InstructionSelector::AlignmentRequirements() { 1768 InstructionSelector::AlignmentRequirements() {
1765 return MachineOperatorBuilder::AlignmentRequirements:: 1769 return MachineOperatorBuilder::AlignmentRequirements::
1766 FullUnalignedAccessSupport(); 1770 FullUnalignedAccessSupport();
1767 } 1771 }
1768 1772
1769 } // namespace compiler 1773 } // namespace compiler
1770 } // namespace internal 1774 } // namespace internal
1771 } // namespace v8 1775 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698