diff options
Diffstat (limited to 'src/wasm-stack.h')
-rw-r--r-- | src/wasm-stack.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wasm-stack.h b/src/wasm-stack.h index fc38d07a4..e51e5eb91 100644 --- a/src/wasm-stack.h +++ b/src/wasm-stack.h @@ -155,10 +155,15 @@ private: // Return the type and number of required scratch locals. InsertOrderedMap<Type, Index> countScratchLocals(); - // local.get, local.tee, and glboal.get expressions that will be followed by + // local.get, local.tee, and global.get expressions that will be followed by // tuple.extracts. We can optimize these by getting only the local for the // extracted index. std::unordered_map<Expression*, Index> extractedGets; + + // As an optimization, we do not need to use scratch locals for StringWTF16Get + // and StringSliceWTF if their non-string operands are already LocalGets. + // Record those LocalGets here. + std::unordered_set<LocalGet*> deferredGets; }; // Takes binaryen IR and converts it to something else (binary or stack IR) @@ -543,6 +548,7 @@ private: void removeAt(Index i); Index getNumConsumedValues(StackInst* inst); bool canRemoveSetGetPair(Index setIndex, Index getIndex); + std::unordered_set<LocalGet*> findStringViewDeferredGets(); }; // Generate and emit StackIR. |