Does the element on stack has the same size?

View: New views
2 Messages — Rating Filter:   Alert me  

Does the element on stack has the same size?

by Colin(Du Li) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I have a question about hotspot operand stack.
I find following codes in abstractinterpreter.hpp
  static int stackElementWords()   { return TaggedStackInterpreter ? 2 : 1; }

Does that mean the size of any element on stack is either 1 or 2 words, right?
If so, how the stack can store double type parameters?
e.g.
for method:   M(double d){}
How can parameter 'd' can be pushed into operand stack before the method 'M' is executed?
Thanks a lot!

Du LI

Re: Does the element on stack has the same size?

by paul.hohensee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

double and long values take up two stack slots in the regular
interpreter and 4
in the tagged stack interpreter.

paul

Colin(Du Li) wrote:

> Hello,
>
> I have a question about hotspot operand stack.
> I find following codes in abstractinterpreter.hpp
>   static int stackElementWords()   { return TaggedStackInterpreter ? 2 : 1;
> }
>
> Does that mean the size of any element on stack is either 1 or 2 words,
> right?
> If so, how the stack can store double type parameters?
> e.g.
> for method:   M(double d){}
> How can parameter 'd' can be pushed into operand stack before the method 'M'
> is executed?
> Thanks a lot!
>
> Du LI
>