| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 } | 893 } |
| 894 | 894 |
| 895 RollBackTo(last_changed_range); | 895 RollBackTo(last_changed_range); |
| 896 } | 896 } |
| 897 | 897 |
| 898 | 898 |
| 899 void HRangeAnalysis::InferControlFlowRange(HTest* test, HBasicBlock* dest) { | 899 void HRangeAnalysis::InferControlFlowRange(HTest* test, HBasicBlock* dest) { |
| 900 ASSERT((test->FirstSuccessor() == dest) == (test->SecondSuccessor() != dest)); | 900 ASSERT((test->FirstSuccessor() == dest) == (test->SecondSuccessor() != dest)); |
| 901 if (test->value()->IsCompare()) { | 901 if (test->value()->IsCompare()) { |
| 902 HCompare* compare = HCompare::cast(test->value()); | 902 HCompare* compare = HCompare::cast(test->value()); |
| 903 Token::Value op = compare->token(); | 903 if (compare->GetInputRepresentation().IsInteger32()) { |
| 904 if (test->SecondSuccessor() == dest) { | 904 Token::Value op = compare->token(); |
| 905 op = Token::NegateCompareOp(op); | 905 if (test->SecondSuccessor() == dest) { |
| 906 op = Token::NegateCompareOp(op); |
| 907 } |
| 908 Token::Value inverted_op = Token::InvertCompareOp(op); |
| 909 InferControlFlowRange(op, compare->left(), compare->right()); |
| 910 InferControlFlowRange(inverted_op, compare->right(), compare->left()); |
| 906 } | 911 } |
| 907 Token::Value inverted_op = Token::InvertCompareOp(op); | |
| 908 InferControlFlowRange(op, compare->left(), compare->right()); | |
| 909 InferControlFlowRange(inverted_op, compare->right(), compare->left()); | |
| 910 } | 912 } |
| 911 } | 913 } |
| 912 | 914 |
| 913 | 915 |
| 914 // We know that value [op] other. Use this information to update the range on | 916 // We know that value [op] other. Use this information to update the range on |
| 915 // value. | 917 // value. |
| 916 void HRangeAnalysis::InferControlFlowRange(Token::Value op, | 918 void HRangeAnalysis::InferControlFlowRange(Token::Value op, |
| 917 HValue* value, | 919 HValue* value, |
| 918 HValue* other) { | 920 HValue* other) { |
| 919 Range temp_range; | 921 Range temp_range; |
| (...skipping 4974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5894 } | 5896 } |
| 5895 } | 5897 } |
| 5896 | 5898 |
| 5897 #ifdef DEBUG | 5899 #ifdef DEBUG |
| 5898 if (graph_ != NULL) graph_->Verify(); | 5900 if (graph_ != NULL) graph_->Verify(); |
| 5899 if (allocator_ != NULL) allocator_->Verify(); | 5901 if (allocator_ != NULL) allocator_->Verify(); |
| 5900 #endif | 5902 #endif |
| 5901 } | 5903 } |
| 5902 | 5904 |
| 5903 } } // namespace v8::internal | 5905 } } // namespace v8::internal |
| OLD | NEW |