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
2 changes: 1 addition & 1 deletion scripts/clusterfuzz/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
# Enable all features but disable ones not yet ready for fuzzing. This may
# be a smaller set than fuzz_opt.py, as that enables a few experimental
# flags, while here we just fuzz with d8's --wasm-staging. This should be
# synchonized with bundle_clusterfuzz.
# synchronized with bundle_clusterfuzz.
'-all',
'--disable-shared-everything',
'--disable-fp16',
Expand Down
2 changes: 1 addition & 1 deletion scripts/test/generate_atomic_spec_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def func():
)
"""
return f''';; Memory index must come before memory ordering if present.
;; Both immediates are optional; an ommitted memory ordering will be treated as seqcst.
;; Both immediates are optional; an omitted memory ordering will be treated as seqcst.
(func $test-all-ops
{indent(newline.join(statement(template, mem_idx, mem_ptr_type, ordering) for template, (mem_idx, mem_ptr_type), ordering in all_combinations()))}
)'''
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/lattice.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ concept Lattice = requires(const L& lattice,

// The analysis framework only uses bottom elements and least upper bounds (i.e.
// joins) directly, so lattices do not necessarily need to implement top
// elements and greatest lower bounds (i.e. meets) to be useable, even though
// elements and greatest lower bounds (i.e. meets) to be usable, even though
// they are required for mathematical lattices. Implementing top elements and
// meets does have the benefit of making a lattice generically invertable,
// though. See lattices/inverted.h.
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/monotone-analyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ template<Lattice L, TransferFunction TxFn> class MonotoneCFGAnalyzer {
std::vector<Element> states;

public:
// Will constuct BlockState objects corresponding to BasicBlocks from the
// Will construct BlockState objects corresponding to BasicBlocks from the
// given CFG.
MonotoneCFGAnalyzer(L& lattice, TxFn& txfn, CFG& cfg);

Expand Down
6 changes: 3 additions & 3 deletions src/analysis/reaching-definitions-transfer-function.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace wasm::analysis {

// When collecting results, the transfer function takes the states and converts
// it into a map of LocalGets to LocalSets which affect it. The fictitious
// inital value LocalSetes will be converted to nullptrs.
// initial value LocalSetes will be converted to nullptrs.

class ReachingDefinitionsTransferFunction
: public VisitorTransferFunc<ReachingDefinitionsTransferFunction,
Expand All @@ -44,7 +44,7 @@ class ReachingDefinitionsTransferFunction
// LocalGraph members we need to update.
LocalGraph::GetSetsMap& getSetsMap;

// Fictitious LocalSet objects to reprsent a local index obtaining its value
// Fictitious LocalSet objects to represent a local index obtaining its value
// from its default initial value or parameter value.
std::vector<LocalSet> fakeInitialValueSets;

Expand All @@ -54,7 +54,7 @@ class ReachingDefinitionsTransferFunction
// Helper function which creates fictitious LocalSets for a function,
// inserts them into fakeInitialValueSets and fakeSetPtrs. It returns a
// vector of actual LocalSets in the function and fictitious LocalSets for
// use when instatitating the lattice.
// use when instantiating the lattice.
static std::vector<LocalSet*>
listLocalSets(Function* func,
std::vector<LocalSet>& fakeInitialValueSets,
Expand Down
4 changes: 2 additions & 2 deletions src/binaryen-c.h
Original file line number Diff line number Diff line change
Expand Up @@ -3062,7 +3062,7 @@ BINARYEN_API void BinaryenModulePrintStackIR(BinaryenModuleRef module);
BINARYEN_API void BinaryenModulePrintAsmjs(BinaryenModuleRef module);

// Validate a module, showing errors on problems.
// @return 0 if an error occurred, 1 if validated succesfully
// @return 0 if an error occurred, 1 if validated successfully
BINARYEN_API bool BinaryenModuleValidate(BinaryenModuleRef module);

// Runs the standard optimization passes on the module. Uses the currently set
Expand Down Expand Up @@ -3283,7 +3283,7 @@ BINARYEN_API BinaryenModuleAllocateAndWriteResult
BinaryenModuleAllocateAndWrite(BinaryenModuleRef module,
const char* sourceMapUrl);

// Serialize a module in s-expression form. Implicity allocates the returned
// Serialize a module in s-expression form. Implicitly allocates the returned
// char* with malloc(), and expects the user to free() them manually
// once not needed anymore.
BINARYEN_API char* BinaryenModuleAllocateAndWriteText(BinaryenModuleRef module);
Expand Down
2 changes: 1 addition & 1 deletion src/cfg/Relooper.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

/*
This is an optimized C++ implemention of the Relooper algorithm originally
This is an optimized C++ implementation of the Relooper algorithm originally
developed as part of Emscripten. This implementation includes optimizations
added since the original academic paper [1] was published about it.

Expand Down
2 changes: 1 addition & 1 deletion src/cfg/cfg-traversal.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ struct CFGWalker : public PostWalker<SubType, VisitorType> {
}
}

// Exception thrown. Note outselves so that we will create a link to each
// Exception thrown. Note ourselves so that we will create a link to each
// catch within the try / each destination block within the try_table when
// we get there.
self->throwingInstsStack[i].push_back(self->currBasicBlock);
Expand Down
2 changes: 1 addition & 1 deletion src/ir/ExpressionManipulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace wasm::ExpressionManipulator {

Expression*
flexibleCopy(Expression* original, Module& wasm, CustomCopier custom) {
// Perform the copy using a stack of tasks (avoiding recusion).
// Perform the copy using a stack of tasks (avoiding recursion).
struct CopyTask {
// The thing to copy.
Expression* original;
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 @@ -22,7 +22,7 @@

namespace wasm {

// CRTP visitor for determining constaints on the types of expression children.
// CRTP visitor for determining constraints on the types of expression children.
// For each child of the visited expression, calls a callback with the VarTypes
// giving the constraint on the child:
//
Expand Down
2 changes: 1 addition & 1 deletion src/ir/eh-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ getFirstPop(Expression* catchBody, bool& isPopNested, Expression**& popPtr) {
auto* implicitBlock = catchBody->dynCast<Block>();

// Go down the line for the first child until we reach a leaf. A pop should be
// in that first-decendant line.
// in that first-descendant line.
Expression** firstChildPtr = nullptr;
while (true) {
if (firstChild->is<Pop>()) {
Expand Down
4 changes: 2 additions & 2 deletions src/ir/manipulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ template<typename InputType, typename OutputType>
inline OutputType* convert(InputType* input) {
static_assert(sizeof(OutputType) <= sizeof(InputType),
"Can only convert to a smaller size Expression node");
input->~InputType(); // arena-allocaed, so no destructor, but avoid UB.
input->~InputType(); // arena-allocated, so no destructor, but avoid UB.
OutputType* output = (OutputType*)(input);
new (output) OutputType;
return output;
Expand Down Expand Up @@ -57,7 +57,7 @@ inline Unreachable* unreachable(InputType* target) {
template<typename InputType, typename OutputType>
inline OutputType* convert(InputType* input, MixedArena& allocator) {
assert(sizeof(OutputType) <= sizeof(InputType));
input->~InputType(); // arena-allocaed, so no destructor, but avoid UB.
input->~InputType(); // arena-allocated, so no destructor, but avoid UB.
OutputType* output = (OutputType*)(input);
new (output) OutputType(allocator);
return output;
Expand Down
2 changes: 1 addition & 1 deletion src/ir/match.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace wasm::Match {
//
// Matches Binary expressions. Takes an optional pointer to Binary* at which
// to store the matched Binary*, followed by either a BinaryOp or an
// Abstract::Op describing which binary expresions to match, followed by
// Abstract::Op describing which binary expressions to match, followed by
// matchers to apply to the binary expression's left and right operands.
//
// select
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 @@ -1141,7 +1141,7 @@ void ModuleSplitter::shareImportableItems() {
// It's not used anywhere, so delete it. Unlike other unused module items
// (memories, tables, and tags) that can just sit in the primary module
// and later be DCE'ed by another pass, we should remove it here, because
// an unused global can contain an initialier that refers to another
// an unused global can contain an initializer that refers to another
// global that will be moved to a secondary module, like
// (global $unused i32 (global.get $a)) // $a is moved to a secondary
globalsToRemove.push_back(global->name);
Expand Down
2 changes: 1 addition & 1 deletion src/ir/principal-type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ bool PrincipalType::compose(const PrincipalType& next) {

apply(assignments, *this);
// If a type variable was instantiated with bottom type (i.e. unreachable) due
// to popping from an unreachabile stack, the result type may end with some
// to popping from an unreachable stack, the result type may end with some
// number of unreachables. This is nonsensical, since `unreachable` is not a
// concrete type. We could have alternatively left the variables
// uninstantiated, but it would have no corresponding introduction on the left
Expand Down
2 changes: 1 addition & 1 deletion src/ir/table-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ bool usesExpressions(ElementSegment* curr, Module* module);

// Information about a table's optimizability.
struct TableInfo {
// Whether the table may be modifed at runtime, either because it is imported
// Whether the table may be modified at runtime, either because it is imported
// or exported, or table.set operations exist for it in the code.
bool mayBeModified = false;

Expand Down
2 changes: 1 addition & 1 deletion src/parser/parsers.h
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ loop(Ctx& ctx, const std::vector<Annotation>& annotations, bool folded) {
// | '(' 'try' label blocktype '(' 'do' instr* ')'
// ('(' 'catch' tagidx instr* ')')*
// ('(' 'catch_all' instr* ')')? ')'
// | 'try' label blocktype instr* 'deledate' label
// | 'try' label blocktype instr* 'delegate' label
// | '(' 'try' label blocktype '(' 'do' instr* ')'
// '(' 'delegate' label ')' ')'
template<typename Ctx>
Expand Down
6 changes: 3 additions & 3 deletions src/passes/CodeFolding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ struct CodeFolding
auto* right = curr->ifFalse->dynCast<Block>();
// If one is a block and the other isn't, and the non-block is a tail of the
// other, we can fold that - for our convenience, we just add a block and
// run the rest of the optimization mormally.
// run the rest of the optimization normally.
auto maybeAddBlock = [this](Block* block, Expression*& other) -> Block* {
// If other is a suffix of the block, wrap it in a block.
//
Expand Down Expand Up @@ -594,10 +594,10 @@ struct CodeFolding
for (auto* item : items) {
saved += Measurer::measure(item) * (tails.size() - 1);
}
// compure the cost: in non-fallthroughs, we are replacing the final
// compute the cost: in non-fallthroughs, we are replacing the final
// element with a br; for a fallthrough, if there is one, we must
// add a return element (for the function body, so it doesn't reach us)
// TODO: handle fallthroughts for return
// TODO: handle fallthroughs for return
Index cost = tails.size();
// we also need to add two blocks: for us to break to, and to contain
// that block and the merged code. very possibly one of the blocks
Expand Down
2 changes: 1 addition & 1 deletion src/passes/CodePushing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ class Pusher {

// TODO: After pushing we could recurse and run both this function and
// optimizeSegment in that location. For now, leave that to later
// cycles of the optimizer, as this case seems rairly rare.
// cycles of the optimizer, as this case seems fairly rare.
return true;
};

Expand Down
2 changes: 1 addition & 1 deletion src/passes/DataFlowOpts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ struct DataFlowOpts : public WalkerPass<PostWalker<DataFlowOpts>> {
}
// Now we know that all our DataFlow inputs are constant, and all
// our Binaryen IR representations of them are constant too. RUn
// precompute, which will transform the expression into a constanat.
// precompute, which will transform the expression into a constant.
Module temp;
// XXX we should copy expr here, in principle, and definitely will need to
// when we do arbitrarily regenerated expressions
Expand Down
2 changes: 1 addition & 1 deletion src/passes/DeNaN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ struct DeNaN : public WalkerPass<
module->addFunction(std::move(func));
};

// Check if a contant v128 may contain f32 or f64 NaNs.
// Check if a constant v128 may contain f32 or f64 NaNs.
bool hasNaNLane(Const* c) {
assert(c->type == Type::v128);
auto value = c->value;
Expand Down
2 changes: 1 addition & 1 deletion src/passes/EncloseWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//
// "Closes" the world, in the sense of making it more compatible with the
// --closed-world flag, in a potentially destructive manner. This is mainly
// useful for fuzzing (in that a random module is usually very incomptable with
// useful for fuzzing (in that a random module is usually very incompatible with
// closed world, with most types being public and hence unoptimizable, but
// running this pass makes as many as we can fully private).
//
Expand Down
2 changes: 1 addition & 1 deletion src/passes/Flatten.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ struct Flatten
// br_if leaves a value on the stack if not taken, which later can
// be the last element of the enclosing innermost block and flow
// out. The local we created using 'getTempForBreakTarget' returns
// the return type of the block this branch is targetting, which may
// the return type of the block this branch is targeting, which may
// not be the same with the innermost block's return type. For
// example,
// (block $any (result anyref)
Expand Down
2 changes: 1 addition & 1 deletion src/passes/GenerateDynCalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// Create `dynCall` helper functions used by emscripten. These allow JavaScript
// to call back into WebAssembly given a function pointer (table index). These
// are used primarily to implement the `invoke` functions which in turn are used
// to implment exceptions handling and setjmp/longjmp. Creates one for each
// to implement exceptions handling and setjmp/longjmp. Creates one for each
// signature in the indirect function table.
//

Expand Down
2 changes: 1 addition & 1 deletion src/passes/GlobalEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ struct GenerateGlobalEffects : public Pass {

// Compute the transitive closure of effects. To do so, first construct for
// each function a list of the functions that it is called by (so we need to
// propogate its effects to them), and then we'll construct the closure of
// propagate its effects to them), and then we'll construct the closure of
// that.
//
// callers[foo] = [func that calls foo, another func that calls foo, ..]
Expand Down
6 changes: 3 additions & 3 deletions src/passes/GlobalStructInference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ struct GlobalStructInference : public Pass {
if (values.size() == 1) {
// The case of 1 value is simple: trap if the ref is null, and
// otherwise return the value. Since the field is immutable, there
// cannot have been any writes to it we must synchonize with, so we do
// not need a fence.
// cannot have been any writes to it we must synchronize with, so we
// do not need a fence.
replaceCurrent(builder.makeSequence(
builder.makeDrop(builder.makeRefAs(RefAsNonNull, ref)),
getReadValue(values[0], fieldIndex, field, curr)));
Expand Down Expand Up @@ -655,7 +655,7 @@ struct GlobalStructInference : public Pass {
}
};

// Find the optimization opportunitites in parallel.
// Find the optimization opportunities in parallel.
ModuleUtils::ParallelFunctionAnalysis<GlobalsToUnnest> optimization(
*module, [&](Function* func, GlobalsToUnnest& globalsToUnnest) {
if (func->imported()) {
Expand Down
2 changes: 1 addition & 1 deletion src/passes/GlobalTypeOptimization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ struct GlobalTypeOptimization : public Pass {
std::unordered_set<HeapType> subtypesExposed;

// Mark the relevant prototype field as read and return true iff we newly
// know we have to propate the exposure to subtypes.
// know we have to propagate the exposure to subtypes.
auto noteExposed = [&](HeapType type, Exactness exact = Inexact) -> bool {
if (auto desc = type.getDescriptorType();
desc && JSUtils::hasPossibleJSPrototypeField(*desc)) {
Expand Down
2 changes: 1 addition & 1 deletion src/passes/I64ToI32Lowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ struct I64ToI32Lowering : public WalkerPass<PostWalker<I64ToI32Lowering>> {
return;
}
// We cannot break this up into smaller operations as it must be atomic.
// Lower to an instrinsic function that wasm2js will implement.
// Lower to an intrinsic function that wasm2js will implement.
TempVar lowBits = getTemp();
TempVar highBits = getTemp();
auto* getLow = builder->makeCall(
Expand Down
4 changes: 2 additions & 2 deletions src/passes/Inlining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ enum class InliningMode {
// We do not know yet if this function can be inlined, as that has
// not been computed yet.
Unknown,
// This function cannot be inlinined in any way.
// This function cannot be inlined in any way.
Uninlineable,
// This function can be inlined fully, that is, normally: the entire function
// can be inlined. This is in contrast to split/partial inlining, see below.
Expand Down Expand Up @@ -1260,7 +1260,7 @@ struct Inlining : public Pass {
// whether to optimize where we inline
bool optimize = false;

// the information for each function. recomputed in each iteraction
// the information for each function. recomputed in each interaction
NameInfoMap infos;

std::unique_ptr<FunctionSplitter> functionSplitter;
Expand Down
2 changes: 1 addition & 1 deletion src/passes/LLVMNontrappingFPToIntLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct LLVMNonTrappingFPToIntLoweringImpl
Builder builder(*getModule());
Index v = Builder::addVar(getFunction(), curr->value->type);
// if fabs(operand) < INT_MAX then use the trapping operation, else return
// INT_MIN. The altnernate value is correct for the case where the input is
// INT_MIN. The alternate value is correct for the case where the input is
// INT_MIN itself; otherwise it's UB so any value will do.
replaceCurrent(builder.makeIf(
builder.makeBinary(
Expand Down
4 changes: 2 additions & 2 deletions src/passes/MemoryPacking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace wasm {

namespace {

// A subsection of an orginal memory segment. If `isZero` is true, memory.fill
// A subsection of an original memory segment. If `isZero` is true, memory.fill
// will be used instead of memory.init for this range.
struct Range {
bool isZero;
Expand Down Expand Up @@ -651,7 +651,7 @@ void MemoryPacking::createSplitSegments(
if (segment->name.is()) {
// Name the first range after the original segment and all following
// ranges get numbered accordingly. This means that for segments that
// canot be split (segments that contains a single range) the input and
// cannot be split (segments that contains a single range) the input and
// output segment have the same name.
if (!segmentCount) {
name = segment->name;
Expand Down
2 changes: 1 addition & 1 deletion src/passes/Monomorphize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ struct Monomorphize : public Pass {
return;
}

// TODO: ignore calls with unreachable operands for simplicty
// TODO: ignore calls with unreachable operands for simplicity

// Compute the call context, and the new operands that the call would send
// if we use that context.
Expand Down
2 changes: 1 addition & 1 deletion src/passes/OptimizeCasts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ struct EarlyCastApplier : public PostWalker<EarlyCastApplier> {
}
};

// Find the best casted verisons of local.gets: other local.gets with the same
// Find the best casted versions of local.gets: other local.gets with the same
// value, but cast to a more refined type.
struct BestCastFinder : public LinearExecutionWalker<BestCastFinder> {

Expand Down
Loading
Loading