From 7ea9b53194e78fc6655dfca8f69f3f8ef84d9939 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 26 Nov 2015 19:45:44 -0800 Subject: wasm2asm progress --- src/emscripten-optimizer/simple_ast.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/emscripten-optimizer') diff --git a/src/emscripten-optimizer/simple_ast.h b/src/emscripten-optimizer/simple_ast.h index b524a4b2b..9e19249ab 100644 --- a/src/emscripten-optimizer/simple_ast.h +++ b/src/emscripten-optimizer/simple_ast.h @@ -1533,6 +1533,16 @@ public: .push_back(target) .push_back(value); } + + static Ref makeSub(Ref obj, Ref index) { + return &makeRawArray(2)->push_back(makeRawString(SUB)) + .push_back(obj) + .push_back(index); + } + + static Ref makePtrShift(Ref ptr, int shifts) { + return makeBinary(ptr, RSHIFT, makeInt(shifts)); + } }; // Tolerates 0.0 in the input; does not trust a +() to be there. -- cgit v1.2.3