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 23 matching lines...) Expand all Loading... |
34 const ZoneList<HBasicBlock*>* blocks(graph()->blocks()); | 34 const ZoneList<HBasicBlock*>* blocks(graph()->blocks()); |
35 for (int i = 0; i < blocks->length(); ++i) { | 35 for (int i = 0; i < blocks->length(); ++i) { |
36 for (HInstructionIterator it(blocks->at(i)); !it.Done(); it.Advance()) { | 36 for (HInstructionIterator it(blocks->at(i)); !it.Done(); it.Advance()) { |
37 HInstruction* current = it.Current(); | 37 HInstruction* current = it.Current(); |
38 if (current->IsChange()) { | 38 if (current->IsChange()) { |
39 HChange* change = HChange::cast(current); | 39 HChange* change = HChange::cast(current); |
40 // Propagate flags for negative zero checks upwards from conversions | 40 // Propagate flags for negative zero checks upwards from conversions |
41 // int32-to-tagged and int32-to-double. | 41 // int32-to-tagged and int32-to-double. |
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.IsInteger32()) { | 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().IsSmi()); | 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 } | 52 } |
53 } | 53 } |
54 } | 54 } |
55 } | 55 } |
56 | 56 |
57 | 57 |
(...skipping 16 matching lines...) Expand all Loading... |
74 if (current->IsMul() || current->IsDiv() || current->IsMathMinMax()) { | 74 if (current->IsMul() || current->IsDiv() || current->IsMathMinMax()) { |
75 HBinaryOperation* operation = HBinaryOperation::cast(current); | 75 HBinaryOperation* operation = HBinaryOperation::cast(current); |
76 operation->EnsureAndPropagateNotMinusZero(&visited_); | 76 operation->EnsureAndPropagateNotMinusZero(&visited_); |
77 PropagateMinusZeroChecks(operation->left()); | 77 PropagateMinusZeroChecks(operation->left()); |
78 PropagateMinusZeroChecks(operation->right()); | 78 PropagateMinusZeroChecks(operation->right()); |
79 } | 79 } |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 } } // namespace v8::internal | 83 } } // namespace v8::internal |
OLD | NEW |