Index: src/code-stub-assembler.cc |
diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc |
index 79d2b7324a51e446b8d0a6e32a3a70d3136d45dc..1cfb70d7a5c22340d799b60bd39bdef69441c91e 100644 |
--- a/src/code-stub-assembler.cc |
+++ b/src/code-stub-assembler.cc |
@@ -4467,6 +4467,22 @@ Node* CodeStubAssembler::ToString(Node* context, Node* input) { |
return result.value(); |
} |
+Node* CodeStubAssembler::ToString_Inline(Node* const context, |
+ Node* const input) { |
+ VARIABLE(var_result, MachineRepresentation::kTagged, input); |
+ Label stub_call(this, Label::kDeferred), out(this); |
+ |
+ GotoIf(TaggedIsSmi(input), &stub_call); |
+ Branch(IsString(input), &out, &stub_call); |
+ |
+ BIND(&stub_call); |
+ var_result.Bind(CallBuiltin(Builtins::kToString, context, input)); |
+ Goto(&out); |
+ |
+ BIND(&out); |
+ return var_result.value(); |
+} |
+ |
Node* CodeStubAssembler::JSReceiverToPrimitive(Node* context, Node* input) { |
Label if_isreceiver(this, Label::kDeferred), if_isnotreceiver(this); |
VARIABLE(result, MachineRepresentation::kTagged); |
@@ -4544,6 +4560,15 @@ Node* CodeStubAssembler::ToSmiLength(Node* input, Node* const context, |
return result.value(); |
} |
+Node* CodeStubAssembler::ToLength_Inline(Node* const context, |
+ Node* const input) { |
+ Node* const smi_zero = SmiConstant(0); |
+ return Select( |
+ TaggedIsSmi(input), [=] { return SmiMax(input, smi_zero); }, |
+ [=] { return CallBuiltin(Builtins::kToLength, context, input); }, |
+ MachineRepresentation::kTagged); |
+} |
+ |
Node* CodeStubAssembler::ToInteger(Node* context, Node* input, |
ToIntegerTruncationMode mode) { |
// We might need to loop once for ToNumber conversion. |