Commit 7e6fe4ea authored by Manos Koukoutos's avatar Manos Koukoutos Committed by Commit Bot

[wasm][cleanup] Return void in some WasmGraphBuilder public functions

Although the result was unused, these functions used to return a (often
random) Node* to satisfy old restrictions of graph-builder-interface.
Now that these restrictions are lifted, we can type them properly as
{void}.

Change-Id: I914024240f3005bc8a8636ac33ed4594f5ae5988
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2767218
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73544}
parent 3e40d280
......@@ -491,11 +491,10 @@ Node* WasmGraphBuilder::Loop(Node* entry) {
return graph()->NewNode(mcgraph()->common()->Loop(1), entry);
}
Node* WasmGraphBuilder::TerminateLoop(Node* effect, Node* control) {
void WasmGraphBuilder::TerminateLoop(Node* effect, Node* control) {
Node* terminate =
graph()->NewNode(mcgraph()->common()->Terminate(), effect, control);
gasm_->MergeControlToEnd(terminate);
return terminate;
}
Node* WasmGraphBuilder::LoopExit(Node* loop_node) {
......@@ -515,11 +514,10 @@ Node* WasmGraphBuilder::LoopExitValue(Node* value,
value, control());
}
Node* WasmGraphBuilder::TerminateThrow(Node* effect, Node* control) {
void WasmGraphBuilder::TerminateThrow(Node* effect, Node* control) {
Node* terminate =
graph()->NewNode(mcgraph()->common()->Throw(), effect, control);
gasm_->MergeControlToEnd(terminate);
return terminate;
}
bool WasmGraphBuilder::IsPhiWithMerge(Node* phi, Node* merge) {
......@@ -1304,58 +1302,54 @@ TrapId WasmGraphBuilder::GetTrapIdForTrap(wasm::TrapReason reason) {
}
}
Node* WasmGraphBuilder::TrapIfTrue(wasm::TrapReason reason, Node* cond,
void WasmGraphBuilder::TrapIfTrue(wasm::TrapReason reason, Node* cond,
wasm::WasmCodePosition position) {
TrapId trap_id = GetTrapIdForTrap(reason);
Node* node = SetControl(graph()->NewNode(mcgraph()->common()->TrapIf(trap_id),
cond, effect(), control()));
SetSourcePosition(node, position);
return node;
}
Node* WasmGraphBuilder::TrapIfFalse(wasm::TrapReason reason, Node* cond,
void WasmGraphBuilder::TrapIfFalse(wasm::TrapReason reason, Node* cond,
wasm::WasmCodePosition position) {
TrapId trap_id = GetTrapIdForTrap(reason);
Node* node = SetControl(graph()->NewNode(
mcgraph()->common()->TrapUnless(trap_id), cond, effect(), control()));
SetSourcePosition(node, position);
return node;
}
// Add a check that traps if {node} is equal to {val}.
Node* WasmGraphBuilder::TrapIfEq32(wasm::TrapReason reason, Node* node,
void WasmGraphBuilder::TrapIfEq32(wasm::TrapReason reason, Node* node,
int32_t val,
wasm::WasmCodePosition position) {
Int32Matcher m(node);
if (m.HasResolvedValue() && !m.Is(val)) return graph()->start();
if (m.HasResolvedValue() && !m.Is(val)) return;
if (val == 0) {
return TrapIfFalse(reason, node, position);
TrapIfFalse(reason, node, position);
} else {
return TrapIfTrue(reason, gasm_->Word32Equal(node, Int32Constant(val)),
position);
TrapIfTrue(reason, gasm_->Word32Equal(node, Int32Constant(val)), position);
}
}
// Add a check that traps if {node} is zero.
Node* WasmGraphBuilder::ZeroCheck32(wasm::TrapReason reason, Node* node,
void WasmGraphBuilder::ZeroCheck32(wasm::TrapReason reason, Node* node,
wasm::WasmCodePosition position) {
return TrapIfEq32(reason, node, 0, position);
TrapIfEq32(reason, node, 0, position);
}
// Add a check that traps if {node} is equal to {val}.
Node* WasmGraphBuilder::TrapIfEq64(wasm::TrapReason reason, Node* node,
void WasmGraphBuilder::TrapIfEq64(wasm::TrapReason reason, Node* node,
int64_t val,
wasm::WasmCodePosition position) {
Int64Matcher m(node);
if (m.HasResolvedValue() && !m.Is(val)) return graph()->start();
return TrapIfTrue(reason, gasm_->Word64Equal(node, Int64Constant(val)),
position);
if (m.HasResolvedValue() && !m.Is(val)) return;
TrapIfTrue(reason, gasm_->Word64Equal(node, Int64Constant(val)), position);
}
// Add a check that traps if {node} is zero.
Node* WasmGraphBuilder::ZeroCheck64(wasm::TrapReason reason, Node* node,
void WasmGraphBuilder::ZeroCheck64(wasm::TrapReason reason, Node* node,
wasm::WasmCodePosition position) {
return TrapIfEq64(reason, node, 0, position);
TrapIfEq64(reason, node, 0, position);
}
Node* WasmGraphBuilder::Switch(unsigned count, Node* key) {
......@@ -1393,12 +1387,11 @@ Node* WasmGraphBuilder::Return(Vector<Node*> vals) {
return ret;
}
Node* WasmGraphBuilder::Trap(wasm::TrapReason reason,
void WasmGraphBuilder::Trap(wasm::TrapReason reason,
wasm::WasmCodePosition position) {
TrapIfFalse(reason, Int32Constant(0), position);
// Connect control to end via a Throw() node.
TerminateThrow(effect(), control());
return nullptr;
}
Node* WasmGraphBuilder::MaskShiftCount32(Node* node) {
......@@ -3259,13 +3252,10 @@ Node* WasmGraphBuilder::ReturnCallIndirect(uint32_t table_index,
kReturnCall);
}
Node* WasmGraphBuilder::BrOnNull(Node* ref_object, Node** null_node,
void WasmGraphBuilder::BrOnNull(Node* ref_object, Node** null_node,
Node** non_null_node) {
BranchExpectFalse(gasm_->WordEqual(ref_object, RefNull()), null_node,
non_null_node);
// Return value is not used, but we need it for compatibility
// with graph-builder-interface.
return nullptr;
}
Node* WasmGraphBuilder::BuildI32Rol(Node* left, Node* right) {
......@@ -3636,7 +3626,7 @@ Node* WasmGraphBuilder::GlobalGet(uint32_t index) {
return result;
}
Node* WasmGraphBuilder::GlobalSet(uint32_t index, Node* val) {
void WasmGraphBuilder::GlobalSet(uint32_t index, Node* val) {
const wasm::WasmGlobal& global = env_->module->globals[index];
if (global.type.is_reference()) {
if (global.mutability && global.imported) {
......@@ -3644,13 +3634,15 @@ Node* WasmGraphBuilder::GlobalSet(uint32_t index, Node* val) {
Node* offset = nullptr;
GetBaseAndOffsetForImportedMutableExternRefGlobal(global, &base, &offset);
return gasm_->StoreToObject(
gasm_->StoreToObject(
ObjectAccess(MachineType::AnyTagged(), kFullWriteBarrier), base,
offset, val);
return;
}
Node* globals_buffer =
LOAD_INSTANCE_FIELD(TaggedGlobalsBuffer, MachineType::TaggedPointer());
return gasm_->StoreFixedArrayElementAny(globals_buffer, global.offset, val);
gasm_->StoreFixedArrayElementAny(globals_buffer, global.offset, val);
return;
}
MachineType mem_type = global.type.machine_type();
......@@ -3667,7 +3659,7 @@ Node* WasmGraphBuilder::GlobalSet(uint32_t index, Node* val) {
#endif
// TODO(manoskouk): Cannot use StoreToObject here due to
// GetGlobalBaseAndOffset pointer arithmetic.
return gasm_->Store(store_rep, base, offset, val);
gasm_->Store(store_rep, base, offset, val);
}
Node* WasmGraphBuilder::TableGet(uint32_t table_index, Node* index,
......@@ -3676,9 +3668,9 @@ Node* WasmGraphBuilder::TableGet(uint32_t table_index, Node* index,
gasm_->IntPtrConstant(table_index), index);
}
Node* WasmGraphBuilder::TableSet(uint32_t table_index, Node* index, Node* val,
void WasmGraphBuilder::TableSet(uint32_t table_index, Node* index, Node* val,
wasm::WasmCodePosition position) {
return gasm_->CallRuntimeStub(wasm::WasmCode::kWasmTableSet,
gasm_->CallRuntimeStub(wasm::WasmCode::kWasmTableSet,
gasm_->IntPtrConstant(table_index), index, val);
}
......@@ -3833,13 +3825,12 @@ const Operator* WasmGraphBuilder::GetSafeStoreOperator(int offset,
return mcgraph()->machine()->UnalignedStore(store_rep);
}
Node* WasmGraphBuilder::TraceFunctionEntry(wasm::WasmCodePosition position) {
void WasmGraphBuilder::TraceFunctionEntry(wasm::WasmCodePosition position) {
Node* call = BuildCallToRuntime(Runtime::kWasmTraceEnter, nullptr, 0);
SetSourcePosition(call, position);
return call;
}
Node* WasmGraphBuilder::TraceFunctionExit(Vector<Node*> vals,
void WasmGraphBuilder::TraceFunctionExit(Vector<Node*> vals,
wasm::WasmCodePosition position) {
Node* info = gasm_->IntPtrConstant(0);
size_t num_returns = vals.size();
......@@ -3855,10 +3846,9 @@ Node* WasmGraphBuilder::TraceFunctionExit(Vector<Node*> vals,
Node* call = BuildCallToRuntime(Runtime::kWasmTraceExit, &info, 1);
SetSourcePosition(call, position);
return call;
}
Node* WasmGraphBuilder::TraceMemoryOperation(bool is_store,
void WasmGraphBuilder::TraceMemoryOperation(bool is_store,
MachineRepresentation rep,
Node* index, uintptr_t offset,
wasm::WasmCodePosition position) {
......@@ -3883,7 +3873,6 @@ Node* WasmGraphBuilder::TraceMemoryOperation(bool is_store,
Node* call =
BuildCallToRuntime(Runtime::kWasmTraceMemory, args, arraysize(args));
SetSourcePosition(call, position);
return call;
}
namespace {
......@@ -4195,9 +4184,9 @@ Node* WasmGraphBuilder::LoadMem(wasm::ValueType type, MachineType memtype,
return load;
}
Node* WasmGraphBuilder::StoreLane(MachineRepresentation mem_rep, Node* index,
uint64_t offset, uint32_t alignment,
Node* val, uint8_t laneidx,
void WasmGraphBuilder::StoreLane(MachineRepresentation mem_rep, Node* index,
uint64_t offset, uint32_t alignment, Node* val,
uint8_t laneidx,
wasm::WasmCodePosition position,
wasm::ValueType type) {
Node* store;
......@@ -4241,16 +4230,12 @@ Node* WasmGraphBuilder::StoreLane(MachineRepresentation mem_rep, Node* index,
if (FLAG_trace_wasm_memory) {
TraceMemoryOperation(true, mem_rep, index, capped_offset, position);
}
return store;
}
Node* WasmGraphBuilder::StoreMem(MachineRepresentation mem_rep, Node* index,
void WasmGraphBuilder::StoreMem(MachineRepresentation mem_rep, Node* index,
uint64_t offset, uint32_t alignment, Node* val,
wasm::WasmCodePosition position,
wasm::ValueType type) {
Node* store;
if (mem_rep == MachineRepresentation::kSimd128) {
has_simd_ = true;
}
......@@ -4267,25 +4252,23 @@ Node* WasmGraphBuilder::StoreMem(MachineRepresentation mem_rep, Node* index,
if (mem_rep == MachineRepresentation::kWord8 ||
mcgraph()->machine()->UnalignedStoreSupported(mem_rep)) {
if (use_trap_handler()) {
store =
Node* store =
gasm_->ProtectedStore(mem_rep, MemBuffer(capped_offset), index, val);
SetSourcePosition(store, position);
} else {
store = gasm_->Store(StoreRepresentation{mem_rep, kNoWriteBarrier},
gasm_->Store(StoreRepresentation{mem_rep, kNoWriteBarrier},
MemBuffer(capped_offset), index, val);
}
} else {
// TODO(eholk): Support unaligned stores with trap handlers.
DCHECK(!use_trap_handler());
UnalignedStoreRepresentation rep(mem_rep);
store = gasm_->StoreUnaligned(rep, MemBuffer(capped_offset), index, val);
gasm_->StoreUnaligned(rep, MemBuffer(capped_offset), index, val);
}
if (FLAG_trace_wasm_memory) {
TraceMemoryOperation(true, mem_rep, index, capped_offset, position);
}
return store;
}
Node* WasmGraphBuilder::BuildAsmjsLoadMem(MachineType type, Node* index) {
......@@ -5412,12 +5395,12 @@ Node* WasmGraphBuilder::AtomicOp(wasm::WasmOpcode opcode, Node* const* inputs,
}
}
Node* WasmGraphBuilder::AtomicFence() {
return SetEffect(graph()->NewNode(mcgraph()->machine()->MemBarrier(),
effect(), control()));
void WasmGraphBuilder::AtomicFence() {
SetEffect(graph()->NewNode(mcgraph()->machine()->MemBarrier(), effect(),
control()));
}
Node* WasmGraphBuilder::MemoryInit(uint32_t data_segment_index, Node* dst,
void WasmGraphBuilder::MemoryInit(uint32_t data_segment_index, Node* dst,
Node* src, Node* size,
wasm::WasmCodePosition position) {
// The data segment index must be in bounds since it is required by
......@@ -5438,10 +5421,10 @@ Node* WasmGraphBuilder::MemoryInit(uint32_t data_segment_index, Node* dst,
MachineType sig_types[] = {MachineType::Int32(), MachineType::Pointer()};
MachineSignature sig(1, 1, sig_types);
Node* call = BuildCCall(&sig, function, stack_slot);
return TrapIfFalse(wasm::kTrapMemOutOfBounds, call, position);
TrapIfFalse(wasm::kTrapMemOutOfBounds, call, position);
}
Node* WasmGraphBuilder::DataDrop(uint32_t data_segment_index,
void WasmGraphBuilder::DataDrop(uint32_t data_segment_index,
wasm::WasmCodePosition position) {
DCHECK_LT(data_segment_index, env_->module->num_declared_data_segments);
......@@ -5449,7 +5432,7 @@ Node* WasmGraphBuilder::DataDrop(uint32_t data_segment_index,
LOAD_INSTANCE_FIELD(DataSegmentSizes, MachineType::Pointer());
STATIC_ASSERT(wasm::kV8MaxWasmDataSegments <= kMaxUInt32 >> 2);
auto access = ObjectAccess(MachineType::Int32(), kNoWriteBarrier);
return gasm_->StoreToObject(access, seg_size_array, data_segment_index << 2,
gasm_->StoreToObject(access, seg_size_array, data_segment_index << 2,
Int32Constant(0));
}
......@@ -5474,7 +5457,7 @@ Node* WasmGraphBuilder::StoreArgsInStackSlot(
return stack_slot;
}
Node* WasmGraphBuilder::MemoryCopy(Node* dst, Node* src, Node* size,
void WasmGraphBuilder::MemoryCopy(Node* dst, Node* src, Node* size,
wasm::WasmCodePosition position) {
Node* function =
gasm_->ExternalConstant(ExternalReference::wasm_memory_copy());
......@@ -5488,10 +5471,10 @@ Node* WasmGraphBuilder::MemoryCopy(Node* dst, Node* src, Node* size,
MachineType sig_types[] = {MachineType::Int32(), MachineType::Pointer()};
MachineSignature sig(1, 1, sig_types);
Node* call = BuildCCall(&sig, function, stack_slot);
return TrapIfFalse(wasm::kTrapMemOutOfBounds, call, position);
TrapIfFalse(wasm::kTrapMemOutOfBounds, call, position);
}
Node* WasmGraphBuilder::MemoryFill(Node* dst, Node* value, Node* size,
void WasmGraphBuilder::MemoryFill(Node* dst, Node* value, Node* size,
wasm::WasmCodePosition position) {
Node* function =
gasm_->ExternalConstant(ExternalReference::wasm_memory_fill());
......@@ -5505,19 +5488,19 @@ Node* WasmGraphBuilder::MemoryFill(Node* dst, Node* value, Node* size,
MachineType sig_types[] = {MachineType::Int32(), MachineType::Pointer()};
MachineSignature sig(1, 1, sig_types);
Node* call = BuildCCall(&sig, function, stack_slot);
return TrapIfFalse(wasm::kTrapMemOutOfBounds, call, position);
TrapIfFalse(wasm::kTrapMemOutOfBounds, call, position);
}
Node* WasmGraphBuilder::TableInit(uint32_t table_index,
void WasmGraphBuilder::TableInit(uint32_t table_index,
uint32_t elem_segment_index, Node* dst,
Node* src, Node* size,
wasm::WasmCodePosition position) {
return gasm_->CallRuntimeStub(wasm::WasmCode::kWasmTableInit, dst, src, size,
gasm_->CallRuntimeStub(wasm::WasmCode::kWasmTableInit, dst, src, size,
gasm_->NumberConstant(table_index),
gasm_->NumberConstant(elem_segment_index));
}
Node* WasmGraphBuilder::ElemDrop(uint32_t elem_segment_index,
void WasmGraphBuilder::ElemDrop(uint32_t elem_segment_index,
wasm::WasmCodePosition position) {
// The elem segment index must be in bounds since it is required by
// validation.
......@@ -5527,15 +5510,14 @@ Node* WasmGraphBuilder::ElemDrop(uint32_t elem_segment_index,
LOAD_INSTANCE_FIELD(DroppedElemSegments, MachineType::Pointer());
auto store_rep =
StoreRepresentation(MachineRepresentation::kWord8, kNoWriteBarrier);
return gasm_->Store(store_rep, dropped_elem_segments, elem_segment_index,
gasm_->Store(store_rep, dropped_elem_segments, elem_segment_index,
Int32Constant(1));
}
Node* WasmGraphBuilder::TableCopy(uint32_t table_dst_index,
uint32_t table_src_index, Node* dst,
Node* src, Node* size,
wasm::WasmCodePosition position) {
return gasm_->CallRuntimeStub(wasm::WasmCode::kWasmTableCopy, dst, src, size,
void WasmGraphBuilder::TableCopy(uint32_t table_dst_index,
uint32_t table_src_index, Node* dst, Node* src,
Node* size, wasm::WasmCodePosition position) {
gasm_->CallRuntimeStub(wasm::WasmCode::kWasmTableCopy, dst, src, size,
gasm_->NumberConstant(table_dst_index),
gasm_->NumberConstant(table_src_index));
}
......@@ -5561,9 +5543,9 @@ Node* WasmGraphBuilder::TableSize(uint32_t table_index) {
return BuildChangeSmiToInt32(length_smi);
}
Node* WasmGraphBuilder::TableFill(uint32_t table_index, Node* start,
Node* value, Node* count) {
return gasm_->CallRuntimeStub(
void WasmGraphBuilder::TableFill(uint32_t table_index, Node* start, Node* value,
Node* count) {
gasm_->CallRuntimeStub(
wasm::WasmCode::kWasmTableFill,
graph()->NewNode(mcgraph()->common()->NumberConstant(table_index)), start,
count, value);
......@@ -5752,7 +5734,7 @@ void WasmGraphBuilder::FuncCheck(Node* object, bool object_can_be_null,
BranchHint::kTrue);
}
Node* WasmGraphBuilder::BrOnCastAbs(
void WasmGraphBuilder::BrOnCastAbs(
Node** match_control, Node** match_effect, Node** no_match_control,
Node** no_match_effect, std::function<void(Callbacks)> type_checker) {
SmallNodeVector no_match_controls, no_match_effects, match_controls,
......@@ -5778,10 +5760,6 @@ Node* WasmGraphBuilder::BrOnCastAbs(
// EffectPhis need their control dependency as an additional input.
no_match_effects.emplace_back(*no_match_control);
*no_match_effect = EffectPhi(count, no_match_effects.data());
// Return value is not used, but we need it for compatibility
// with graph-builder-interface.
return nullptr;
}
Node* WasmGraphBuilder::RefTest(Node* object, Node* rtt,
......@@ -5803,13 +5781,13 @@ Node* WasmGraphBuilder::RefCast(Node* object, Node* rtt,
return object;
}
Node* WasmGraphBuilder::BrOnCast(Node* object, Node* rtt,
void WasmGraphBuilder::BrOnCast(Node* object, Node* rtt,
ObjectReferenceKnowledge config,
Node** match_control, Node** match_effect,
Node** no_match_control,
Node** no_match_effect) {
return BrOnCastAbs(match_control, match_effect, no_match_control,
no_match_effect, [=](Callbacks callbacks) -> void {
BrOnCastAbs(match_control, match_effect, no_match_control, no_match_effect,
[=](Callbacks callbacks) -> void {
return TypeCheck(object, rtt, config, false, callbacks);
});
}
......@@ -5831,15 +5809,14 @@ Node* WasmGraphBuilder::RefAsData(Node* object, bool object_can_be_null,
return object;
}
Node* WasmGraphBuilder::BrOnData(Node* object, Node* /*rtt*/,
void WasmGraphBuilder::BrOnData(Node* object, Node* /*rtt*/,
ObjectReferenceKnowledge config,
Node** match_control, Node** match_effect,
Node** no_match_control,
Node** no_match_effect) {
return BrOnCastAbs(match_control, match_effect, no_match_control,
no_match_effect, [=](Callbacks callbacks) -> void {
return DataCheck(object, config.object_can_be_null,
callbacks);
BrOnCastAbs(match_control, match_effect, no_match_control, no_match_effect,
[=](Callbacks callbacks) -> void {
return DataCheck(object, config.object_can_be_null, callbacks);
});
}
......@@ -5860,15 +5837,14 @@ Node* WasmGraphBuilder::RefAsFunc(Node* object, bool object_can_be_null,
return object;
}
Node* WasmGraphBuilder::BrOnFunc(Node* object, Node* /*rtt*/,
void WasmGraphBuilder::BrOnFunc(Node* object, Node* /*rtt*/,
ObjectReferenceKnowledge config,
Node** match_control, Node** match_effect,
Node** no_match_control,
Node** no_match_effect) {
return BrOnCastAbs(match_control, match_effect, no_match_control,
no_match_effect, [=](Callbacks callbacks) -> void {
return FuncCheck(object, config.object_can_be_null,
callbacks);
BrOnCastAbs(match_control, match_effect, no_match_control, no_match_effect,
[=](Callbacks callbacks) -> void {
return FuncCheck(object, config.object_can_be_null, callbacks);
});
}
......@@ -5880,7 +5856,7 @@ Node* WasmGraphBuilder::RefAsI31(Node* object,
return object;
}
Node* WasmGraphBuilder::BrOnI31(Node* object, Node* /* rtt */,
void WasmGraphBuilder::BrOnI31(Node* object, Node* /* rtt */,
ObjectReferenceKnowledge /* config */,
Node** match_control, Node** match_effect,
Node** no_match_control,
......@@ -5891,9 +5867,6 @@ Node* WasmGraphBuilder::BrOnI31(Node* object, Node* /* rtt */,
SetControl(*no_match_control);
*match_effect = effect();
*no_match_effect = effect();
// Unused return value, needed for typing of BUILD in graph-builder-interface.
return nullptr;
}
Node* WasmGraphBuilder::StructGet(Node* struct_object,
......@@ -5913,7 +5886,7 @@ Node* WasmGraphBuilder::StructGet(Node* struct_object,
return gasm_->LoadFromObject(machine_type, struct_object, offset);
}
Node* WasmGraphBuilder::StructSet(Node* struct_object,
void WasmGraphBuilder::StructSet(Node* struct_object,
const wasm::StructType* struct_type,
uint32_t field_index, Node* field_value,
CheckForNull null_check,
......@@ -5922,8 +5895,7 @@ Node* WasmGraphBuilder::StructSet(Node* struct_object,
TrapIfTrue(wasm::kTrapNullDereference,
gasm_->WordEqual(struct_object, RefNull()), position);
}
return gasm_->StoreStructField(struct_object, struct_type, field_index,
field_value);
gasm_->StoreStructField(struct_object, struct_type, field_index, field_value);
}
void WasmGraphBuilder::BoundsCheck(Node* array, Node* index,
......@@ -5948,9 +5920,9 @@ Node* WasmGraphBuilder::ArrayGet(Node* array_object,
return gasm_->LoadFromObject(machine_type, array_object, offset);
}
Node* WasmGraphBuilder::ArraySet(Node* array_object,
const wasm::ArrayType* type, Node* index,
Node* value, CheckForNull null_check,
void WasmGraphBuilder::ArraySet(Node* array_object, const wasm::ArrayType* type,
Node* index, Node* value,
CheckForNull null_check,
wasm::WasmCodePosition position) {
if (null_check == kWithNullCheck) {
TrapIfTrue(wasm::kTrapNullDereference,
......@@ -5958,7 +5930,7 @@ Node* WasmGraphBuilder::ArraySet(Node* array_object,
}
BoundsCheck(array_object, index, position);
Node* offset = gasm_->WasmArrayElementOffset(index, type->element_type());
return gasm_->StoreToObject(ObjectAccessForGCStores(type->element_type()),
gasm_->StoreToObject(ObjectAccessForGCStores(type->element_type()),
array_object, offset, value);
}
......
......@@ -232,11 +232,11 @@ class WasmGraphBuilder {
Node* Start(unsigned params);
Node* Param(int index, const char* debug_name = nullptr);
Node* Loop(Node* entry);
Node* TerminateLoop(Node* effect, Node* control);
void TerminateLoop(Node* effect, Node* control);
Node* LoopExit(Node* loop_node);
// Assumes current control() is the corresponding loop exit.
Node* LoopExitValue(Node* value, MachineRepresentation representation);
Node* TerminateThrow(Node* effect, Node* control);
void TerminateThrow(Node* effect, Node* control);
Node* Merge(unsigned count, Node** controls);
template <typename... Nodes>
Node* Merge(Node* fst, Nodes*... args);
......@@ -282,17 +282,17 @@ class WasmGraphBuilder {
Node* BranchNoHint(Node* cond, Node** true_node, Node** false_node);
Node* BranchExpectFalse(Node* cond, Node** true_node, Node** false_node);
Node* TrapIfTrue(wasm::TrapReason reason, Node* cond,
void TrapIfTrue(wasm::TrapReason reason, Node* cond,
wasm::WasmCodePosition position);
Node* TrapIfFalse(wasm::TrapReason reason, Node* cond,
void TrapIfFalse(wasm::TrapReason reason, Node* cond,
wasm::WasmCodePosition position);
Node* TrapIfEq32(wasm::TrapReason reason, Node* node, int32_t val,
void TrapIfEq32(wasm::TrapReason reason, Node* node, int32_t val,
wasm::WasmCodePosition position);
Node* ZeroCheck32(wasm::TrapReason reason, Node* node,
void ZeroCheck32(wasm::TrapReason reason, Node* node,
wasm::WasmCodePosition position);
Node* TrapIfEq64(wasm::TrapReason reason, Node* node, int64_t val,
void TrapIfEq64(wasm::TrapReason reason, Node* node, int64_t val,
wasm::WasmCodePosition position);
Node* ZeroCheck64(wasm::TrapReason reason, Node* node,
void ZeroCheck64(wasm::TrapReason reason, Node* node,
wasm::WasmCodePosition position);
Node* Switch(unsigned count, Node* key);
......@@ -305,10 +305,10 @@ class WasmGraphBuilder {
return Return(ArrayVector(arr));
}
Node* TraceFunctionEntry(wasm::WasmCodePosition position);
Node* TraceFunctionExit(Vector<Node*> vals, wasm::WasmCodePosition position);
void TraceFunctionEntry(wasm::WasmCodePosition position);
void TraceFunctionExit(Vector<Node*> vals, wasm::WasmCodePosition position);
Node* Trap(wasm::TrapReason reason, wasm::WasmCodePosition position);
void Trap(wasm::TrapReason reason, wasm::WasmCodePosition position);
Node* CallDirect(uint32_t index, Vector<Node*> args, Vector<Node*> rets,
wasm::WasmCodePosition position);
......@@ -325,23 +325,21 @@ class WasmGraphBuilder {
Node* ReturnCallRef(uint32_t sig_index, Vector<Node*> args,
CheckForNull null_check, wasm::WasmCodePosition position);
// Return value is not expected to be used,
// but we need it for compatibility with graph-builder-interface.
Node* BrOnNull(Node* ref_object, Node** non_null_node, Node** null_node);
void BrOnNull(Node* ref_object, Node** non_null_node, Node** null_node);
Node* Invert(Node* node);
Node* GlobalGet(uint32_t index);
Node* GlobalSet(uint32_t index, Node* val);
void GlobalSet(uint32_t index, Node* val);
Node* TableGet(uint32_t table_index, Node* index,
wasm::WasmCodePosition position);
Node* TableSet(uint32_t table_index, Node* index, Node* val,
void TableSet(uint32_t table_index, Node* index, Node* val,
wasm::WasmCodePosition position);
//-----------------------------------------------------------------------
// Operations that concern the linear memory.
//-----------------------------------------------------------------------
Node* CurrentMemoryPages();
Node* TraceMemoryOperation(bool is_store, MachineRepresentation, Node* index,
void TraceMemoryOperation(bool is_store, MachineRepresentation, Node* index,
uintptr_t offset, wasm::WasmCodePosition);
Node* Prefetch(Node* index, uint64_t offset, uint32_t alignment,
bool temporal);
......@@ -361,10 +359,10 @@ class WasmGraphBuilder {
Node* LoadLane(wasm::ValueType type, MachineType memtype, Node* value,
Node* index, uint64_t offset, uint32_t alignment,
uint8_t laneidx, wasm::WasmCodePosition position);
Node* StoreMem(MachineRepresentation mem_rep, Node* index, uint64_t offset,
void StoreMem(MachineRepresentation mem_rep, Node* index, uint64_t offset,
uint32_t alignment, Node* val, wasm::WasmCodePosition position,
wasm::ValueType type);
Node* StoreLane(MachineRepresentation mem_rep, Node* index, uint64_t offset,
void StoreLane(MachineRepresentation mem_rep, Node* index, uint64_t offset,
uint32_t alignment, Node* val, uint8_t laneidx,
wasm::WasmCodePosition position, wasm::ValueType type);
static void PrintDebugName(Node* node);
......@@ -427,31 +425,31 @@ class WasmGraphBuilder {
Node* AtomicOp(wasm::WasmOpcode opcode, Node* const* inputs,
uint32_t alignment, uint64_t offset,
wasm::WasmCodePosition position);
Node* AtomicFence();
void AtomicFence();
Node* MemoryInit(uint32_t data_segment_index, Node* dst, Node* src,
Node* size, wasm::WasmCodePosition position);
Node* MemoryCopy(Node* dst, Node* src, Node* size,
void MemoryInit(uint32_t data_segment_index, Node* dst, Node* src, Node* size,
wasm::WasmCodePosition position);
Node* DataDrop(uint32_t data_segment_index, wasm::WasmCodePosition position);
Node* MemoryFill(Node* dst, Node* fill, Node* size,
void MemoryCopy(Node* dst, Node* src, Node* size,
wasm::WasmCodePosition position);
void DataDrop(uint32_t data_segment_index, wasm::WasmCodePosition position);
void MemoryFill(Node* dst, Node* fill, Node* size,
wasm::WasmCodePosition position);
Node* TableInit(uint32_t table_index, uint32_t elem_segment_index, Node* dst,
void TableInit(uint32_t table_index, uint32_t elem_segment_index, Node* dst,
Node* src, Node* size, wasm::WasmCodePosition position);
Node* ElemDrop(uint32_t elem_segment_index, wasm::WasmCodePosition position);
Node* TableCopy(uint32_t table_dst_index, uint32_t table_src_index, Node* dst,
void ElemDrop(uint32_t elem_segment_index, wasm::WasmCodePosition position);
void TableCopy(uint32_t table_dst_index, uint32_t table_src_index, Node* dst,
Node* src, Node* size, wasm::WasmCodePosition position);
Node* TableGrow(uint32_t table_index, Node* value, Node* delta);
Node* TableSize(uint32_t table_index);
Node* TableFill(uint32_t table_index, Node* start, Node* value, Node* count);
void TableFill(uint32_t table_index, Node* start, Node* value, Node* count);
Node* StructNewWithRtt(uint32_t struct_index, const wasm::StructType* type,
Node* rtt, Vector<Node*> fields);
Node* StructGet(Node* struct_object, const wasm::StructType* struct_type,
uint32_t field_index, CheckForNull null_check, bool is_signed,
wasm::WasmCodePosition position);
Node* StructSet(Node* struct_object, const wasm::StructType* struct_type,
void StructSet(Node* struct_object, const wasm::StructType* struct_type,
uint32_t field_index, Node* value, CheckForNull null_check,
wasm::WasmCodePosition position);
Node* ArrayNewWithRtt(uint32_t array_index, const wasm::ArrayType* type,
......@@ -461,7 +459,7 @@ class WasmGraphBuilder {
Node* ArrayGet(Node* array_object, const wasm::ArrayType* type, Node* index,
CheckForNull null_check, bool is_signed,
wasm::WasmCodePosition position);
Node* ArraySet(Node* array_object, const wasm::ArrayType* type, Node* index,
void ArraySet(Node* array_object, const wasm::ArrayType* type, Node* index,
Node* value, CheckForNull null_check,
wasm::WasmCodePosition position);
Node* ArrayLen(Node* array_object, CheckForNull null_check,
......@@ -475,24 +473,24 @@ class WasmGraphBuilder {
Node* RefTest(Node* object, Node* rtt, ObjectReferenceKnowledge config);
Node* RefCast(Node* object, Node* rtt, ObjectReferenceKnowledge config,
wasm::WasmCodePosition position);
Node* BrOnCast(Node* object, Node* rtt, ObjectReferenceKnowledge config,
void BrOnCast(Node* object, Node* rtt, ObjectReferenceKnowledge config,
Node** match_control, Node** match_effect,
Node** no_match_control, Node** no_match_effect);
Node* RefIsData(Node* object, bool object_can_be_null);
Node* RefAsData(Node* object, bool object_can_be_null,
wasm::WasmCodePosition position);
Node* BrOnData(Node* object, Node* rtt, ObjectReferenceKnowledge config,
void BrOnData(Node* object, Node* rtt, ObjectReferenceKnowledge config,
Node** match_control, Node** match_effect,
Node** no_match_control, Node** no_match_effect);
Node* RefIsFunc(Node* object, bool object_can_be_null);
Node* RefAsFunc(Node* object, bool object_can_be_null,
wasm::WasmCodePosition position);
Node* BrOnFunc(Node* object, Node* rtt, ObjectReferenceKnowledge config,
void BrOnFunc(Node* object, Node* rtt, ObjectReferenceKnowledge config,
Node** match_control, Node** match_effect,
Node** no_match_control, Node** no_match_effect);
Node* RefIsI31(Node* object);
Node* RefAsI31(Node* object, wasm::WasmCodePosition position);
Node* BrOnI31(Node* object, Node* rtt, ObjectReferenceKnowledge config,
void BrOnI31(Node* object, Node* rtt, ObjectReferenceKnowledge config,
Node** match_control, Node** match_effect,
Node** no_match_control, Node** no_match_effect);
......@@ -669,7 +667,7 @@ class WasmGraphBuilder {
void DataCheck(Node* object, bool object_can_be_null, Callbacks callbacks);
void FuncCheck(Node* object, bool object_can_be_null, Callbacks callbacks);
Node* BrOnCastAbs(Node** match_control, Node** match_effect,
void BrOnCastAbs(Node** match_control, Node** match_effect,
Node** no_match_control, Node** no_match_effect,
std::function<void(Callbacks)> type_checker);
......
......@@ -1008,7 +1008,7 @@ class WasmGraphBuildingInterface {
builder_->RefCast(object.node, rtt.node, config, decoder->position());
}
template <TFNode* (compiler::WasmGraphBuilder::*branch_function)(
template <void (compiler::WasmGraphBuilder::*branch_function)(
TFNode*, TFNode*, StaticKnowledge, TFNode**, TFNode**, TFNode**,
TFNode**)>
void BrOnCastAbs(FullDecoder* decoder, const Value& object, const Value& rtt,
......
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