comparison src/cpu/zero/vm/cppInterpreter_zero.cpp @ 17980:0bf37f737702

8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9 Summary: make compiled code bang the stack by the worst case size of the interpreter frame at deoptimization points. Reviewed-by: twisti, kvn
author roland
date Tue, 01 Apr 2014 09:36:49 +0200
parents a9becfeecd1b
children 52b4284cb496 ce8f6bb717c9
comparison
equal deleted inserted replaced
17978:ad51f24671c2 17980:0bf37f737702
914 stack->alloc((size_in_words - header_words) * wordSize); 914 stack->alloc((size_in_words - header_words) * wordSize);
915 915
916 return (InterpreterFrame *) fp; 916 return (InterpreterFrame *) fp;
917 } 917 }
918 918
919 int AbstractInterpreter::layout_activation(Method* method, 919 int AbstractInterpreter::size_activation(int max_stack,
920 int tempcount, 920 int tempcount,
921 int popframe_extra_args, 921 int extra_args,
922 int moncount, 922 int moncount,
923 int caller_actual_parameters, 923 int callee_param_count,
924 int callee_param_count, 924 int callee_locals,
925 int callee_locals, 925 bool is_top_frame) {
926 frame* caller, 926 int header_words = InterpreterFrame::header_words;
927 frame* interpreter_frame, 927 int monitor_words = moncount * frame::interpreter_frame_monitor_size();
928 bool is_top_frame, 928 int stack_words = is_top_frame ? max_stack : tempcount;
929 bool is_bottom_frame) { 929 int callee_extra_locals = callee_locals - callee_param_count;
930
931 return header_words + monitor_words + stack_words + callee_extra_locals;
932 }
933
934 void AbstractInterpreter::layout_activation(Method* method,
935 int tempcount,
936 int popframe_extra_args,
937 int moncount,
938 int caller_actual_parameters,
939 int callee_param_count,
940 int callee_locals,
941 frame* caller,
942 frame* interpreter_frame,
943 bool is_top_frame,
944 bool is_bottom_frame) {
930 assert(popframe_extra_args == 0, "what to do?"); 945 assert(popframe_extra_args == 0, "what to do?");
931 assert(!is_top_frame || (!callee_locals && !callee_param_count), 946 assert(!is_top_frame || (!callee_locals && !callee_param_count),
932 "top frame should have no caller"); 947 "top frame should have no caller");
933 948
934 // This code must exactly match what InterpreterFrame::build 949 // This code must exactly match what InterpreterFrame::build
935 // does (the full InterpreterFrame::build, that is, not the 950 // does (the full InterpreterFrame::build, that is, not the
936 // one that creates empty frames for the deoptimizer). 951 // one that creates empty frames for the deoptimizer).
937 // 952 //
938 // If interpreter_frame is not NULL then it will be filled in. 953 // interpreter_frame will be filled in. It's size is determined by
939 // It's size is determined by a previous call to this method, 954 // a previous call to the size_activation() method,
940 // so it should be correct.
941 // 955 //
942 // Note that tempcount is the current size of the expression 956 // Note that tempcount is the current size of the expression
943 // stack. For top most frames we will allocate a full sized 957 // stack. For top most frames we will allocate a full sized
944 // expression stack and not the trimmed version that non-top 958 // expression stack and not the trimmed version that non-top
945 // frames have. 959 // frames have.
946 960
947 int header_words = InterpreterFrame::header_words;
948 int monitor_words = moncount * frame::interpreter_frame_monitor_size(); 961 int monitor_words = moncount * frame::interpreter_frame_monitor_size();
949 int stack_words = is_top_frame ? method->max_stack() : tempcount; 962 intptr_t *locals = interpreter_frame->fp() + method->max_locals();
950 int callee_extra_locals = callee_locals - callee_param_count; 963 interpreterState istate = interpreter_frame->get_interpreterState();
951 964 intptr_t *monitor_base = (intptr_t*) istate;
952 if (interpreter_frame) { 965 intptr_t *stack_base = monitor_base - monitor_words;
953 intptr_t *locals = interpreter_frame->fp() + method->max_locals(); 966 intptr_t *stack = stack_base - tempcount - 1;
954 interpreterState istate = interpreter_frame->get_interpreterState(); 967
955 intptr_t *monitor_base = (intptr_t*) istate; 968 BytecodeInterpreter::layout_interpreterState(istate,
956 intptr_t *stack_base = monitor_base - monitor_words; 969 caller,
957 intptr_t *stack = stack_base - tempcount - 1; 970 NULL,
958 971 method,
959 BytecodeInterpreter::layout_interpreterState(istate, 972 locals,
960 caller, 973 stack,
961 NULL, 974 stack_base,
962 method, 975 monitor_base,
963 locals, 976 NULL,
964 stack, 977 is_top_frame);
965 stack_base,
966 monitor_base,
967 NULL,
968 is_top_frame);
969 }
970 return header_words + monitor_words + stack_words + callee_extra_locals;
971 } 978 }
972 979
973 void BytecodeInterpreter::layout_interpreterState(interpreterState istate, 980 void BytecodeInterpreter::layout_interpreterState(interpreterState istate,
974 frame* caller, 981 frame* caller,
975 frame* current, 982 frame* current,