| OLD | NEW | 
|   1 // Copyright 2013 the V8 project authors. All rights reserved. |   1 // Copyright 2013 the V8 project authors. All rights reserved. | 
|   2 // Redistribution and use in source and binary forms, with or without |   2 // Redistribution and use in source and binary forms, with or without | 
|   3 // modification, are permitted provided that the following conditions are |   3 // modification, are permitted provided that the following conditions are | 
|   4 // met: |   4 // met: | 
|   5 // |   5 // | 
|   6 //     * Redistributions of source code must retain the above copyright |   6 //     * Redistributions of source code must retain the above copyright | 
|   7 //       notice, this list of conditions and the following disclaimer. |   7 //       notice, this list of conditions and the following disclaimer. | 
|   8 //     * Redistributions in binary form must reproduce the above |   8 //     * Redistributions in binary form must reproduce the above | 
|   9 //       copyright notice, this list of conditions and the following |   9 //       copyright notice, this list of conditions and the following | 
|  10 //       disclaimer in the documentation and/or other materials provided |  10 //       disclaimer in the documentation and/or other materials provided | 
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  42         Representation from = change->value()->representation(); |  42         Representation from = change->value()->representation(); | 
|  43         ASSERT(from.Equals(change->from())); |  43         ASSERT(from.Equals(change->from())); | 
|  44         if (from.IsSmiOrInteger32()) { |  44         if (from.IsSmiOrInteger32()) { | 
|  45           ASSERT(change->to().IsTagged() || |  45           ASSERT(change->to().IsTagged() || | 
|  46                  change->to().IsDouble() || |  46                  change->to().IsDouble() || | 
|  47                  change->to().IsSmiOrInteger32()); |  47                  change->to().IsSmiOrInteger32()); | 
|  48           ASSERT(visited_.IsEmpty()); |  48           ASSERT(visited_.IsEmpty()); | 
|  49           PropagateMinusZeroChecks(change->value()); |  49           PropagateMinusZeroChecks(change->value()); | 
|  50           visited_.Clear(); |  50           visited_.Clear(); | 
|  51         } |  51         } | 
 |  52       } else if (current->IsCompareMinusZeroAndBranch()) { | 
 |  53         HCompareMinusZeroAndBranch* check = | 
 |  54             HCompareMinusZeroAndBranch::cast(current); | 
 |  55         if (check->value()->representation().IsSmiOrInteger32()) { | 
 |  56           ASSERT(visited_.IsEmpty()); | 
 |  57           PropagateMinusZeroChecks(check->value()); | 
 |  58           visited_.Clear(); | 
 |  59         } | 
|  52       } |  60       } | 
|  53     } |  61     } | 
|  54   } |  62   } | 
|  55 } |  63 } | 
|  56  |  64  | 
|  57  |  65  | 
|  58 void HComputeMinusZeroChecksPhase::PropagateMinusZeroChecks(HValue* value) { |  66 void HComputeMinusZeroChecksPhase::PropagateMinusZeroChecks(HValue* value) { | 
|  59   for (HValue* current = value; |  67   for (HValue* current = value; | 
|  60        current != NULL && !visited_.Contains(current->id()); |  68        current != NULL && !visited_.Contains(current->id()); | 
|  61        current = current->EnsureAndPropagateNotMinusZero(&visited_)) { |  69        current = current->EnsureAndPropagateNotMinusZero(&visited_)) { | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
|  74     if (current->IsMul() || current->IsDiv() || current->IsMathMinMax()) { |  82     if (current->IsMul() || current->IsDiv() || current->IsMathMinMax()) { | 
|  75       HBinaryOperation* operation = HBinaryOperation::cast(current); |  83       HBinaryOperation* operation = HBinaryOperation::cast(current); | 
|  76       operation->EnsureAndPropagateNotMinusZero(&visited_); |  84       operation->EnsureAndPropagateNotMinusZero(&visited_); | 
|  77       PropagateMinusZeroChecks(operation->left()); |  85       PropagateMinusZeroChecks(operation->left()); | 
|  78       PropagateMinusZeroChecks(operation->right()); |  86       PropagateMinusZeroChecks(operation->right()); | 
|  79     } |  87     } | 
|  80   } |  88   } | 
|  81 } |  89 } | 
|  82  |  90  | 
|  83 } }  // namespace v8::internal |  91 } }  // namespace v8::internal | 
| OLD | NEW |