OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2491 stream->Add("B%d", SuccessorAt(0)->block_id()); | 2491 stream->Add("B%d", SuccessorAt(0)->block_id()); |
2492 } | 2492 } |
2493 | 2493 |
2494 | 2494 |
2495 void HCompareIDAndBranch::InferRepresentation(HInferRepresentation* h_infer) { | 2495 void HCompareIDAndBranch::InferRepresentation(HInferRepresentation* h_infer) { |
2496 Representation left_rep = left()->representation(); | 2496 Representation left_rep = left()->representation(); |
2497 Representation right_rep = right()->representation(); | 2497 Representation right_rep = right()->representation(); |
2498 Representation observed_left = observed_input_representation(0); | 2498 Representation observed_left = observed_input_representation(0); |
2499 Representation observed_right = observed_input_representation(1); | 2499 Representation observed_right = observed_input_representation(1); |
2500 | 2500 |
2501 Representation rep = Representation::Smi(); | 2501 Representation rep = Representation::None(); |
2502 if (observed_left.IsInteger32() && observed_right.IsInteger32()) { | 2502 rep = rep.generalize(observed_left); |
| 2503 rep = rep.generalize(observed_right); |
| 2504 if (rep.IsNone() || rep.IsSmiOrInteger32()) { |
2503 if (!left_rep.IsTagged()) rep = rep.generalize(left_rep); | 2505 if (!left_rep.IsTagged()) rep = rep.generalize(left_rep); |
2504 if (!right_rep.IsTagged()) rep = rep.generalize(right_rep); | 2506 if (!right_rep.IsTagged()) rep = rep.generalize(right_rep); |
2505 } else { | 2507 } else { |
2506 rep = Representation::Double(); | 2508 rep = Representation::Double(); |
2507 } | 2509 } |
2508 | 2510 |
2509 if (rep.IsDouble()) { | 2511 if (rep.IsDouble()) { |
2510 // According to the ES5 spec (11.9.3, 11.8.5), Equality comparisons (==, === | 2512 // According to the ES5 spec (11.9.3, 11.8.5), Equality comparisons (==, === |
2511 // and !=) have special handling of undefined, e.g. undefined == undefined | 2513 // and !=) have special handling of undefined, e.g. undefined == undefined |
2512 // is 'true'. Relational comparisons have a different semantic, first | 2514 // is 'true'. Relational comparisons have a different semantic, first |
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3802 case kBackingStore: | 3804 case kBackingStore: |
3803 if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString()); | 3805 if (!name_.is_null()) stream->Add(*String::cast(*name_)->ToCString()); |
3804 stream->Add("[backing-store]"); | 3806 stream->Add("[backing-store]"); |
3805 break; | 3807 break; |
3806 } | 3808 } |
3807 | 3809 |
3808 stream->Add("@%d", offset()); | 3810 stream->Add("@%d", offset()); |
3809 } | 3811 } |
3810 | 3812 |
3811 } } // namespace v8::internal | 3813 } } // namespace v8::internal |
OLD | NEW |