Commit 81c19070 authored by Manos Koukoutos's avatar Manos Koukoutos Committed by V8 LUCI CQ

[wasm] A few small cleanups

Change-Id: Ie07e626900f8fc8218944be2b33da6fc109adf92
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3168273
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76930}
parent 7511020b
......@@ -1254,17 +1254,12 @@ Reduction MachineOperatorReducer::ReduceUint32Mod(Node* node) {
Reduction MachineOperatorReducer::ReduceStore(Node* node) {
NodeMatcher nm(node);
MachineRepresentation rep;
int value_input;
if (nm.IsStore()) {
rep = StoreRepresentationOf(node->op()).representation();
value_input = 2;
} else {
DCHECK(nm.IsUnalignedStore());
rep = UnalignedStoreRepresentationOf(node->op());
value_input = 2;
}
DCHECK(nm.IsStore() || nm.IsUnalignedStore());
MachineRepresentation rep =
nm.IsStore() ? StoreRepresentationOf(node->op()).representation()
: UnalignedStoreRepresentationOf(node->op());
const int value_input = 2;
Node* const value = node->InputAt(value_input);
switch (value->opcode()) {
......
......@@ -2905,8 +2905,8 @@ Node* WasmGraphBuilder::BuildWasmCall(const wasm::FunctionSig* sig,
const Operator* op = mcgraph()->common()->Call(call_descriptor);
Node* call =
BuildCallNode(sig, args, position, instance_node, op, frame_state);
// TODO(manoskouk): Don't always set control if we ever add properties to wasm
// calls.
// TODO(manoskouk): If we have kNoThrow calls, do not set them as control.
DCHECK_GT(call->op()->ControlOutputCount(), 0);
SetControl(call);
size_t ret_count = sig->return_count();
......@@ -2935,8 +2935,8 @@ Node* WasmGraphBuilder::BuildWasmReturnCall(const wasm::FunctionSig* sig,
const Operator* op = mcgraph()->common()->TailCall(call_descriptor);
Node* call = BuildCallNode(sig, args, position, instance_node, op);
// TODO(manoskouk): {call} will not always be a control node if we ever add
// properties to wasm calls.
// TODO(manoskouk): If we have kNoThrow calls, do not merge them to end.
DCHECK_GT(call->op()->ControlOutputCount(), 0);
gasm_->MergeControlToEnd(call);
return call;
......
......@@ -1899,10 +1899,11 @@ void WasmStruct::WasmStructPrint(std::ostream& os) {
os << Brief(base::ReadUnalignedValue<Object>(field_address));
break;
case wasm::kS128:
case wasm::kBottom:
case wasm::kVoid:
os << "UNIMPLEMENTED"; // TODO(7748): Implement.
break;
case wasm::kBottom:
case wasm::kVoid:
UNREACHABLE();
}
}
os << "\n";
......
......@@ -653,7 +653,8 @@ MaybeHandle<WasmInstanceObject> InstanceBuilder::Build() {
Handle<FixedArray> tables = isolate_->factory()->NewFixedArray(table_count);
for (int i = module_->num_imported_tables; i < table_count; i++) {
const WasmTable& table = module_->tables[i];
// TODO(9495): Initialize with initializer from module if present.
// Initialize tables with null for now. We will initialize non-defaultable
// tables later, in {InitializeIndirectFunctionTables}.
Handle<WasmTableObject> table_obj = WasmTableObject::New(
isolate_, instance, table.type, table.initial_size,
table.has_maximum_size, table.maximum_size, nullptr,
......
......@@ -284,8 +284,8 @@ constexpr bool is_defaultable(ValueKind kind) {
// representation (for reference types), and an inheritance depth (for rtts
// only). Those are encoded into 32 bits using base::BitField. The underlying
// ValueKind enumeration includes four elements which do not strictly correspond
// to value types: the two packed types i8 and i16, the type of void blocks
// (stmt), and a bottom value (for internal use).
// to value types: the two packed types i8 and i16, the void type (for control
// structures), and a bottom value (for internal use).
class ValueType {
public:
/******************************* Constructors *******************************/
......
......@@ -294,7 +294,6 @@ std::ostream& operator<<(std::ostream& os, WasmElemSegment::Entry entry) {
// Appends an initializer expression encoded in {wire_bytes}, in the offset
// contained in {expr}.
// TODO(7748): Find a way to implement other expressions here.
void AppendInitExpr(std::ostream& os, ModuleWireBytes wire_bytes,
WireBytesRef expr) {
Decoder decoder(wire_bytes.module_bytes());
......
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