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/simplified-operator-reducer.h" | 5 #include "src/compiler/simplified-operator-reducer.h" |
6 | 6 |
7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 #include "src/compiler/machine-operator.h" | 8 #include "src/compiler/machine-operator.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 break; | 135 break; |
136 } | 136 } |
137 case IrOpcode::kCheckNumber: { | 137 case IrOpcode::kCheckNumber: { |
138 NodeMatcher m(node->InputAt(0)); | 138 NodeMatcher m(node->InputAt(0)); |
139 if (m.IsConvertTaggedHoleToUndefined()) { | 139 if (m.IsConvertTaggedHoleToUndefined()) { |
140 node->ReplaceInput(0, m.InputAt(0)); | 140 node->ReplaceInput(0, m.InputAt(0)); |
141 return Changed(node); | 141 return Changed(node); |
142 } | 142 } |
143 break; | 143 break; |
144 } | 144 } |
145 case IrOpcode::kCheckTaggedPointer: { | 145 case IrOpcode::kCheckHeapObject: { |
146 Node* const input = node->InputAt(0); | 146 Node* const input = node->InputAt(0); |
147 if (DecideObjectIsSmi(input) == Decision::kFalse) { | 147 if (DecideObjectIsSmi(input) == Decision::kFalse) { |
148 ReplaceWithValue(node, input); | 148 ReplaceWithValue(node, input); |
149 return Replace(input); | 149 return Replace(input); |
150 } | 150 } |
151 NodeMatcher m(input); | 151 NodeMatcher m(input); |
152 if (m.IsCheckTaggedPointer()) { | 152 if (m.IsCheckHeapObject()) { |
153 ReplaceWithValue(node, input); | 153 ReplaceWithValue(node, input); |
154 return Replace(input); | 154 return Replace(input); |
155 } | 155 } |
156 break; | 156 break; |
157 } | 157 } |
158 case IrOpcode::kCheckTaggedSigned: { | 158 case IrOpcode::kCheckSmi: { |
159 Node* const input = node->InputAt(0); | 159 Node* const input = node->InputAt(0); |
160 if (DecideObjectIsSmi(input) == Decision::kTrue) { | 160 if (DecideObjectIsSmi(input) == Decision::kTrue) { |
161 ReplaceWithValue(node, input); | 161 ReplaceWithValue(node, input); |
162 return Replace(input); | 162 return Replace(input); |
163 } | 163 } |
164 NodeMatcher m(input); | 164 NodeMatcher m(input); |
165 if (m.IsCheckTaggedSigned()) { | 165 if (m.IsCheckSmi()) { |
166 ReplaceWithValue(node, input); | 166 ReplaceWithValue(node, input); |
167 return Replace(input); | 167 return Replace(input); |
168 } else if (m.IsConvertTaggedHoleToUndefined()) { | 168 } else if (m.IsConvertTaggedHoleToUndefined()) { |
169 node->ReplaceInput(0, m.InputAt(0)); | 169 node->ReplaceInput(0, m.InputAt(0)); |
170 return Changed(node); | 170 return Changed(node); |
171 } | 171 } |
172 break; | 172 break; |
173 } | 173 } |
174 case IrOpcode::kObjectIsSmi: { | 174 case IrOpcode::kObjectIsSmi: { |
175 Node* const input = node->InputAt(0); | 175 Node* const input = node->InputAt(0); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 return jsgraph()->isolate(); | 241 return jsgraph()->isolate(); |
242 } | 242 } |
243 | 243 |
244 MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const { | 244 MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const { |
245 return jsgraph()->machine(); | 245 return jsgraph()->machine(); |
246 } | 246 } |
247 | 247 |
248 } // namespace compiler | 248 } // namespace compiler |
249 } // namespace internal | 249 } // namespace internal |
250 } // namespace v8 | 250 } // namespace v8 |
OLD | NEW |