From:  "Nicolas B. Pierron" <nicolas.b.pierron@mozilla.com>
Date:  17 Nov 2017 21:18:30 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.tech.js-engine.internals
Subject:  

Re: JS_STACK_GROWTH_DIRECTION

NNTP-Posting-Host:  195.81.232.10

I agree with Jan, all the logic of the frame iterator is based on the stack 
growing down, as well as the way the pointers are being coerced and interpreted.

For now, I think it is safe to assume that the stack grows down in the 
generated code. (jit & wasm directories)

On 11/17/2017 08:39 AM, Jan de Mooij wrote:
> 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).
> 
> Jan
> 
> 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
>> dev-tech-js-engine-internals@lists.mozilla.org
>> https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals
>>


-- 
Nicolas B. Pierron