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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 return Changed(node); | 141 return Changed(node); |
142 } | 142 } |
143 break; | 143 break; |
144 } | 144 } |
145 case IrOpcode::kCheckTaggedPointer: { | 145 case IrOpcode::kCheckTaggedPointer: { |
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); |
| 152 if (m.IsCheckTaggedPointer()) { |
| 153 ReplaceWithValue(node, input); |
| 154 return Replace(input); |
| 155 } |
151 break; | 156 break; |
152 } | 157 } |
153 case IrOpcode::kCheckTaggedSigned: { | 158 case IrOpcode::kCheckTaggedSigned: { |
154 Node* const input = node->InputAt(0); | 159 Node* const input = node->InputAt(0); |
155 if (DecideObjectIsSmi(input) == Decision::kTrue) { | 160 if (DecideObjectIsSmi(input) == Decision::kTrue) { |
156 ReplaceWithValue(node, input); | 161 ReplaceWithValue(node, input); |
157 return Replace(input); | 162 return Replace(input); |
158 } | 163 } |
159 NodeMatcher m(input); | 164 NodeMatcher m(input); |
160 if (m.IsConvertTaggedHoleToUndefined()) { | 165 if (m.IsCheckTaggedSigned()) { |
| 166 ReplaceWithValue(node, input); |
| 167 return Replace(input); |
| 168 } else if (m.IsConvertTaggedHoleToUndefined()) { |
161 node->ReplaceInput(0, m.InputAt(0)); | 169 node->ReplaceInput(0, m.InputAt(0)); |
162 return Changed(node); | 170 return Changed(node); |
163 } | 171 } |
164 break; | 172 break; |
165 } | 173 } |
166 case IrOpcode::kObjectIsSmi: { | 174 case IrOpcode::kObjectIsSmi: { |
167 Node* const input = node->InputAt(0); | 175 Node* const input = node->InputAt(0); |
168 switch (DecideObjectIsSmi(input)) { | 176 switch (DecideObjectIsSmi(input)) { |
169 case Decision::kTrue: | 177 case Decision::kTrue: |
170 return ReplaceBoolean(true); | 178 return ReplaceBoolean(true); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 return jsgraph()->isolate(); | 241 return jsgraph()->isolate(); |
234 } | 242 } |
235 | 243 |
236 MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const { | 244 MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const { |
237 return jsgraph()->machine(); | 245 return jsgraph()->machine(); |
238 } | 246 } |
239 | 247 |
240 } // namespace compiler | 248 } // namespace compiler |
241 } // namespace internal | 249 } // namespace internal |
242 } // namespace v8 | 250 } // namespace v8 |
OLD | NEW |