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

Unified Diff: src/hydrogen-instructions.cc

Issue 9110008: Inline Math.max and Math.min in crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 1ff7f16fdf4195f19184eefe8c72093db641c71d..f74c21cc6604d9d39a87e1e60a233154abb0b77a 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -955,6 +955,23 @@ Range* HPhi::InferRange() {
}
+Range* HMathMinMax::InferRange() {
+ Range* a = left()->range();
+ Range* b = right()->range();
+ Range* res = NULL;
+ if (op_ == kMathMin) {
+ res = new Range((a->lower() < b->lower()) ? a->lower() : b->lower(),
+ (a->upper() < b->upper()) ? a->upper() : b->upper());
+ res->set_can_be_minus_zero(a->CanBeMinusZero() || b->CanBeMinusZero());
+ } else {
+ res = new Range((a->lower() > b->lower()) ? a->lower() : b->lower(),
+ (a->upper() > b->upper()) ? a->upper() : b->upper());
+ res->set_can_be_minus_zero(a->CanBeMinusZero() && b->CanBeMinusZero());
+ }
+ return res;
+}
+
+
Range* HAdd::InferRange() {
if (representation().IsInteger32()) {
Range* a = left()->range();
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698