| 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 #ifndef V8_COMPILER_NODE_MATCHERS_H_ | 5 #ifndef V8_COMPILER_NODE_MATCHERS_H_ |
| 6 #define V8_COMPILER_NODE_MATCHERS_H_ | 6 #define V8_COMPILER_NODE_MATCHERS_H_ |
| 7 | 7 |
| 8 #include "src/compiler/generic-node.h" | 8 #include "src/compiler/generic-node.h" |
| 9 #include "src/compiler/generic-node-inl.h" | 9 #include "src/compiler/generic-node-inl.h" |
| 10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 } else { | 287 } else { |
| 288 // (S + O) | 288 // (S + O) |
| 289 offset_ = right; | 289 offset_ = right; |
| 290 } | 290 } |
| 291 } else { | 291 } else { |
| 292 if (left->opcode() == AddMatcher::kOpcode && left->OwnedBy(node)) { | 292 if (left->opcode() == AddMatcher::kOpcode && left->OwnedBy(node)) { |
| 293 AddMatcher left_matcher(left); | 293 AddMatcher left_matcher(left); |
| 294 Node* left_left = left_matcher.left().node(); | 294 Node* left_left = left_matcher.left().node(); |
| 295 Node* left_right = left_matcher.right().node(); | 295 Node* left_right = left_matcher.right().node(); |
| 296 if (left_matcher.HasScaledInput() && left_left->OwnedBy(left)) { | 296 if (left_matcher.HasScaledInput() && left_left->OwnedBy(left)) { |
| 297 scaled_ = left_matcher.ScaledInput(); | |
| 298 scale_exponent_ = left_matcher.ScaleExponent(); | |
| 299 if (left_matcher.right().HasValue()) { | 297 if (left_matcher.right().HasValue()) { |
| 300 // ((S + C) + O) | 298 // ((S + C) + O) |
| 299 scaled_ = left_matcher.ScaledInput(); |
| 300 scale_exponent_ = left_matcher.ScaleExponent(); |
| 301 constant_ = left_right; | 301 constant_ = left_right; |
| 302 offset_ = right; | 302 offset_ = right; |
| 303 } else if (base_matcher.right().HasValue()) { | 303 } else if (base_matcher.right().HasValue()) { |
| 304 // ((S + O) + C) | 304 // ((S + O) + C) |
| 305 scaled_ = left_matcher.ScaledInput(); |
| 306 scale_exponent_ = left_matcher.ScaleExponent(); |
| 305 offset_ = left_right; | 307 offset_ = left_right; |
| 306 constant_ = right; | 308 constant_ = right; |
| 307 } else { | 309 } else { |
| 308 // (O + O) | 310 // (O + O) |
| 309 scaled_ = left; | 311 scaled_ = left; |
| 310 offset_ = right; | 312 offset_ = right; |
| 311 } | 313 } |
| 312 } else { | 314 } else { |
| 313 if (left_matcher.right().HasValue()) { | 315 if (left_matcher.right().HasValue()) { |
| 314 // ((O + C) + O) | 316 // ((O + C) + O) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 }; | 379 }; |
| 378 | 380 |
| 379 typedef ScaledWithOffsetMatcher<Int32AddMatcher> ScaledWithOffset32Matcher; | 381 typedef ScaledWithOffsetMatcher<Int32AddMatcher> ScaledWithOffset32Matcher; |
| 380 typedef ScaledWithOffsetMatcher<Int64AddMatcher> ScaledWithOffset64Matcher; | 382 typedef ScaledWithOffsetMatcher<Int64AddMatcher> ScaledWithOffset64Matcher; |
| 381 | 383 |
| 382 } // namespace compiler | 384 } // namespace compiler |
| 383 } // namespace internal | 385 } // namespace internal |
| 384 } // namespace v8 | 386 } // namespace v8 |
| 385 | 387 |
| 386 #endif // V8_COMPILER_NODE_MATCHERS_H_ | 388 #endif // V8_COMPILER_NODE_MATCHERS_H_ |
| OLD | NEW |