Index: src/code-stub-assembler.cc |
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc |
index 75f56479e144f72c2a15d540cece42bc86290e6b..90f97240acf03afb54803c049834482196e289bf 100644 |
--- a/src/code-stub-assembler.cc |
+++ b/src/code-stub-assembler.cc |
@@ -349,19 +349,12 @@ Node* CodeStubAssembler::SmiLessThanOrEqual(Node* a, Node* b) { |
return IntPtrLessThanOrEqual(a, b); |
} |
+Node* CodeStubAssembler::SmiMax(Node* a, Node* b) { |
+ return Select(SmiLessThan(a, b), b, a); |
+} |
+ |
Node* CodeStubAssembler::SmiMin(Node* a, Node* b) { |
- // TODO(bmeurer): Consider using Select once available. |
- Variable min(this, MachineRepresentation::kTagged); |
- Label if_a(this), if_b(this), join(this); |
- BranchIfSmiLessThan(a, b, &if_a, &if_b); |
- Bind(&if_a); |
- min.Bind(a); |
- Goto(&join); |
- Bind(&if_b); |
- min.Bind(b); |
- Goto(&join); |
- Bind(&join); |
- return min.value(); |
+ return Select(SmiLessThan(a, b), a, b); |
} |
Node* CodeStubAssembler::SmiMod(Node* a, Node* b) { |