From e9444a1f882ef31d5df161265e2493de5a50196c Mon Sep 17 00:00:00 2001 From: kvn Date: Thu, 16 Feb 2012 17:12:49 -0800 Subject: 7145346: VerifyStackAtCalls is broken Summary: Replace call_epilog() encoding with macroassembler use. Moved duplicated code to x86.ad. Fixed return_addr() definition. Reviewed-by: never --- src/share/vm/opto/chaitin.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'src/share/vm/opto/chaitin.cpp') diff --git a/src/share/vm/opto/chaitin.cpp b/src/share/vm/opto/chaitin.cpp index 21b4716b3..a74114add 100644 --- a/src/share/vm/opto/chaitin.cpp +++ b/src/share/vm/opto/chaitin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1946,18 +1946,29 @@ void PhaseChaitin::dump_frame() const { reg2offset_unchecked(OptoReg::add(_matcher._old_SP,-1)) - reg2offset_unchecked(_matcher._new_SP)+jintSize); // Preserve area dump + int fixed_slots = C->fixed_slots(); + OptoReg::Name begin_in_preserve = OptoReg::add(_matcher._old_SP, -(int)C->in_preserve_stack_slots()); + OptoReg::Name return_addr = _matcher.return_addr(); + reg = OptoReg::add(reg, -1); - while( OptoReg::is_stack(reg)) { + while (OptoReg::is_stack(reg)) { tty->print("#r%3.3d %s+%2d: ",reg,fp,reg2offset_unchecked(reg)); - if( _matcher.return_addr() == reg ) + if (return_addr == reg) { tty->print_cr("return address"); - else if( _matcher.return_addr() == OptoReg::add(reg,1) && - VerifyStackAtCalls ) - tty->print_cr("0xBADB100D +VerifyStackAtCalls"); - else if ((int)OptoReg::reg2stack(reg) < C->fixed_slots()) + } else if (reg >= begin_in_preserve) { + // Preserved slots are present on x86 + if (return_addr == OptoReg::add(reg, VMRegImpl::slots_per_word)) + tty->print_cr("saved fp register"); + else if (return_addr == OptoReg::add(reg, 2*VMRegImpl::slots_per_word) && + VerifyStackAtCalls) + tty->print_cr("0xBADB100D +VerifyStackAtCalls"); + else + tty->print_cr("in_preserve"); + } else if ((int)OptoReg::reg2stack(reg) < fixed_slots) { tty->print_cr("Fixed slot %d", OptoReg::reg2stack(reg)); - else - tty->print_cr("pad2, in_preserve"); + } else { + tty->print_cr("pad2, stack alignment"); + } reg = OptoReg::add(reg, -1); } -- cgit v1.2.3