Commit 934f375a authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

PPC/s390: [wasm-c-api] Faster C-to-Wasm entry

Port e304d80e

Original Commit Message:

    powered by a new function Execution::CallWasm and a corresponding,
    Turbofan-generated CWasmEntry stub. This entirely sidesteps the
    traditional Execution::Invoke -> JSEntryStub path.

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

Change-Id: I87c85f3506c4e4dae12e462dd3c7790bc9ab25d1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1680798Reviewed-by: 's avatarJunliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#62429}
parent 1a7b2401
...@@ -2326,14 +2326,20 @@ void CodeGenerator::AssembleConstructFrame() { ...@@ -2326,14 +2326,20 @@ void CodeGenerator::AssembleConstructFrame() {
auto call_descriptor = linkage()->GetIncomingDescriptor(); auto call_descriptor = linkage()->GetIncomingDescriptor();
if (frame_access_state()->has_frame()) { if (frame_access_state()->has_frame()) {
if (call_descriptor->IsCFunctionCall()) { if (call_descriptor->IsCFunctionCall()) {
__ mflr(r0); if (info()->GetOutputStackFrameType() == StackFrame::C_WASM_ENTRY) {
if (FLAG_enable_embedded_constant_pool) { __ StubPrologue(StackFrame::C_WASM_ENTRY);
__ Push(r0, fp, kConstantPoolRegister); // Reserve stack space for saving the c_entry_fp later.
// Adjust FP to point to saved FP. __ addi(sp, sp, Operand(-kSystemPointerSize));
__ subi(fp, sp, Operand(StandardFrameConstants::kConstantPoolOffset));
} else { } else {
__ Push(r0, fp); __ mflr(r0);
__ mr(fp, sp); if (FLAG_enable_embedded_constant_pool) {
__ Push(r0, fp, kConstantPoolRegister);
// Adjust FP to point to saved FP.
__ subi(fp, sp, Operand(StandardFrameConstants::kConstantPoolOffset));
} else {
__ Push(r0, fp);
__ mr(fp, sp);
}
} }
} else if (call_descriptor->IsJSFunctionCall()) { } else if (call_descriptor->IsJSFunctionCall()) {
__ Prologue(); __ Prologue();
......
...@@ -3024,8 +3024,14 @@ void CodeGenerator::AssembleConstructFrame() { ...@@ -3024,8 +3024,14 @@ void CodeGenerator::AssembleConstructFrame() {
if (frame_access_state()->has_frame()) { if (frame_access_state()->has_frame()) {
if (call_descriptor->IsCFunctionCall()) { if (call_descriptor->IsCFunctionCall()) {
__ Push(r14, fp); if (info()->GetOutputStackFrameType() == StackFrame::C_WASM_ENTRY) {
__ LoadRR(fp, sp); __ StubPrologue(StackFrame::C_WASM_ENTRY);
// Reserve stack space for saving the c_entry_fp later.
__ lay(sp, MemOperand(sp, -kSystemPointerSize));
} else {
__ Push(r14, fp);
__ LoadRR(fp, sp);
}
} else if (call_descriptor->IsJSFunctionCall()) { } else if (call_descriptor->IsJSFunctionCall()) {
__ Prologue(ip); __ Prologue(ip);
if (call_descriptor->PushArgumentCount()) { if (call_descriptor->PushArgumentCount()) {
......
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