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
6 changes: 3 additions & 3 deletions scripts/fuzz_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ def __init__(self):
D8(),
D8Liftoff(),
D8Turboshaft(),
# FIXME: Temprorary disable. See issue #4741 for more details
# FIXME: Temporary disable. See issue #4741 for more details
# Wasm2C(),
# Wasm2C2Wasm()
]
Expand Down Expand Up @@ -1372,7 +1372,7 @@ def handle_pair(self, input, before_wasm, after_wasm, opts):
# "[fuzz-exec] export bar".
call_start = before.rfind(FUZZ_EXEC_EXPORT_PREFIX, 0, trap_index)
if call_start < 0:
# the trap happened before we called an export, so it occured
# the trap happened before we called an export, so it occurred
# during startup (the start function, or memory segment
# operations, etc.). in that case there is nothing for us to
# compare here; just leave.
Expand Down Expand Up @@ -2575,7 +2575,7 @@ def handle(self, wasm):
TrapsNeverHappen(),
CtorEval(),
Merge(),
# Split(), # Will reenable after stabilized
# Split(), # Will re-enable after stabilized
RoundtripText(),
ClusterFuzz(),
Two(),
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/fuzzing.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
'string-lifting-section.wast',
# TODO: fuzzer support for uninhabitable imported globals
'exact-references.wast',
# We do not have full suppor for these imports in all parts of the fuzzer.
# We do not have full support for these imports in all parts of the fuzzer.
'instrument-branch-hints.wast',
# Contains a subtype chain that exceeds depth limits.
'reorder-types-real.wast',
Expand Down
2 changes: 1 addition & 1 deletion scripts/update_lit_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def find_annotations(module, start):
else:
# Found something that isn't an annotation.
break
# Look for the start of the line containin the first annoation.
# Look for the start of the line containing the first annotation.
for i in range(annotation - 1, -1, -1):
if module[i] == '\n':
return i + 1
Expand Down
8 changes: 4 additions & 4 deletions src/binaryen-c.h
Original file line number Diff line number Diff line change
Expand Up @@ -3724,10 +3724,10 @@ BINARYEN_API void RelooperAddBranchForSwitch(RelooperBlockRef from,
BinaryenIndex numIndexes,
BinaryenExpressionRef code);

// Generate structed wasm control flow from the CFG of blocks and branches that
// were created on this relooper instance. This returns the rendered output, and
// also disposes of the relooper and its blocks and branches, as they are no
// longer needed.
// Generate structured wasm control flow from the CFG of blocks and branches
// that were created on this relooper instance. This returns the rendered
// output, and also disposes of the relooper and its blocks and branches, as
// they are no longer needed.
// @param labelHelper To render irreducible control flow, we may need a helper
// variable to guide us to the right target label. This value should be
// an index of an i32 local variable that is free for us to use.
Expand Down
2 changes: 1 addition & 1 deletion src/dataflow/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct Node {
// in wasm)
Expr, // a value represented by a Binaryen Expression
Phi, // a phi from converging control flow
Cond, // a blockpc, representing one of the branchs for a Block
Cond, // a blockpc, representing one of the branches for a Block
Block, // a source of phis
Zext, // zero-extend an i1 (from an op where Souper returns i1 but wasm does
// not, and so we need a special way to get back to an i32/i64 if we
Expand Down
2 changes: 1 addition & 1 deletion src/interpreter/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ Result<> Interpreter::instantiate(Instance& instance) {
return Ok{};
}

// This is a temporary convenience while stil using gTests to validate this
// This is a temporary convenience while still using gTests to validate this
// interpreter. Once spec tests can run, this shall be deleted.
std::vector<Literal> Interpreter::runTest(Expression* root) {
static std::shared_ptr<wasm::Module> dummyModule = std::make_shared<Module>();
Expand Down
2 changes: 1 addition & 1 deletion src/ir/child-typer.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ template<typename Subtype> struct ChildTyper : OverriddenVisitor<Subtype> {
}
}

// Disambiguate betwween Type and VarType.
// Disambiguate between Type and VarType.
void note(Expression** childp, Type::BasicType type) {
note(childp, VarType{Type(type)});
}
Expand Down
2 changes: 1 addition & 1 deletion src/ir/manipulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

namespace wasm::ExpressionManipulator {

// Re-use a node's memory. This helps avoid allocation when optimizing.
// Reuse a node's memory. This helps avoid allocation when optimizing.
template<typename InputType, typename OutputType>
inline OutputType* convert(InputType* input) {
static_assert(sizeof(OutputType) <= sizeof(InputType),
Expand Down
2 changes: 1 addition & 1 deletion src/ir/module-splitting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ TableSlotManager::TableSlotManager(
Module& module, const std::vector<std::unique_ptr<Module>>& secondaries)
: module(module), secondaries(secondaries) {
// If possible, just create a new table to manage all primary-to-secondary
// calls lazily. Do not re-use slots for functions that will already be in
// calls lazily. Do not reuse slots for functions that will already be in
// existing tables, since that is not correct in the face of table mutations.
// However, do not do this for emscripten; its loader code (and dynamic
// loading in particular) do not support this yet.
Expand Down
2 changes: 1 addition & 1 deletion src/ir/module-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ struct TypeInfos {

// Multivalue control flow structures need a function type, but the identity
// of the function type (i.e. what recursion group it is in or whether it is
// final) doesn't matter. Save them for the end to see if we can re-use an
// final) doesn't matter. Save them for the end to see if we can reuse an
// existing function type with the necessary signature.
InsertOrderedMap<Signature, size_t> controlFlowSignatures;

Expand Down
2 changes: 1 addition & 1 deletion src/ir/subtype-exprs.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace wasm {
// must be a subtype of the signature's
// param.
// * noteSubtype(Expression, Expression) - An expression's type must be a
// subtype of anothers, for example,
// subtype of another's, for example,
// a block and its last child.
//
// * noteCast(HeapType, Type) - A fixed type is cast to another, for example,
Expand Down
2 changes: 1 addition & 1 deletion src/ir/type-updating.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ updateIndirectCallEffects(
// oldType has no entry, which means its effects are explicitly unknown.
// Why? It's a source type in `typeMap`, so it must have appeared in
// the module at some point, but GlobalEffects were never computed for it,
// or GlobalEffects intentionally ommitted its entry because it couldn't
// or GlobalEffects intentionally omitted its entry because it couldn't
// determine its effects (e.g. if an import has that type).
newTypes.insert(destType);
newTypeEffects.erase(destType);
Expand Down
2 changes: 1 addition & 1 deletion src/passes/DeadArgumentElimination2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ struct FunctionInfo {
std::unordered_map<HeapType, ParamLocations> forwardedToIndirectParams;

// Locations forwarded to this function's result. These locations will become
// used if the result turns out ot be used.
// used if the result turns out to be used.
std::vector<Location> resultSources;

// For each parameter of this function, the list of locations that will become
Expand Down
4 changes: 2 additions & 2 deletions src/passes/HeapStoreOptimization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ struct HeapStoreOptimization
bool trySwap(ExpressionList& list, Index i, Index j) {
if (j == list.size() - 1) {
// There is no reason to swap with the last element of the list as it
// won't match the pattern because there wont be anything after. This also
// avoids swapping an instruction that does not leave anything in the
// won't match the pattern because there won't be anything after. This
// also avoids swapping an instruction that does not leave anything in the
// stack by one that could leave something, and that which would be
// incorrect.
return false;
Expand Down
6 changes: 3 additions & 3 deletions src/passes/Inlining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,9 @@ struct FunctionSplitter {
//
// Note that to avoid wasteful work, this function may return "Full" inlining
// mode instead of a split inlining. That is, if it detects that a partial
// inlining will trigger a follow up full inline of the splitted function
// then it will instead return "InliningMode::Full" directly. In more detail,
// imagine we have
// inlining will trigger a follow up full inline of the split function then it
// will instead return "InliningMode::Full" directly. In more detail, imagine
// we have
//
// foo(10);
//
Expand Down
2 changes: 1 addition & 1 deletion src/passes/MergeBlocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static bool hasDeadCode(Block* block) {
}

// Given a dropped block, see if we can simplify it by optimizing the drop into
// the block, removing the return value while doin so. Returns whether we
// the block, removing the return value while doing so. Returns whether we
// succeeded.
static bool optimizeDroppedBlock(Drop* drop,
Block* block,
Expand Down
2 changes: 1 addition & 1 deletion src/passes/MultiMemoryLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ struct MultiMemoryLowering : public Pass {
builder.makeReturn(builder.makeConst(-1))));

// If we are not growing the last memory, then we need to copy data,
// shifting it over to accomodate the increase from page_delta
// shifting it over to accommodate the increase from page_delta
if (!isLastMemory(memIdx)) {
// This offset is the starting pt for copying
auto offsetGlobalName = getOffsetGlobal(memIdx + 1);
Expand Down
2 changes: 1 addition & 1 deletion src/passes/OptimizeCasts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ struct EarlyCastFinder
// (ref.cast $B (ref.cast $B (local.get $x)))
//
// We initially choose to move the inner ref.cast $B. When we consider the
// outer ref.cast $B, we can see that it has the same type as tge existing
// outer ref.cast $B, we can see that it has the same type as the existing
// ref.cast $B, so we ignore it.
//
// Case 4:
Expand Down
6 changes: 3 additions & 3 deletions src/passes/OptimizeInstructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,7 @@ struct OptimizeInstructions

if (auto* select = ref->dynCast<Select>()) {
// We must check for unreachability explicitly here because a full
// refinalize only happens at the end. That is, the select may stil be
// refinalize only happens at the end. That is, the select may still be
// reachable after we turned one child into an unreachable, and we are
// calling getResultOfFirst which will error on unreachability.
if (flowsOutNull(select->ifTrue) &&
Expand Down Expand Up @@ -4704,7 +4704,7 @@ struct OptimizeInstructions
}
}
{
// TODO: Add cancelation for some large constants when shrinkLevel > 0
// TODO: Add cancellation for some large constants when shrinkLevel > 0
// in FinalOptimizer.

// (x >> C) << C => x & -(1 << C)
Expand All @@ -4729,7 +4729,7 @@ struct OptimizeInstructions
}
}
{
// TODO: Add cancelation for some large constants when shrinkLevel > 0
// TODO: Add cancellation for some large constants when shrinkLevel > 0
// in FinalOptimizer.

// (x << C) >>> C => x & (-1 >>> C)
Expand Down
4 changes: 2 additions & 2 deletions src/passes/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ struct PrintExpressionContents
o << "f16x8.demote_f64x2_zero";
break;
case InvalidUnary:
WASM_UNREACHABLE("unvalid unary operator");
WASM_UNREACHABLE("invalid unary operator");
}
restoreNormalColor(o);
}
Expand Down Expand Up @@ -2033,7 +2033,7 @@ struct PrintExpressionContents
break;

case InvalidBinary:
WASM_UNREACHABLE("unvalid binary operator");
WASM_UNREACHABLE("invalid binary operator");
}
restoreNormalColor(o);
}
Expand Down
2 changes: 1 addition & 1 deletion src/passes/TranslateEH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ struct TranslateToExnref : public WalkerPass<PostWalker<TranslateToExnref>> {
// rethrows, we can assume the exnref we want to rethrow is located in that
// exnref local at this point. We ensure this to happen when converting the
// corresponding 'try' to 'try_table' by using catch_ref/catch_all_ref and
// assining the exnref to that local.
// assigning the exnref to that local.
Builder builder(*getModule());
Index exnrefLocal = *localAssigner->getExnrefLocal(curr->target);
replaceCurrent(builder.makeThrowRef(
Expand Down
2 changes: 1 addition & 1 deletion src/passes/pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ void PassRegistry::registerPasses() {
registerPass(
"merge-blocks", "merges blocks to their parents", createMergeBlocksPass);
registerPass("merge-similar-functions",
"merges similar functions when benefical",
"merges similar functions when beneficial",
createMergeSimilarFunctionsPass);
registerPass(
"merge-locals", "merges locals when beneficial", createMergeLocalsPass);
Expand Down
12 changes: 6 additions & 6 deletions src/tools/fuzzing/fuzzing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,12 +968,12 @@ void TranslateToFuzzReader::finalizeTable() {
}
}

// The code above raises table->initial to a size large enough to accomodate
// all of its segments, with the intention of avoiding a trap during
// startup. However a single segment of (say) size 4GB would have a table of
// that size, which will use a lot of memory and execute very slowly, so we
// prefer in the fuzzer to trap on such a thing. To achieve that, set a
// reasonable limit for the maximum table size.
// The code above raises table->initial to a size large enough to
// accommodate all of its segments, with the intention of avoiding a trap
// during startup. However a single segment of (say) size 4GB would have a
// table of that size, which will use a lot of memory and execute very
// slowly, so we prefer in the fuzzer to trap on such a thing. To achieve
// that, set a reasonable limit for the maximum table size.
//
// This also avoids an issue that arises from table->initial being an
// Address (64 bits) but Table::kMaxSize being an Index (32 bits), as a
Expand Down
2 changes: 1 addition & 1 deletion src/tools/wasm-fuzz-lattices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ void checkLatticeProperties(Random& rand, bool verbose) {
<< LatticeComparisonNames[ij]
<< "\nSecond to third relation: "
<< LatticeComparisonNames[jk]
<< "\nFirst to thrid relation: " << LatticeComparisonNames[ik]
<< "\nFirst to third relation: " << LatticeComparisonNames[ik]
<< "\n";
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/wasm-split/instrumenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void Instrumenter::instrumentFuncs() {
// instrumented and the module that is being split are different. The timestamps
// are non-zero for functions that were called during the instrumented run and 0
// otherwise. Functions with smaller non-zero timestamps were called earlier in
// the instrumented run than funtions with larger timestamps.
// the instrumented run than functions with larger timestamps.

void Instrumenter::addProfileExport(size_t numFuncs) {
// Calculate the size of the profile:
Expand Down
4 changes: 2 additions & 2 deletions src/wasm/wasm-ir-builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//
// - Maintain a stack of control scopes (`ScopeCtx`).
//
// - Track an expression stack (`exprStack`) withing each scope.
// - Track an expression stack (`exprStack`) within each scope.
//
// - Pop children from `exprStack` (via `ChildPopper`), set them as operands on
// the new Expression, and push the Expression back onto `exprStack`.
Expand Down Expand Up @@ -1160,7 +1160,7 @@ Result<> IRBuilder::visitEnd() {
return curr;
}
auto* fixed = fixExtraOutput(scope, label, curr);
// We can re-use unnamed blocks instead of wrapping them.
// We can reuse unnamed blocks instead of wrapping them.
if (auto* block = fixed->dynCast<Block>(); block && !block->name) {
block->name = label;
block->type = blockType;
Expand Down
6 changes: 3 additions & 3 deletions src/wasm/wasm-validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2627,7 +2627,7 @@ void FunctionValidator::visitRefAs(RefAs* curr) {
case AnyConvertExtern: {
shouldBeTrue(getModule()->features.hasGC(),
curr,
"any.convert_extern requries GC [--enable-gc]");
"any.convert_extern requires GC [--enable-gc]");
if (curr->type == Type::unreachable) {
return;
}
Expand All @@ -2641,7 +2641,7 @@ void FunctionValidator::visitRefAs(RefAs* curr) {
case ExternConvertAny: {
shouldBeTrue(getModule()->features.hasGC(),
curr,
"extern.convert_any requries GC [--enable-gc]");
"extern.convert_any requires GC [--enable-gc]");
if (curr->type == Type::unreachable) {
return;
}
Expand Down Expand Up @@ -5170,7 +5170,7 @@ void validateGlobals(Module& module, ValidationInfo& info) {
}
FunctionValidator(module, &info).validate(curr->init);
// If GC is enabled (which means globals can refer to other non-imported
// globals), check that globals only refer to preceeding globals.
// globals), check that globals only refer to preceding globals.
if (module.features.hasGC() && curr->init) {
for (auto* get : FindAll<GlobalGet>(curr->init).list) {
auto* global = module.getGlobalOrNull(get->name);
Expand Down
2 changes: 1 addition & 1 deletion test/gtest/type-updating.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ TEST_F(IndirectCallEffectsTest, MapToNewType) {
// Because the type is brand new, we do *not* treat its absence in
// `indirectCallEffects` as 'unknown effects' like in `DestHasUnknownEffects`.
// Instead $"new type" just gains $A's effects. We do a pointer comparison
// here since the effects object can be re-used unchanged.
// here since the effects object can be reused unchanged.
EXPECT_THAT(merged, UnorderedElementsAre(Pair("new type", effectsA)));
}

Expand Down
4 changes: 2 additions & 2 deletions test/lit/basic/exception-handling-legacy.wast
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@
;; CHECK-BIN-NEXT: )
(func $branch-and-delegate-target-same-try-label
;; When there are both a branch and a delegate that target the same try
;; label. Because binaryen only allows blocks and loops to be targetted by
;; label. Because binaryen only allows blocks and loops to be targeted by
;; branches, we wrap the try with a block and make branches that block
;; instead, resulting in the br and delegate target different labels in the
;; output.
Expand Down Expand Up @@ -872,7 +872,7 @@
;; CHECK-BIN-NEXT: )
(func $branch-and-rethrow-target-same-try-label
;; When there are both a branch and a rethrow that target the same try
;; label. Because binaryen only allows blocks and loops to be targetted by
;; label. Because binaryen only allows blocks and loops to be targeted by
;; branches, we wrap the try with a block and make branches that block
;; instead, resulting in the br and rethrow target different labels in the
;; output.
Expand Down
2 changes: 1 addition & 1 deletion test/lit/ctor-eval/multivalue-local.wast
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

(call $import)

;; Use the locals so they are not trivally removed.
;; Use the locals so they are not trivially removed.
(i32.add
(local.get $0)
(tuple.extract 2 0
Expand Down
2 changes: 1 addition & 1 deletion test/lit/help/wasm-metadce.test
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
;; CHECK-NEXT: --merge-locals merges locals when beneficial
;; CHECK-EMPTY:
;; CHECK-NEXT: --merge-similar-functions merges similar functions when
;; CHECK-NEXT: benefical
;; CHECK-NEXT: beneficial
;; CHECK-EMPTY:
;; CHECK-NEXT: --metrics reports metrics (with an
;; CHECK-NEXT: optional title,
Expand Down
2 changes: 1 addition & 1 deletion test/lit/help/wasm-opt.test
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
;; CHECK-NEXT: --merge-locals merges locals when beneficial
;; CHECK-EMPTY:
;; CHECK-NEXT: --merge-similar-functions merges similar functions when
;; CHECK-NEXT: benefical
;; CHECK-NEXT: beneficial
;; CHECK-EMPTY:
;; CHECK-NEXT: --metrics reports metrics (with an
;; CHECK-NEXT: optional title,
Expand Down
2 changes: 1 addition & 1 deletion test/lit/help/wasm2js.test
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
;; CHECK-NEXT: --merge-locals merges locals when beneficial
;; CHECK-EMPTY:
;; CHECK-NEXT: --merge-similar-functions merges similar functions when
;; CHECK-NEXT: benefical
;; CHECK-NEXT: beneficial
;; CHECK-EMPTY:
;; CHECK-NEXT: --metrics reports metrics (with an
;; CHECK-NEXT: optional title,
Expand Down
Loading
Loading