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

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

Issue 1758333002: [compiler] Introduce code stubs for string relational comparisons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@AbstractRelationalComparison
Patch Set: Created 4 years, 10 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/compiler/code-stub-assembler.h ('k') | src/compiler/simplified-lowering.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-stub-assembler.cc
diff --git a/src/compiler/code-stub-assembler.cc b/src/compiler/code-stub-assembler.cc
index 9fcd2ad74b849f5114ebc7d057d52393b56850a7..ac10a98c5c0fc10b6aca5ebc258924806a0c3e1e 100644
--- a/src/compiler/code-stub-assembler.cc
+++ b/src/compiler/code-stub-assembler.cc
@@ -171,6 +171,21 @@ Node* CodeStubAssembler::SmiLessThanOrEqual(Node* a, Node* b) {
return IntPtrLessThanOrEqual(a, b);
}
+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();
+}
+
#define DEFINE_CODE_STUB_ASSEMBER_BINARY_OP(name) \
Node* CodeStubAssembler::name(Node* a, Node* b) { \
return raw_assembler_->name(a, b); \
@@ -424,6 +439,16 @@ Node* CodeStubAssembler::BitFieldDecode(Node* word32, uint32_t shift,
raw_assembler_->Int32Constant(shift));
}
+void CodeStubAssembler::BranchIfInt32LessThan(Node* a, Node* b, Label* if_true,
+ Label* if_false) {
+ Label if_lessthan(this), if_notlessthan(this);
+ Branch(Int32LessThan(a, b), &if_lessthan, &if_notlessthan);
+ Bind(&if_lessthan);
+ Goto(if_true);
+ Bind(&if_notlessthan);
+ Goto(if_false);
+}
+
void CodeStubAssembler::BranchIfSmiLessThan(Node* a, Node* b, Label* if_true,
Label* if_false) {
Label if_lessthan(this), if_notlessthan(this);
« no previous file with comments | « src/compiler/code-stub-assembler.h ('k') | src/compiler/simplified-lowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698