@@ -3049,151 +3049,12 @@ BytecodeInterpreter::BytecodeInterpreter(messages msg) {
30493049 _prev_link = NULL ;
30503050}
30513051
3052- // Inline static functions for Java Stack and Local manipulation
3053-
3054- // The implementations are platform dependent. We have to worry about alignment
3055- // issues on some machines which can change on the same platform depending on
3056- // whether it is an LP64 machine also.
3057- address BytecodeInterpreter::stack_slot (intptr_t *tos, int offset) {
3058- return (address) tos[Interpreter::expr_index_at (-offset)];
3059- }
3060-
3061- jint BytecodeInterpreter::stack_int (intptr_t *tos, int offset) {
3062- return *((jint*) &tos[Interpreter::expr_index_at (-offset)]);
3063- }
3064-
3065- jfloat BytecodeInterpreter::stack_float (intptr_t *tos, int offset) {
3066- return *((jfloat *) &tos[Interpreter::expr_index_at (-offset)]);
3067- }
3068-
3069- oop BytecodeInterpreter::stack_object (intptr_t *tos, int offset) {
3070- return cast_to_oop (tos [Interpreter::expr_index_at (-offset)]);
3071- }
3072-
3073- jdouble BytecodeInterpreter::stack_double (intptr_t *tos, int offset) {
3074- return ((VMJavaVal64*) &tos[Interpreter::expr_index_at (-offset)])->d ;
3075- }
3076-
3077- jlong BytecodeInterpreter::stack_long (intptr_t *tos, int offset) {
3078- return ((VMJavaVal64 *) &tos[Interpreter::expr_index_at (-offset)])->l ;
3079- }
3080-
3081- // only used for value types
3082- void BytecodeInterpreter::set_stack_slot (intptr_t *tos, address value,
3083- int offset) {
3084- *((address *)&tos[Interpreter::expr_index_at (-offset)]) = value;
3085- }
3086-
3087- void BytecodeInterpreter::set_stack_int (intptr_t *tos, int value,
3088- int offset) {
3089- *((jint *)&tos[Interpreter::expr_index_at (-offset)]) = value;
3090- }
3091-
3092- void BytecodeInterpreter::set_stack_float (intptr_t *tos, jfloat value,
3093- int offset) {
3094- *((jfloat *)&tos[Interpreter::expr_index_at (-offset)]) = value;
3095- }
3096-
3097- void BytecodeInterpreter::set_stack_object (intptr_t *tos, oop value,
3098- int offset) {
3099- *((oop *)&tos[Interpreter::expr_index_at (-offset)]) = value;
3100- }
3101-
3102- // needs to be platform dep for the 32 bit platforms.
3103- void BytecodeInterpreter::set_stack_double (intptr_t *tos, jdouble value,
3104- int offset) {
3105- ((VMJavaVal64*)&tos[Interpreter::expr_index_at (-offset)])->d = value;
3106- }
3107-
3108- void BytecodeInterpreter::set_stack_double_from_addr (intptr_t *tos,
3109- address addr, int offset) {
3110- (((VMJavaVal64*)&tos[Interpreter::expr_index_at (-offset)])->d =
3111- ((VMJavaVal64*)addr)->d );
3112- }
3113-
3114- void BytecodeInterpreter::set_stack_long (intptr_t *tos, jlong value,
3115- int offset) {
3116- ((VMJavaVal64*)&tos[Interpreter::expr_index_at (-offset+1 )])->l = 0xdeedbeeb ;
3117- ((VMJavaVal64*)&tos[Interpreter::expr_index_at (-offset)])->l = value;
3118- }
3119-
3120- void BytecodeInterpreter::set_stack_long_from_addr (intptr_t *tos,
3121- address addr, int offset) {
3122- ((VMJavaVal64*)&tos[Interpreter::expr_index_at (-offset+1 )])->l = 0xdeedbeeb ;
3123- ((VMJavaVal64*)&tos[Interpreter::expr_index_at (-offset)])->l =
3124- ((VMJavaVal64*)addr)->l ;
3125- }
3126-
3127- // Locals
3128-
3129- address BytecodeInterpreter::locals_slot (intptr_t * locals, int offset) {
3130- return (address)locals[Interpreter::local_index_at (-offset)];
3131- }
3132- jint BytecodeInterpreter::locals_int (intptr_t * locals, int offset) {
3133- return (jint)locals[Interpreter::local_index_at (-offset)];
3134- }
3135- jfloat BytecodeInterpreter::locals_float (intptr_t * locals, int offset) {
3136- return (jfloat)locals[Interpreter::local_index_at (-offset)];
3137- }
3138- oop BytecodeInterpreter::locals_object (intptr_t * locals, int offset) {
3139- return cast_to_oop (locals[Interpreter::local_index_at (-offset)]);
3140- }
3141- jdouble BytecodeInterpreter::locals_double (intptr_t * locals, int offset) {
3142- return ((VMJavaVal64*)&locals[Interpreter::local_index_at (-(offset+1 ))])->d ;
3143- }
3144- jlong BytecodeInterpreter::locals_long (intptr_t * locals, int offset) {
3145- return ((VMJavaVal64*)&locals[Interpreter::local_index_at (-(offset+1 ))])->l ;
3146- }
3147-
3148- // Returns the address of locals value.
3149- address BytecodeInterpreter::locals_long_at (intptr_t * locals, int offset) {
3150- return ((address)&locals[Interpreter::local_index_at (-(offset+1 ))]);
3151- }
3152- address BytecodeInterpreter::locals_double_at (intptr_t * locals, int offset) {
3153- return ((address)&locals[Interpreter::local_index_at (-(offset+1 ))]);
3154- }
3155-
3156- // Used for local value or returnAddress
3157- void BytecodeInterpreter::set_locals_slot (intptr_t *locals,
3158- address value, int offset) {
3159- *((address*)&locals[Interpreter::local_index_at (-offset)]) = value;
3160- }
3161- void BytecodeInterpreter::set_locals_int (intptr_t *locals,
3162- jint value, int offset) {
3163- *((jint *)&locals[Interpreter::local_index_at (-offset)]) = value;
3164- }
3165- void BytecodeInterpreter::set_locals_float (intptr_t *locals,
3166- jfloat value, int offset) {
3167- *((jfloat *)&locals[Interpreter::local_index_at (-offset)]) = value;
3168- }
3169- void BytecodeInterpreter::set_locals_object (intptr_t *locals,
3170- oop value, int offset) {
3171- *((oop *)&locals[Interpreter::local_index_at (-offset)]) = value;
3172- }
3173- void BytecodeInterpreter::set_locals_double (intptr_t *locals,
3174- jdouble value, int offset) {
3175- ((VMJavaVal64*)&locals[Interpreter::local_index_at (-(offset+1 ))])->d = value;
3176- }
3177- void BytecodeInterpreter::set_locals_long (intptr_t *locals,
3178- jlong value, int offset) {
3179- ((VMJavaVal64*)&locals[Interpreter::local_index_at (-(offset+1 ))])->l = value;
3180- }
3181- void BytecodeInterpreter::set_locals_double_from_addr (intptr_t *locals,
3182- address addr, int offset) {
3183- ((VMJavaVal64*)&locals[Interpreter::local_index_at (-(offset+1 ))])->d = ((VMJavaVal64*)addr)->d ;
3184- }
3185- void BytecodeInterpreter::set_locals_long_from_addr (intptr_t *locals,
3186- address addr, int offset) {
3187- ((VMJavaVal64*)&locals[Interpreter::local_index_at (-(offset+1 ))])->l = ((VMJavaVal64*)addr)->l ;
3188- }
3189-
31903052void BytecodeInterpreter::astore (intptr_t * tos, int stack_offset,
31913053 intptr_t * locals, int locals_offset) {
31923054 intptr_t value = tos[Interpreter::expr_index_at (-stack_offset)];
31933055 locals[Interpreter::local_index_at (-locals_offset)] = value;
31943056}
31953057
3196-
31973058void BytecodeInterpreter::copy_stack_slot (intptr_t *tos, int from_offset,
31983059 int to_offset) {
31993060 tos[Interpreter::expr_index_at (-to_offset)] =
@@ -3203,6 +3064,7 @@ void BytecodeInterpreter::copy_stack_slot(intptr_t *tos, int from_offset,
32033064void BytecodeInterpreter::dup (intptr_t *tos) {
32043065 copy_stack_slot (tos, -1 , 0 );
32053066}
3067+
32063068void BytecodeInterpreter::dup2 (intptr_t *tos) {
32073069 copy_stack_slot (tos, -2 , 0 );
32083070 copy_stack_slot (tos, -1 , 1 );
0 commit comments