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/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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 | 98 |
99 // Compare operators that can deopt in the middle the operation (e.g., | 99 // Compare operators that can deopt in the middle the operation (e.g., |
100 // as a result of lazy deopt in ToNumber conversion) need a second frame | 100 // as a result of lazy deopt in ToNumber conversion) need a second frame |
101 // state so that we can resume before the operation. | 101 // state so that we can resume before the operation. |
102 case IrOpcode::kJSGreaterThan: | 102 case IrOpcode::kJSGreaterThan: |
103 case IrOpcode::kJSGreaterThanOrEqual: | 103 case IrOpcode::kJSGreaterThanOrEqual: |
104 case IrOpcode::kJSLessThan: | 104 case IrOpcode::kJSLessThan: |
105 case IrOpcode::kJSLessThanOrEqual: | 105 case IrOpcode::kJSLessThanOrEqual: |
106 return 2; | 106 return 2; |
107 | 107 |
108 // Checked conversions. | |
109 case IrOpcode::kCheckedUint32ToInt32: | |
110 case IrOpcode::kCheckedFloat64ToInt32: | |
111 case IrOpcode::kCheckedTaggedToInt32: | |
112 case IrOpcode::kCheckedTaggedToFloat64: | |
113 return 1; | |
114 | |
115 default: | 108 default: |
116 return 0; | 109 return 0; |
117 } | 110 } |
118 } | 111 } |
119 | 112 |
120 | 113 |
121 // static | 114 // static |
122 int OperatorProperties::GetTotalInputCount(const Operator* op) { | 115 int OperatorProperties::GetTotalInputCount(const Operator* op) { |
123 return op->ValueInputCount() + GetContextInputCount(op) + | 116 return op->ValueInputCount() + GetContextInputCount(op) + |
124 GetFrameStateInputCount(op) + op->EffectInputCount() + | 117 GetFrameStateInputCount(op) + op->EffectInputCount() + |
125 op->ControlInputCount(); | 118 op->ControlInputCount(); |
126 } | 119 } |
127 | 120 |
128 | 121 |
129 // static | 122 // static |
130 bool OperatorProperties::IsBasicBlockBegin(const Operator* op) { | 123 bool OperatorProperties::IsBasicBlockBegin(const Operator* op) { |
131 Operator::Opcode const opcode = op->opcode(); | 124 Operator::Opcode const opcode = op->opcode(); |
132 return opcode == IrOpcode::kStart || opcode == IrOpcode::kEnd || | 125 return opcode == IrOpcode::kStart || opcode == IrOpcode::kEnd || |
133 opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop || | 126 opcode == IrOpcode::kDead || opcode == IrOpcode::kLoop || |
134 opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue || | 127 opcode == IrOpcode::kMerge || opcode == IrOpcode::kIfTrue || |
135 opcode == IrOpcode::kIfFalse || opcode == IrOpcode::kIfSuccess || | 128 opcode == IrOpcode::kIfFalse || opcode == IrOpcode::kIfSuccess || |
136 opcode == IrOpcode::kIfException || opcode == IrOpcode::kIfValue || | 129 opcode == IrOpcode::kIfException || opcode == IrOpcode::kIfValue || |
137 opcode == IrOpcode::kIfDefault; | 130 opcode == IrOpcode::kIfDefault; |
138 } | 131 } |
139 | 132 |
140 } // namespace compiler | 133 } // namespace compiler |
141 } // namespace internal | 134 } // namespace internal |
142 } // namespace v8 | 135 } // namespace v8 |
OLD | NEW |