Commit b4569301 authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by Commit Bot

Revert "[wasm][liftoff] Support for most externref globals"

This reverts commit e43ec59b.

Reason for revert: https://logs.chromium.org/logs/v8/buildbucket/cr-buildbucket.appspot.com/8869719317069732832/+/steps/Check_-_d8/0/logs/externref-globals-liftoff/0

Original change's description:
> [wasm][liftoff] Support for most externref globals
> 
> With this CL we add support for all externref globals except for
> imported mutable globals.
> 
> R=​thibaudm@chromium.org
> 
> Bug: v8:7581
> Change-Id: I63cb26f8ad6f4b8fc1c276e223c5d45745122ebf
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2396086
> Commit-Queue: Andreas Haas <ahaas@chromium.org>
> Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#69741}

TBR=ahaas@chromium.org,thibaudm@chromium.org

Change-Id: I19d191862aa91a116ea84a4a59a3a0a8036fcb49
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:7581
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2398643
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69744}
parent cc138679
......@@ -659,15 +659,6 @@ void LiftoffAssembler::LoadTaggedPointer(Register dst, Register src_addr,
offset_imm, LoadType::kI32Load, pinned);
}
void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
Register offset_reg,
int32_t offset_imm,
LiftoffRegister src,
LiftoffRegList pinned) {
STATIC_ASSERT(kTaggedSize == kInt32Size);
Store(dst_addr, offset_reg, offset_imm, src, StoreType::kI32Store, pinned);
}
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm,
LoadType type, LiftoffRegList pinned,
......
......@@ -338,17 +338,6 @@ void LiftoffAssembler::LoadTaggedPointer(Register dst, Register src_addr,
LoadTaggedPointerField(dst, src_op);
}
void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
Register offset_reg,
int32_t offset_imm,
LiftoffRegister src,
LiftoffRegList pinned) {
UseScratchRegisterScope temps(this);
MemOperand dst_op =
liftoff::GetMemOp(this, &temps, dst_addr, offset_reg, offset_imm);
StoreTaggedField(src.gp(), dst_op);
}
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm,
LoadType type, LiftoffRegList pinned,
......
......@@ -291,16 +291,6 @@ void LiftoffAssembler::LoadTaggedPointer(Register dst, Register src_addr,
static_cast<uint32_t>(offset_imm), LoadType::kI32Load, pinned);
}
void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
Register offset_reg,
int32_t offset_imm,
LiftoffRegister src,
LiftoffRegList pinned) {
DCHECK_GE(offset_imm, 0);
STATIC_ASSERT(kTaggedSize == kInt32Size);
Store(dst_addr, offset_reg, offset_imm, src, StoreType::kI32Store, pinned);
}
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm,
LoadType type, LiftoffRegList pinned,
......
......@@ -485,9 +485,6 @@ class LiftoffAssembler : public TurboAssembler {
inline void LoadTaggedPointer(Register dst, Register src_addr,
Register offset_reg, int32_t offset_imm,
LiftoffRegList pinned);
inline void StoreTaggedPointer(Register dst_addr, Register offset_reg,
int32_t offset_imm, LiftoffRegister src,
LiftoffRegList pinned);
inline void Load(LiftoffRegister dst, Register src_addr, Register offset_reg,
uint32_t offset_imm, LoadType type, LiftoffRegList pinned,
uint32_t* protected_load_pc = nullptr,
......
......@@ -1813,30 +1813,8 @@ class LiftoffCompiler {
void GlobalGet(FullDecoder* decoder, Value* result,
const GlobalIndexImmediate<validate>& imm) {
const auto* global = &env_->module->globals[imm.index];
if (!CheckSupportedType(decoder,
FLAG_liftoff_extern_ref
? kSupportedTypes
: kSupportedTypesWithoutRefs,
global->type, "global")) {
return;
}
if (global->type.is_reference_type()) {
if (global->mutability && global->imported) {
unsupported(decoder, kRefTypes, "imported mutable globals");
return;
}
LiftoffRegList pinned;
Register globals_buffer =
pinned.set(__ GetUnusedRegister(kGpReg, pinned)).gp();
LOAD_TAGGED_PTR_INSTANCE_FIELD(globals_buffer, TaggedGlobalsBuffer);
Register value = pinned.set(__ GetUnusedRegister(kGpReg, pinned)).gp();
__ LoadTaggedPointer(value, globals_buffer, no_reg,
wasm::ObjectAccess::ElementOffsetInTaggedFixedArray(
imm.global->offset),
pinned);
__ PushRegister(global->type, LiftoffRegister(value));
if (!CheckSupportedType(decoder, kSupportedTypesWithoutRefs, global->type,
"global")) {
return;
}
LiftoffRegList pinned;
......@@ -1852,31 +1830,9 @@ class LiftoffCompiler {
void GlobalSet(FullDecoder* decoder, const Value& value,
const GlobalIndexImmediate<validate>& imm) {
auto* global = &env_->module->globals[imm.index];
if (!CheckSupportedType(decoder,
FLAG_liftoff_extern_ref
? kSupportedTypes
: kSupportedTypesWithoutRefs,
global->type, "global")) {
if (!CheckSupportedType(decoder, kSupportedTypesWithoutRefs, global->type,
"global"))
return;
}
if (global->type.is_reference_type()) {
if (global->mutability && global->imported) {
unsupported(decoder, kRefTypes, "imported mutable globals");
return;
}
LiftoffRegList pinned;
Register globals_buffer =
pinned.set(__ GetUnusedRegister(kGpReg, pinned)).gp();
LOAD_TAGGED_PTR_INSTANCE_FIELD(globals_buffer, TaggedGlobalsBuffer);
LiftoffRegister value = pinned.set(__ PopToRegister(pinned));
__ StoreTaggedPointer(globals_buffer, no_reg,
wasm::ObjectAccess::ElementOffsetInTaggedFixedArray(
imm.global->offset),
value, pinned);
return;
}
LiftoffRegList pinned;
uint32_t offset = 0;
Register addr = GetGlobalBaseAndOffset(global, &pinned, &offset);
......
......@@ -391,14 +391,6 @@ void LiftoffAssembler::LoadTaggedPointer(Register dst, Register src_addr,
static_cast<uint32_t>(offset_imm), LoadType::kI32Load, pinned);
}
void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
Register offset_reg,
int32_t offset_imm,
LiftoffRegister src,
LiftoffRegList pinned) {
bailout(kRefTypes, "GlobalSet");
}
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm,
LoadType type, LiftoffRegList pinned,
......
......@@ -355,14 +355,6 @@ void LiftoffAssembler::LoadTaggedPointer(Register dst, Register src_addr,
static_cast<uint32_t>(offset_imm), LoadType::kI64Load, pinned);
}
void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
Register offset_reg,
int32_t offset_imm,
LiftoffRegister src,
LiftoffRegList pinned) {
bailout(kRefTypes, "GlobalSet");
}
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm,
LoadType type, LiftoffRegList pinned,
......
......@@ -119,14 +119,6 @@ void LiftoffAssembler::LoadTaggedPointer(Register dst, Register src_addr,
bailout(kUnsupportedArchitecture, "LoadTaggedPointer");
}
void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
Register offset_reg,
int32_t offset_imm,
LiftoffRegister src,
LiftoffRegList pinned) {
bailout(kRefTypes, "GlobalSet");
}
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm,
LoadType type, LiftoffRegList pinned,
......
......@@ -118,14 +118,6 @@ void LiftoffAssembler::LoadTaggedPointer(Register dst, Register src_addr,
bailout(kUnsupportedArchitecture, "LoadTaggedPointer");
}
void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
Register offset_reg,
int32_t offset_imm,
LiftoffRegister src,
LiftoffRegList pinned) {
bailout(kRefTypes, "GlobalSet");
}
void LiftoffAssembler::Load(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm,
LoadType type, LiftoffRegList pinned,
......
......@@ -275,20 +275,6 @@ void LiftoffAssembler::LoadTaggedPointer(Register dst, Register src_addr,
LoadTaggedPointerField(dst, src_op);
}
void LiftoffAssembler::StoreTaggedPointer(Register dst_addr,
Register offset_reg,
int32_t offset_imm,
LiftoffRegister src,
LiftoffRegList pinned) {
DCHECK_GE(offset_imm, 0);
if (emit_debug_code() && offset_reg != no_reg) {
AssertZeroExtended(offset_reg);
}
Operand dst_op = liftoff::GetMemOp(this, dst_addr, offset_reg,
static_cast<uint32_t>(offset_imm));
StoreTaggedField(dst_op, src.gp());
}
void LiftoffAssembler::AtomicLoad(LiftoffRegister dst, Register src_addr,
Register offset_reg, uint32_t offset_imm,
LoadType type, LiftoffRegList pinned) {
......
// Copyright 2020 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.
// Flags: --experimental-wasm-reftypes --expose-gc --liftoff
// Flags: --no-wasm-tier-up --liftoff-extern-ref
load("test/mjsunit/wasm/externref-globals.js");
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