From:  Jan de Mooij <>
Date:  17 Nov 2017 16:39:30 Hong Kong Time



IMO it's okay to rely on the stack growing down in JIT code. All of our JIT
backends work like that right now and if this ever changes we would have to
refactor/audit a ton of things anyway (all callers of masm.push,
masm.getStackPointer would be a good start).


On Fri, Nov 17, 2017 at 9:06 AM, Lars Hansen  wrote:

> JS_STACK_GROWTH_DIRECTION is normally -1 (down) but is defined as 1 (up)
> for HPPA.
> Does anyone test with stack-growing-up any more?  (I know HPPA is tier-3,
> at best.)  Do any of you think about this possibility when you write code?
> When you masm.Push something and you need the address of the pushed item,
> do you worry about whether you should capture the stack pointer before or
> after you push?
> The wasm baseline compiler currently assumes that the stack grows down so I
> guess I can just add an assert there and somebody can fix that if it
> becomes necessary, but it would be nice to know if I should be worrying
> about this at all.
> (It looks like stack direction is now like floating point and endianness --
> all mainstream systems agree, at last.  I just hope everyone will get
> around to adopting TSO before too long.)
> --lars
> _______________________________________________
> dev-tech-js-engine-internals mailing list