8009981: nashorn tests fail with -XX:+VerifyStack

Nmethod::preserve_callee_argument_oops() must take appendix into account.

Reviewed-by: kvn, twisti
This commit is contained in:
Roland Westrelin 2013-05-31 14:40:26 +02:00
parent 337a9c1432
commit 6a17746b6c
6 changed files with 32 additions and 17 deletions

View file

@ -1008,6 +1008,7 @@ class CompiledArgumentOopFinder: public SignatureInfo {
OopClosure* _f;
int _offset; // the current offset, incremented with each argument
bool _has_receiver; // true if the callee has a receiver
bool _has_appendix; // true if the call has an appendix
frame _fr;
RegisterMap* _reg_map;
int _arg_size;
@ -1027,19 +1028,20 @@ class CompiledArgumentOopFinder: public SignatureInfo {
}
public:
CompiledArgumentOopFinder(Symbol* signature, bool has_receiver, OopClosure* f, frame fr, const RegisterMap* reg_map)
CompiledArgumentOopFinder(Symbol* signature, bool has_receiver, bool has_appendix, OopClosure* f, frame fr, const RegisterMap* reg_map)
: SignatureInfo(signature) {
// initialize CompiledArgumentOopFinder
_f = f;
_offset = 0;
_has_receiver = has_receiver;
_has_appendix = has_appendix;
_fr = fr;
_reg_map = (RegisterMap*)reg_map;
_arg_size = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0);
_arg_size = ArgumentSizeComputer(signature).size() + (has_receiver ? 1 : 0) + (has_appendix ? 1 : 0);
int arg_size;
_regs = SharedRuntime::find_callee_arguments(signature, has_receiver, &arg_size);
_regs = SharedRuntime::find_callee_arguments(signature, has_receiver, has_appendix, &arg_size);
assert(arg_size == _arg_size, "wrong arg size");
}
@ -1049,12 +1051,16 @@ class CompiledArgumentOopFinder: public SignatureInfo {
_offset++;
}
iterate_parameters();
if (_has_appendix) {
handle_oop_offset();
_offset++;
}
}
};
void frame::oops_compiled_arguments_do(Symbol* signature, bool has_receiver, const RegisterMap* reg_map, OopClosure* f) {
void frame::oops_compiled_arguments_do(Symbol* signature, bool has_receiver, bool has_appendix, const RegisterMap* reg_map, OopClosure* f) {
ResourceMark rm;
CompiledArgumentOopFinder finder(signature, has_receiver, f, *this, reg_map);
CompiledArgumentOopFinder finder(signature, has_receiver, has_appendix, f, *this, reg_map);
finder.oops_do();
}