Commit 3f19a4be authored by Junliang Yan's avatar Junliang Yan Committed by Commit Bot

PPC/s390: Support non-default MicrotaskQueue on RunMicrotasks builtin

Port fab59bbb

Original Commit Message:

    The previous implementation of MicrotaskQueue::RunMicrotasks() didn't
    support non-default MicrotaskQueue as RunMicrotasks builtin couldn't
    take a parameter.

    This CL updates the entry trampoline for RunMicrotasks builtin to pass
    a MicrotaskQueue parameter to support non-default one.

R=tzik@chromium.org, joransiu@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: Id30e746879b1a17921320eac6c6f6c30e56961cc
Reviewed-on: https://chromium-review.googlesource.com/c/1417385Reviewed-by: 's avatarJoran Siu <joransiu@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#58894}
parent 0896599f
...@@ -543,12 +543,16 @@ namespace { ...@@ -543,12 +543,16 @@ namespace {
// Address root_register_value, MicrotaskQueue* microtask_queue)>; // Address root_register_value, MicrotaskQueue* microtask_queue)>;
void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type, void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type,
Builtins::Name entry_trampoline) { Builtins::Name entry_trampoline) {
// The register state is either:
// r3: root_register_value // r3: root_register_value
// r4: code entry // r4: code entry
// r5: function // r5: function
// r6: receiver // r6: receiver
// r7: argc // r7: argc
// r8: argv // r8: argv
// or
// r3: root_register_value
// r4: microtask_queue
Label invoke, handler_entry, exit; Label invoke, handler_entry, exit;
...@@ -659,13 +663,6 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type, ...@@ -659,13 +663,6 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type,
// Notice that we cannot store a reference to the trampoline code directly in // Notice that we cannot store a reference to the trampoline code directly in
// this stub, because runtime stubs are not traversed when doing GC. // this stub, because runtime stubs are not traversed when doing GC.
// Expected registers by Builtins::JSEntryTrampoline
// r4: code entry
// r5: function
// r6: receiver
// r7: argc
// r8: argv
//
// Invoke the function by calling through JS entry trampoline builtin and // Invoke the function by calling through JS entry trampoline builtin and
// pop the faked function when we return. // pop the faked function when we return.
Handle<Code> trampoline_code = Handle<Code> trampoline_code =
...@@ -843,7 +840,11 @@ void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { ...@@ -843,7 +840,11 @@ void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
} }
void Builtins::Generate_RunMicrotasksTrampoline(MacroAssembler* masm) { void Builtins::Generate_RunMicrotasksTrampoline(MacroAssembler* masm) {
// This expects two C++ function parameters passed by Invoke() in
// execution.cc.
// r3: root_register_value
// r4: microtask_queue // r4: microtask_queue
__ mr(RunMicrotasksDescriptor::MicrotaskQueueRegister(), r4); __ mr(RunMicrotasksDescriptor::MicrotaskQueueRegister(), r4);
__ Jump(BUILTIN_CODE(masm->isolate(), RunMicrotasks), RelocInfo::CODE_TARGET); __ Jump(BUILTIN_CODE(masm->isolate(), RunMicrotasks), RelocInfo::CODE_TARGET);
} }
......
...@@ -548,12 +548,16 @@ constexpr int kPushedStackSpace = ...@@ -548,12 +548,16 @@ constexpr int kPushedStackSpace =
// Address root_register_value, MicrotaskQueue* microtask_queue)>; // Address root_register_value, MicrotaskQueue* microtask_queue)>;
void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type, void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type,
Builtins::Name entry_trampoline) { Builtins::Name entry_trampoline) {
// The register state is either:
// r2: root register value // r2: root register value
// r3: code entry // r3: code entry
// r4: function // r4: function
// r5: receiver // r5: receiver
// r6: argc // r6: argc
// [sp + 20 * kSystemPointerSize]: argv // [sp + 20 * kSystemPointerSize]: argv
// or
// r2: root_register_value
// r3: microtask_queue
Label invoke, handler_entry, exit; Label invoke, handler_entry, exit;
...@@ -679,13 +683,6 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type, ...@@ -679,13 +683,6 @@ void Generate_JSEntryVariant(MacroAssembler* masm, StackFrame::Type type,
// Notice that we cannot store a reference to the trampoline code directly in // Notice that we cannot store a reference to the trampoline code directly in
// this stub, because runtime stubs are not traversed when doing GC. // this stub, because runtime stubs are not traversed when doing GC.
// Expected registers by Builtins::JSEntryTrampoline
// r2: code entry
// r3: function
// r4: receiver
// r5: argc
// r6: argv
//
// Invoke the function by calling through JS entry trampoline builtin and // Invoke the function by calling through JS entry trampoline builtin and
// pop the faked function when we return. // pop the faked function when we return.
Handle<Code> trampoline_code = Handle<Code> trampoline_code =
...@@ -893,8 +890,12 @@ void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) { ...@@ -893,8 +890,12 @@ void Builtins::Generate_JSConstructEntryTrampoline(MacroAssembler* masm) {
} }
void Builtins::Generate_RunMicrotasksTrampoline(MacroAssembler* masm) { void Builtins::Generate_RunMicrotasksTrampoline(MacroAssembler* masm) {
// This expects two C++ function parameters passed by Invoke() in
// execution.cc.
// r2: root_register_value
// r3: microtask_queue // r3: microtask_queue
__ mov(RunMicrotasksDescriptor::MicrotaskQueueRegister(), Operand(r3));
__ LoadRR(RunMicrotasksDescriptor::MicrotaskQueueRegister(), r3);
__ Jump(BUILTIN_CODE(masm->isolate(), RunMicrotasks), RelocInfo::CODE_TARGET); __ Jump(BUILTIN_CODE(masm->isolate(), RunMicrotasks), RelocInfo::CODE_TARGET);
} }
......
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