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 8840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8851 break; | 8851 break; |
8852 case Token::SUB: | 8852 case Token::SUB: |
8853 instr = AddUncasted<HSub>(left, right); | 8853 instr = AddUncasted<HSub>(left, right); |
8854 break; | 8854 break; |
8855 case Token::MUL: | 8855 case Token::MUL: |
8856 instr = AddUncasted<HMul>(left, right); | 8856 instr = AddUncasted<HMul>(left, right); |
8857 break; | 8857 break; |
8858 case Token::MOD: { | 8858 case Token::MOD: { |
8859 if (fixed_right_arg.has_value) { | 8859 if (fixed_right_arg.has_value) { |
8860 if (right->IsConstant()) { | 8860 if (right->IsConstant()) { |
8861 ASSERT_EQ(fixed_right_arg.value, | 8861 HConstant* c_right = HConstant::cast(right); |
8862 HConstant::cast(right)->Integer32Value()); | 8862 if (c_right->HasInteger32Value()) { |
| 8863 ASSERT_EQ(fixed_right_arg.value, c_right->Integer32Value()); |
| 8864 } |
8863 } else { | 8865 } else { |
8864 HConstant* fixed_right = Add<HConstant>( | 8866 HConstant* fixed_right = Add<HConstant>( |
8865 static_cast<int>(fixed_right_arg.value)); | 8867 static_cast<int>(fixed_right_arg.value)); |
8866 IfBuilder if_same(this); | 8868 IfBuilder if_same(this); |
8867 if_same.If<HCompareNumericAndBranch>(right, fixed_right, Token::EQ); | 8869 if_same.If<HCompareNumericAndBranch>(right, fixed_right, Token::EQ); |
8868 if_same.Then(); | 8870 if_same.Then(); |
8869 if_same.ElseDeopt("Unexpected RHS of binary operation"); | 8871 if_same.ElseDeopt("Unexpected RHS of binary operation"); |
8870 right = fixed_right; | 8872 right = fixed_right; |
8871 } | 8873 } |
8872 } | 8874 } |
(...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10806 if (ShouldProduceTraceOutput()) { | 10808 if (ShouldProduceTraceOutput()) { |
10807 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 10809 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
10808 } | 10810 } |
10809 | 10811 |
10810 #ifdef DEBUG | 10812 #ifdef DEBUG |
10811 graph_->Verify(false); // No full verify. | 10813 graph_->Verify(false); // No full verify. |
10812 #endif | 10814 #endif |
10813 } | 10815 } |
10814 | 10816 |
10815 } } // namespace v8::internal | 10817 } } // namespace v8::internal |
OLD | NEW |