Commit a74da818 authored by Anisha Rohra's avatar Anisha Rohra Committed by Commit Bot

s390: Liftoff: a baseline compiler for WebAssembly

Port 266e803e

Original Commit Message:
  This CL adds a first implementation of Liftoff, the new wasm baseline
  compiler, for x64 and ia32. It currently supports the most important
  i32 instructions and control instructions. Whenever it encounters an
  instruction it does not support yet, it aborts.
  In a subsequent CL, Liftoff will be called from the
  WasmCompilationUnit, falling back to Turbofan compilation if the
  baseline compiler bails out.

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

Change-Id: I35ad2b0230c37f523e24aa90b637a67e5ce59083
Reviewed-on: https://chromium-review.googlesource.com/735784Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarJunliang Yan <jyan@ca.ibm.com>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48935}
parent 9f3488d8
......@@ -2423,6 +2423,8 @@ v8_source_set("v8_base") {
"src/s390/macro-assembler-s390.h",
"src/s390/simulator-s390.cc",
"src/s390/simulator-s390.h",
"src/wasm/baseline/s390/liftoff-assembler-s390-defs.h",
"src/wasm/baseline/s390/liftoff-assembler-s390.h",
]
}
......
......@@ -1794,6 +1794,8 @@
's390/macro-assembler-s390.h',
's390/simulator-s390.cc',
's390/simulator-s390.h',
'wasm/baseline/s390/liftoff-assembler-s390-defs.h',
'wasm/baseline/s390/liftoff-assembler-s390.h',
],
}],
['OS=="win"', {
......
......@@ -31,6 +31,8 @@
#include "src/wasm/baseline/mips/liftoff-assembler-mips-defs.h"
#elif V8_TARGET_ARCH_MIPS64
#include "src/wasm/baseline/mips64/liftoff-assembler-mips64-defs.h"
#elif V8_TARGET_ARCH_S390
#include "src/wasm/baseline/s390/liftoff-assembler-s390-defs.h"
#else
#error Unsupported architecture.
#endif
......@@ -307,6 +309,8 @@ class LiftoffAssembler : public TurboAssembler {
#include "src/wasm/baseline/mips/liftoff-assembler-mips.h"
#elif V8_TARGET_ARCH_MIPS64
#include "src/wasm/baseline/mips64/liftoff-assembler-mips64.h"
#elif V8_TARGET_ARCH_S390
#include "src/wasm/baseline/s390/liftoff-assembler-s390.h"
#else
#error Unsupported architecture.
#endif
......
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_WASM_BASELINE_LIFTOFF_ASSEMBLER_S390_DEFS_H_
#define V8_WASM_BASELINE_LIFTOFF_ASSEMBLER_S390_DEFS_H_
#include "src/reglist.h"
namespace v8 {
namespace internal {
namespace wasm {
// TODO(clemensh): Implement the LiftoffAssembler on this platform.
static constexpr bool kLiftoffAssemblerImplementedOnThisPlatform = false;
static constexpr RegList kLiftoffAssemblerGpCacheRegs = 0xff;
} // namespace wasm
} // namespace internal
} // namespace v8
#endif // V8_WASM_BASELINE_LIFTOFF_ASSEMBLER_S390_DEFS_H_
// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_WASM_BASELINE_LIFTOFF_ASSEMBLER_S390_H_
#define V8_WASM_BASELINE_LIFTOFF_ASSEMBLER_S390_H_
#include "src/wasm/baseline/liftoff-assembler.h"
namespace v8 {
namespace internal {
namespace wasm {
void LiftoffAssembler::ReserveStackSpace(uint32_t space) { USE(stack_space_); }
void LiftoffAssembler::LoadConstant(Register reg, WasmValue value) {}
void LiftoffAssembler::Load(Register dst, Address addr,
RelocInfo::Mode reloc_mode) {}
void LiftoffAssembler::Store(Address addr, Register reg,
PinnedRegisterScope pinned_regs,
RelocInfo::Mode reloc_mode) {}
void LiftoffAssembler::LoadCallerFrameSlot(Register dst,
uint32_t caller_slot_idx) {}
void LiftoffAssembler::MoveStackValue(uint32_t dst_index, uint32_t src_index,
wasm::ValueType type) {}
void LiftoffAssembler::MoveToReturnRegister(Register reg) {}
void LiftoffAssembler::Spill(uint32_t index, Register reg) {}
void LiftoffAssembler::Spill(uint32_t index, WasmValue value) {}
void LiftoffAssembler::Fill(Register reg, uint32_t index) {}
void LiftoffAssembler::emit_i32_add(Register dst, Register lhs, Register rhs) {}
#define DEFAULT_I32_BINOP(name, internal_name) \
void LiftoffAssembler::emit_i32_##name(Register dst, Register lhs, \
Register rhs) {}
// clang-format off
DEFAULT_I32_BINOP(sub, sub)
DEFAULT_I32_BINOP(mul, imul)
DEFAULT_I32_BINOP(and, and)
DEFAULT_I32_BINOP(or, or)
DEFAULT_I32_BINOP(xor, xor)
// clang-format on
#undef DEFAULT_I32_BINOP
void LiftoffAssembler::JumpIfZero(Register reg, Label* label) {}
} // namespace wasm
} // namespace internal
} // namespace v8
#endif // V8_WASM_BASELINE_LIFTOFF_ASSEMBLER_S390_H_
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