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

Side by Side Diff: src/compiler/operator-properties.cc

Issue 1921563002: [turbofan] Initial version of number type feedback. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add tests for the checks and fix check insertion Created 4 years, 6 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/compiler/operator-properties.h" 5 #include "src/compiler/operator-properties.h"
6 6
7 #include "src/compiler/js-operator.h" 7 #include "src/compiler/js-operator.h"
8 #include "src/compiler/linkage.h" 8 #include "src/compiler/linkage.h"
9 #include "src/compiler/opcodes.h" 9 #include "src/compiler/opcodes.h"
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 // Compare operators that can deopt in the middle the operation (e.g., 102 // Compare operators that can deopt in the middle the operation (e.g.,
103 // as a result of lazy deopt in ToNumber conversion) need a second frame 103 // as a result of lazy deopt in ToNumber conversion) need a second frame
104 // state so that we can resume before the operation. 104 // state so that we can resume before the operation.
105 case IrOpcode::kJSGreaterThan: 105 case IrOpcode::kJSGreaterThan:
106 case IrOpcode::kJSGreaterThanOrEqual: 106 case IrOpcode::kJSGreaterThanOrEqual:
107 case IrOpcode::kJSLessThan: 107 case IrOpcode::kJSLessThan:
108 case IrOpcode::kJSLessThanOrEqual: 108 case IrOpcode::kJSLessThanOrEqual:
109 return 2; 109 return 2;
110 110
111 // Simplified operators with type feedback.
112 case IrOpcode::kSpeculativeNumberAdd:
113 case IrOpcode::kSpeculativeNumberSubtract:
114 // Checked conversions.
115 case IrOpcode::kCheckedUint32ToInt32:
116 case IrOpcode::kCheckedFloat64ToInt32:
117 case IrOpcode::kCheckedTaggedToInt32:
118 case IrOpcode::kCheckedTaggedToFloat64:
119 return 1;
120
111 default: 121 default:
112 return 0; 122 return 0;
113 } 123 }
114 } 124 }
115 125
116 126
117 // static 127 // static
118 int OperatorProperties::GetTotalInputCount(const Operator* op) { 128 int OperatorProperties::GetTotalInputCount(const Operator* op) {
119 return op->ValueInputCount() + GetContextInputCount(op) + 129 return op->ValueInputCount() + GetContextInputCount(op) +
120 GetFrameStateInputCount(op) + op->EffectInputCount() + 130 GetFrameStateInputCount(op) + op->EffectInputCount() +
121 op->ControlInputCount(); 131 op->ControlInputCount();
122 } 132 }
123 133
124 134
125 // static 135 // static
126 bool OperatorProperties::IsBasicBlockBegin(const Operator* op) { 136 bool OperatorProperties::IsBasicBlockBegin(const Operator* op) {
127 Operator::Opcode const opcode = op->opcode(); 137 Operator::Opcode const opcode = op->opcode();
128 return opcode == IrOpcode::kStart || opcode == IrOpcode::kEnd || 138 return opcode == IrOpcode::kStart || opcode == IrOpcode::kEnd ||
129 opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop || 139 opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop ||
130 opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue || 140 opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue ||
131 opcode == IrOpcode::kIfFalse || opcode == IrOpcode::kIfSuccess || 141 opcode == IrOpcode::kIfFalse || opcode == IrOpcode::kIfSuccess ||
132 opcode == IrOpcode::kIfException || opcode == IrOpcode::kIfValue || 142 opcode == IrOpcode::kIfException || opcode == IrOpcode::kIfValue ||
133 opcode == IrOpcode::kIfDefault; 143 opcode == IrOpcode::kIfDefault;
134 } 144 }
135 145
136 } // namespace compiler 146 } // namespace compiler
137 } // namespace internal 147 } // namespace internal
138 } // namespace v8 148 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698