RFR(S): 8017313: PPC64 (part 6): cppInterpreter: stack handling improvements
Lindenmaier, Goetz
goetz.lindenmaier at sap.com
Tue Jun 25 06:27:36 PDT 2013
Hi Colleen, David,
I'll rename the methods to stack_overflow_limit and update the webrev,
I like that name better too.
We set it in os::initialize_thread():
http://hg.openjdk.java.net/ppc-aix-port/jdk8/hotspot/file/2a6fd169b0b7/src/os_cpu/linux_ppc/vm/os_linux_ppc.cpp
and we use it here (line427):
http://hg.openjdk.java.net/ppc-aix-port/jdk8/hotspot/file/2a6fd169b0b7/src/cpu/ppc/vm/cppInterpreter_ppc.cpp
In that files the method is called [set_]memory_stack_limit().
Actually, it's got nothing to do with the cppInterpreter. I first thought so,
because we only used it with the cppInterpreter when I moved this from
our VM to the port (a while ago now). But look at the code in
void InterpreterGenerator::generate_stack_overflow_check(void) on x86 that
computes the stack bound in rax ... that's not really simple, and requires
two loads (stack_base, stack_size).
The difference between cppInterpreter and template interpreter is that
we always check against the stack_limit in the cppInterpreter, but the
templateInterpreter first checks whether the stack is < 1 page, thus
experiencing less overhead from the lengthy coding.
Best regards,
Goetz
-----Original Message-----
From: hotspot-dev-bounces at openjdk.java.net [mailto:hotspot-dev-bounces at openjdk.java.net] On Behalf Of Coleen Phillimore
Sent: Dienstag, 25. Juni 2013 14:49
To: hotspot-dev at openjdk.java.net
Subject: Re: RFR(S): 8017313: PPC64 (part 6): cppInterpreter: stack handling improvements
Which stack limit is this? Does it subtract off the red and yellow
zones? Where do you set it? Yes, it would simplify the assembler code
in the interpreter entries to use this.
It might be better to rename it though if it's the usable stack
(subtracting red and yellow zones) and maybe compute the value inside of
Thread class (so you see it always subtracting the red and yellow
zones). It's sort of ambiguous that this is happening. How about
stack_overflow_limit()?
Thanks,
Coleen
On 06/25/2013 08:44 AM, Lindenmaier, Goetz wrote:
> Hi,
>
> We precompute the stack limit for overflow checks and save this
> limit in the thread. This simplifies the assembler coding checking
> the stack overflow. This change contains the necessary shared
> functionality. It can easily be ported to other platforms, too.
> http://cr.openjdk.java.net/~goetz/webrevs/8017313-stack/
>
> Please review this change.
>
> Best regards,
> Goetz.
>
> PS: I removed some parts of patch 0006 because I found a better
> platform-only solution.
More information about the hotspot-dev
mailing list