Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: src/hydrogen.cc

Issue 22815032: Clean up the redundant Int32Constant check which is covered by double case (Closed) Base URL: https://github.com/v8/v8.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698