Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/wasm/wasm-ir-builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2143,10 +2143,9 @@ Result<> IRBuilder::makeStructNew(HeapType type, bool isDesc) {
if (isDesc && !type.getDescriptorType()) {
return Err{"struct.new_desc of type without descriptor"};
}
// TODO: Uncomment this after a transition period.
// if (!isDesc && type.getDescriptorType()) {
// return Err{"type with descriptor requires struct.new_desc"};
// }
if (!isDesc && type.getDescriptorType()) {
return Err{"type with descriptor requires struct.new_desc"};
}
StructNew curr(wasm.allocator);
curr.type = Type(type, NonNullable, Exact);
curr.operands.resize(type.getStruct().fields.size());
Expand All @@ -2159,10 +2158,9 @@ Result<> IRBuilder::makeStructNewDefault(HeapType type, bool isDesc) {
if (isDesc && !type.getDescriptorType()) {
return Err{"struct.new_default_desc of type without descriptor"};
}
// TODO: Uncomment this after a transition period.
// if (!isDesc && type.getDescriptorType()) {
// return Err{"type with descriptor requires struct.new_default_desc"};
// }
if (!isDesc && type.getDescriptorType()) {
return Err{"type with descriptor requires struct.new_default_desc"};
}
StructNew curr(wasm.allocator);
curr.type = Type(type, NonNullable, Exact);
CHECK_ERR(visitStructNew(&curr));
Expand Down
8 changes: 2 additions & 6 deletions src/wasm/wasm-stack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2418,17 +2418,13 @@ void BinaryInstWriter::visitStructNew(StructNew* curr) {
o << int8_t(BinaryConsts::GCPrefix);
if (curr->isWithDefault()) {
if (curr->desc) {
// TODO: Start emitting the new opcode once V8 supports it.
// o << U32LEB(BinaryConsts::StructNewDefaultDesc);
o << U32LEB(BinaryConsts::StructNewDefault);
o << U32LEB(BinaryConsts::StructNewDefaultDesc);
} else {
o << U32LEB(BinaryConsts::StructNewDefault);
}
} else {
if (curr->desc) {
// TODO: Start emitting the new opcode once V8 supports it.
// o << U32LEB(BinaryConsts::StructNewDesc);
o << U32LEB(BinaryConsts::StructNew);
o << U32LEB(BinaryConsts::StructNewDesc);
} else {
o << U32LEB(BinaryConsts::StructNew);
}
Expand Down
Loading