Commit 97c21548 authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC/s390: [builtins] NonNumberToNumber and StringToNumber now use CallRuntime...

PPC/s390: [builtins] NonNumberToNumber and StringToNumber now use CallRuntime instead of TailCallRuntime

Port b5c69cbf

Original commit message:

    With the tail call, pointers to the JS heap could be pushed on a
    js-to-wasm frame. On the js-to-wasm frame, however, this pointer would
    not be updated by the GC.

R=ahaas@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=617084
LOG=N

Review-Url: https://codereview.chromium.org/2085183002
Cr-Commit-Position: refs/heads/master@{#37160}
parent d0b8e7fb
...@@ -2772,8 +2772,15 @@ void Builtins::Generate_StringToNumber(MacroAssembler* masm) { ...@@ -2772,8 +2772,15 @@ void Builtins::Generate_StringToNumber(MacroAssembler* masm) {
__ blr(); __ blr();
__ bind(&runtime); __ bind(&runtime);
__ push(r3); // Push argument. {
__ TailCallRuntime(Runtime::kStringToNumber); FrameScope frame(masm, StackFrame::INTERNAL);
// Push argument.
__ push(r3);
// We cannot use a tail call here because this builtin can also be called
// from wasm.
__ CallRuntime(Runtime::kStringToNumber);
}
__ Ret();
} }
// static // static
...@@ -2810,8 +2817,15 @@ void Builtins::Generate_NonNumberToNumber(MacroAssembler* masm) { ...@@ -2810,8 +2817,15 @@ void Builtins::Generate_NonNumberToNumber(MacroAssembler* masm) {
__ blr(); __ blr();
__ bind(&not_oddball); __ bind(&not_oddball);
__ push(r3); // Push argument. {
__ TailCallRuntime(Runtime::kToNumber); FrameScope frame(masm, StackFrame::INTERNAL);
// Push argument.
__ push(r3);
// We cannot use a tail call here because this builtin can also be called
// from wasm.
__ CallRuntime(Runtime::kToNumber);
}
__ Ret();
} }
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
......
...@@ -2732,8 +2732,15 @@ void Builtins::Generate_StringToNumber(MacroAssembler* masm) { ...@@ -2732,8 +2732,15 @@ void Builtins::Generate_StringToNumber(MacroAssembler* masm) {
__ Ret(); __ Ret();
__ bind(&runtime); __ bind(&runtime);
__ push(r2); // Push argument. {
__ TailCallRuntime(Runtime::kStringToNumber); FrameScope frame(masm, StackFrame::INTERNAL);
// Push argument.
__ push(r2);
// We cannot use a tail call here because this builtin can also be called
// from wasm.
__ CallRuntime(Runtime::kStringToNumber);
}
__ Ret();
} }
// static // static
...@@ -2770,8 +2777,15 @@ void Builtins::Generate_NonNumberToNumber(MacroAssembler* masm) { ...@@ -2770,8 +2777,15 @@ void Builtins::Generate_NonNumberToNumber(MacroAssembler* masm) {
__ Ret(); __ Ret();
__ bind(&not_oddball); __ bind(&not_oddball);
__ push(r2); // Push argument. {
__ TailCallRuntime(Runtime::kToNumber); FrameScope frame(masm, StackFrame::INTERNAL);
// Push argument.
__ push(r2);
// We cannot use a tail call here because this builtin can also be called
// from wasm.
__ CallRuntime(Runtime::kToNumber);
}
__ Ret();
} }
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment