Index: src/code-stub-assembler.cc |
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc |
index f69cfe37f7e191e5f3857b4250283e7c4b4eb72d..dd4f33af38bcc6c4bee80eaf8fdfb6093bc0c32a 100644 |
--- a/src/code-stub-assembler.cc |
+++ b/src/code-stub-assembler.cc |
@@ -3341,6 +3341,18 @@ Node* CodeStubAssembler::IsNumberNormalized(Node* number) { |
return var_result.value(); |
} |
+Node* CodeStubAssembler::IsNumberPositive(Node* number) { |
+ CSA_ASSERT(this, IsNumber(number)); |
+ Node* const float_zero = Float64Constant(0.); |
+ return Select(TaggedIsSmi(number), |
+ [=] { return TaggedIsPositiveSmi(number); }, |
+ [=] { |
+ Node* v = LoadHeapNumberValue(number); |
+ return Float64GreaterThanOrEqual(v, float_zero); |
+ }, |
+ MachineRepresentation::kWord32); |
+} |
+ |
Node* CodeStubAssembler::StringCharCodeAt(Node* string, Node* index, |
ParameterMode parameter_mode) { |
if (parameter_mode == SMI_PARAMETERS) CSA_ASSERT(this, TaggedIsSmi(index)); |