| 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 6812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6823 HInstruction* sqrt = | 6823 HInstruction* sqrt = |
| 6824 HUnaryMathOperation::New(zone(), context, left, kMathPowHalf); | 6824 HUnaryMathOperation::New(zone(), context, left, kMathPowHalf); |
| 6825 AddInstruction(sqrt); | 6825 AddInstruction(sqrt); |
| 6826 // MathPowHalf doesn't have side effects so there's no need for | 6826 // MathPowHalf doesn't have side effects so there's no need for |
| 6827 // an environment simulation here. | 6827 // an environment simulation here. |
| 6828 ASSERT(!sqrt->HasObservableSideEffects()); | 6828 ASSERT(!sqrt->HasObservableSideEffects()); |
| 6829 result = HDiv::New(zone(), context, one, sqrt); | 6829 result = HDiv::New(zone(), context, one, sqrt); |
| 6830 } else if (exponent == 2.0) { | 6830 } else if (exponent == 2.0) { |
| 6831 result = HMul::New(zone(), context, left, left); | 6831 result = HMul::New(zone(), context, left, left); |
| 6832 } | 6832 } |
| 6833 } else if (right->EqualsInteger32Constant(2)) { | |
| 6834 result = HMul::New(zone(), context, left, left); | |
| 6835 } | 6833 } |
| 6836 | 6834 |
| 6837 if (result == NULL) { | 6835 if (result == NULL) { |
| 6838 result = HPower::New(zone(), context, left, right); | 6836 result = HPower::New(zone(), context, left, right); |
| 6839 } | 6837 } |
| 6840 ast_context()->ReturnInstruction(result, expr->id()); | 6838 ast_context()->ReturnInstruction(result, expr->id()); |
| 6841 return true; | 6839 return true; |
| 6842 } | 6840 } |
| 6843 break; | 6841 break; |
| 6844 case kMathRandom: | 6842 case kMathRandom: |
| (...skipping 3020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9865 if (ShouldProduceTraceOutput()) { | 9863 if (ShouldProduceTraceOutput()) { |
| 9866 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 9864 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 9867 } | 9865 } |
| 9868 | 9866 |
| 9869 #ifdef DEBUG | 9867 #ifdef DEBUG |
| 9870 graph_->Verify(false); // No full verify. | 9868 graph_->Verify(false); // No full verify. |
| 9871 #endif | 9869 #endif |
| 9872 } | 9870 } |
| 9873 | 9871 |
| 9874 } } // namespace v8::internal | 9872 } } // namespace v8::internal |
| OLD | NEW |