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

Unified Diff: src/code-stub-assembler.cc

Issue 2372543002: [stubs] Add SmiMax and refactor SmiMin to use Select (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/code-stub-assembler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/code-stub-assembler.cc
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
index e81b04dd44b80bcd17bd4a7a2088fb0995449f95..f8b344d2fde89dd8ae46bc1da8c274f2278be9ef 100644
--- a/src/code-stub-assembler.cc
+++ b/src/code-stub-assembler.cc
@@ -357,18 +357,15 @@ Node* CodeStubAssembler::SmiLessThanOrEqual(Node* a, Node* b) {
return IntPtrLessThanOrEqual(a, b);
}
+Node* CodeStubAssembler::SmiMax(Node* a, Node* b) {
+ Variable max(this, MachineRepresentation::kTagged);
+ max.Bind(Select(SmiLessThan(a, b), b, a));
Igor Sheludko 2016/09/27 11:40:03 I guess you can just return a Select node.
jgruber 2016/09/27 13:35:46 Done.
+ return max.value();
+}
+
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);
+ min.Bind(Select(SmiLessThan(a, b), a, b));
Igor Sheludko 2016/09/27 11:40:03 Same here.
jgruber 2016/09/27 13:35:46 Done.
return min.value();
}
« no previous file with comments | « src/code-stub-assembler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698