From gbenson at redhat.com Thu Sep 3 06:17:57 2009 From: gbenson at redhat.com (Gary Benson) Date: Thu, 3 Sep 2009 14:17:57 +0100 Subject: Zero tweaks Message-ID: <20090903131757.GB3933@redhat.com> Hi all, This commit updates the Zero in icedtea6 to match the one in http://cr.openjdk.java.net/~gbenson/zero-07/. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 21edcf84dc76 ChangeLog --- a/ChangeLog Mon Aug 31 07:45:07 2009 +0200 +++ b/ChangeLog Thu Sep 03 09:00:35 2009 -0400 @@ -1,3 +1,33 @@ +2009-09-03 Gary Benson + + * ports/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp + Added copyright header. + * ports/hotspot/src/cpu/zero/vm/assembler_zero.inline.hpp: + Added copyright header and "intentionally empty" message. + * ports/hotspot/src/cpu/zero/vm/depChecker_zero.cpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/depChecker_zero.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp: + Likewise. + * ports/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/templateTable_zero.cpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/templateTable_zero.hpp: Likewise. + * ports/hotspot/src/cpu/zero/vm/vm_version_zero.cpp: Likewise. + * ports/hotspot/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp: + Likewise. + * ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp: + Likewise. + * ports/hotspot/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp: + Likewise. + + * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp + (ZeroStackPrinter::print_word): Replaced a couple of "%d"s with + INTPTR_FORMAT. + 2009-08-31 Mark Wielaard Keith Seitz diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/assembler_zero.inline.hpp --- a/ports/hotspot/src/cpu/zero/vm/assembler_zero.inline.hpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/assembler_zero.inline.hpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp Thu Sep 03 09:00:35 2009 -0400 @@ -1,3 +1,28 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + #if defined(PRODUCT) && defined(HOTSPOT_ASM) #define _iaccess_0 ((Bytecodes::Code)0xdb) #define _iaccess_1 ((Bytecodes::Code)0xdc) diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/depChecker_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/depChecker_zero.cpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/depChecker_zero.cpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/depChecker_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/depChecker_zero.hpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/depChecker_zero.hpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/disassembler_zero.cpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/globalDefinitions_zero.hpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/interp_masm_zero.cpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/register_definitions_zero.cpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp Thu Sep 03 09:00:35 2009 -0400 @@ -190,7 +190,7 @@ } } else { - snprintf(_buf, _buflen, "%s[%d]", + snprintf(_buf, _buflen, "%s[" INTPTR_FORMAT "]", top_frame ? "stack_word" : "local", istate->stack_base() - addr - 1); field = _buf; @@ -250,7 +250,7 @@ } } else { - snprintf(_buf, _buflen, "%s[%d]", + snprintf(_buf, _buflen, "%s[" INTPTR_FORMAT "]", top_frame ? "stack_word" : "local", stack_base - addr - 1); field = _buf; diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/templateInterpreterGenerator_zero.hpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/templateInterpreter_zero.cpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/templateInterpreter_zero.hpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/templateTable_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/templateTable_zero.cpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/templateTable_zero.cpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/templateTable_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/templateTable_zero.hpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/templateTable_zero.hpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/cpu/zero/vm/vm_version_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/vm_version_zero.cpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/cpu/zero/vm/vm_version_zero.cpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp --- a/ports/hotspot/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/os_cpu/linux_zero/vm/assembler_linux_zero.cpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp --- a/ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.cpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty diff -r 21edcf84dc76 ports/hotspot/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp --- a/ports/hotspot/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp Mon Aug 31 07:45:07 2009 +0200 +++ b/ports/hotspot/src/os_cpu/linux_zero/vm/vm_version_linux_zero.cpp Thu Sep 03 09:00:35 2009 -0400 @@ -0,0 +1,26 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + +// This file is intentionally empty From gbenson at redhat.com Fri Sep 4 02:54:35 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 4 Sep 2009 10:54:35 +0100 Subject: Zero ICache fixes Message-ID: <20090904095435.GA3312@redhat.com> Hi all, This commit rearranges the instruction cache code in Zero to remove a conditional that the HotSpot engineers didn't like. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r cc4f8460a676 ChangeLog --- a/ChangeLog Thu Sep 03 11:23:31 2009 -0400 +++ b/ChangeLog Fri Sep 04 05:43:02 2009 -0400 @@ -1,3 +1,16 @@ +2009-09-04 Gary Benson + + * ports/hotspot/src/cpu/zero/vm/icache_zero.hpp + (ICache::initialize): New method. + (ICache::invalidate_word): Likewise. + (ICache::invalidate_range): Likewise. + + * ports/hotspot/src/cpu/zero/vm/icache_zero.cpp + (ICacheStubGenerator::generate_icache_flush): Replaced with stub. + + * patches/icedtea-zero.patch + (AbstractICache::invalidate_range): Removed #ifdef ZERO. + 2009-09-03 Gary Benson * ports/hotspot/src/cpu/zero/vm/assembler_zero.cpp: Reformatted diff -r cc4f8460a676 patches/icedtea-zero.patch --- a/patches/icedtea-zero.patch Thu Sep 03 11:23:31 2009 -0400 +++ b/patches/icedtea-zero.patch Fri Sep 04 05:43:02 2009 -0400 @@ -100,24 +100,6 @@ tty->print_cr("self_link: " INTPTR_FORMAT, (uintptr_t) this->_self_link); } ---- openjdk/hotspot/src/share/vm/runtime/icache.cpp.orig 2008-07-27 08:37:02.000000000 +0000 -+++ openjdk/hotspot/src/share/vm/runtime/icache.cpp 2008-07-27 08:38:13.000000000 +0000 -@@ -78,6 +78,7 @@ - } - - void AbstractICache::invalidate_range(address start, int nbytes) { -+#ifndef ZERO - static bool firstTime = true; - if (firstTime) { - guarantee(start == CAST_FROM_FN_PTR(address, _flush_icache_stub), -@@ -97,6 +98,7 @@ - } - call_flush_stub(start, round_to(nbytes, ICache::line_size) >> - ICache::log2_line_size); -+#endif - } - - // For init.cpp --- openjdk/hotspot/src/share/vm/runtime/mutex.hpp.orig 2008-07-27 08:37:02.000000000 +0000 +++ openjdk/hotspot/src/share/vm/runtime/mutex.hpp 2008-07-27 08:38:13.000000000 +0000 @@ -61,18 +61,10 @@ diff -r cc4f8460a676 ports/hotspot/src/cpu/zero/vm/icache_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/icache_zero.cpp Thu Sep 03 11:23:31 2009 -0400 +++ b/ports/hotspot/src/cpu/zero/vm/icache_zero.cpp Fri Sep 04 05:43:02 2009 -0400 @@ -1,6 +1,6 @@ /* * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007 Red Hat, Inc. + * Copyright 2007, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,11 +26,7 @@ #include "incls/_precompiled.incl" #include "incls/_icache_zero.cpp.incl" - void ICacheStubGenerator::generate_icache_flush( ICache::flush_icache_stub_t* flush_icache_stub) { - - StubCodeMark mark(this, "ICache", "flush_icache_stub"); - - *flush_icache_stub = (ICache::flush_icache_stub_t) UnimplementedStub(); + Unimplemented(); } diff -r cc4f8460a676 ports/hotspot/src/cpu/zero/vm/icache_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/icache_zero.hpp Thu Sep 03 11:23:31 2009 -0400 +++ b/ports/hotspot/src/cpu/zero/vm/icache_zero.hpp Fri Sep 04 05:43:02 2009 -0400 @@ -1,6 +1,6 @@ /* * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007 Red Hat, Inc. + * Copyright 2007, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,12 @@ // Interface for updating the instruction cache. Whenever the VM // modifies code, part of the processor instruction cache potentially -// has to be flushed. +// has to be flushed. This implementation is empty: Zero never deals +// with code, and LLVM handles cache flushing for Shark. class ICache : public AbstractICache { - // Use default implementation + public: + static void initialize() {} + static void invalidate_word(address addr) {} + static void invalidate_range(address start, int nbytes) {} }; From gbenson at redhat.com Fri Sep 4 04:24:42 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 4 Sep 2009 12:24:42 +0100 Subject: Zero type changes Message-ID: <20090904112442.GB3312@redhat.com> Hi all, This commit changes the name of some types that didn't match the usual HotSpot coding standards. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 903849a786da ChangeLog --- a/ChangeLog Fri Sep 04 05:43:23 2009 -0400 +++ b/ChangeLog Fri Sep 04 07:13:01 2009 -0400 @@ -1,3 +1,35 @@ +2009-09-04 Gary Benson + + * ports/hotspot/src/cpu/zero/vm/entry_zero.hpp + (ZeroEntry::method_entry_t): Renamed as... + (ZeroEntry::NormalEntryFunc): New type. + (ZeroEntry::osr_entry_t): Renamed as... + (ZeroEntry::OSREntryFunc): New type. + (ZeroEntry::_entry_point): Changed type. + (ZeroEntry::entry_point): Changed signature. + (ZeroEntry::set_entry_point): Likewise. + (ZeroEntry::invoke): Added cast. + (ZeroEntry::invoke_osr): Updated cast. + + * ports/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp + (CppInterpreter::generate_entry): Changed signature. + + * ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp + (InterpreterGenerator::generate_normal_entry): Added cast. + (InterpreterGenerator::generate_native_entry): Likewise. + (InterpreterGenerator::generate_accessor_entry): Likewise. + (InterpreterGenerator::generate_empty_entry): Likewise. + (AbstractInterpreterGenerator::generate_method_entry): Likewise. + + * ports/hotspot/src/share/vm/shark/sharkCompiler.cpp + (SharkCompiler::compile_method): Updated cast. + + * ports/hotspot/src/share/vm/shark/sharkEntry.hpp + (SharkEntry::code_start): Removed cast. + + * ports/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp + (NativeJump::patch_verified_entry): Added cast. + 2009-09-04 Gary Benson * ports/hotspot/src/cpu/zero/vm/icache_zero.hpp diff -r 903849a786da ports/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp Fri Sep 04 05:43:23 2009 -0400 +++ b/ports/hotspot/src/cpu/zero/vm/cppInterpreterGenerator_zero.hpp Fri Sep 04 07:13:01 2009 -0400 @@ -1,6 +1,6 @@ /* * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2008 Red Hat, Inc. + * Copyright 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ } protected: - address generate_entry(ZeroEntry::method_entry_t entry_point) { + address generate_entry(address entry_point) { ZeroEntry *entry = (ZeroEntry *) assembler()->pc(); assembler()->advance(sizeof(ZeroEntry)); entry->set_entry_point(entry_point); diff -r 903849a786da ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Fri Sep 04 05:43:23 2009 -0400 +++ b/ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp Fri Sep 04 07:13:01 2009 -0400 @@ -697,26 +697,26 @@ if (!UseFastEmptyMethods) return NULL; - return generate_entry(CppInterpreter::empty_entry); + return generate_entry((address) CppInterpreter::empty_entry); } address InterpreterGenerator::generate_accessor_entry() { if (!UseFastAccessorMethods) return NULL; - return generate_entry(CppInterpreter::accessor_entry); + return generate_entry((address) CppInterpreter::accessor_entry); } address InterpreterGenerator::generate_native_entry(bool synchronized) { - assert (synchronized == false, "should be"); + assert(synchronized == false, "should be"); - return generate_entry(CppInterpreter::native_entry); + return generate_entry((address) CppInterpreter::native_entry); } address InterpreterGenerator::generate_normal_entry(bool synchronized) { - assert (synchronized == false, "should be"); + assert(synchronized == false, "should be"); - return generate_entry(CppInterpreter::normal_entry); + return generate_entry((address) CppInterpreter::normal_entry); } #if defined(PRODUCT) && defined(HOTSPOT_ASM) @@ -727,16 +727,15 @@ address AbstractInterpreterGenerator::generate_method_entry( AbstractInterpreter::MethodKind kind) { - address entry_point = NULL; #if defined(PRODUCT) && defined(HOTSPOT_ASM) if (!UseCompiler && !TaggedStackInterpreter && !JvmtiExport::can_post_interpreter_events() && !PrintCommandLineFlags) { - BCI_ENTRY asm_entry = asm_generate_method_entry(kind); + address asm_entry = (address) asm_generate_method_entry(kind); if (asm_entry) - return ((InterpreterGenerator*)this)->generate_entry(asm_entry); + return ((InterpreterGenerator*) this)->generate_entry(asm_entry); } #endif // HOTSPOT_ASM @@ -746,23 +745,23 @@ break; case Interpreter::native: - entry_point = ((InterpreterGenerator*)this)->generate_native_entry(false); + entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false); break; case Interpreter::native_synchronized: - entry_point = ((InterpreterGenerator*)this)->generate_native_entry(false); + entry_point = ((InterpreterGenerator*) this)->generate_native_entry(false); break; case Interpreter::empty: - entry_point = ((InterpreterGenerator*)this)->generate_empty_entry(); + entry_point = ((InterpreterGenerator*) this)->generate_empty_entry(); break; case Interpreter::accessor: - entry_point = ((InterpreterGenerator*)this)->generate_accessor_entry(); + entry_point = ((InterpreterGenerator*) this)->generate_accessor_entry(); break; case Interpreter::abstract: - entry_point = ((InterpreterGenerator*)this)->generate_abstract_entry(); + entry_point = ((InterpreterGenerator*) this)->generate_abstract_entry(); break; case Interpreter::java_lang_math_sin: @@ -772,7 +771,7 @@ case Interpreter::java_lang_math_log: case Interpreter::java_lang_math_log10: case Interpreter::java_lang_math_sqrt: - entry_point = ((InterpreterGenerator*)this)->generate_math_entry(kind); + entry_point = ((InterpreterGenerator*) this)->generate_math_entry(kind); break; default: @@ -780,7 +779,7 @@ } if (entry_point == NULL) - entry_point = ((InterpreterGenerator*)this)->generate_normal_entry(false); + entry_point = ((InterpreterGenerator*) this)->generate_normal_entry(false); return entry_point; } diff -r 903849a786da ports/hotspot/src/cpu/zero/vm/entry_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/entry_zero.hpp Fri Sep 04 05:43:23 2009 -0400 +++ b/ports/hotspot/src/cpu/zero/vm/entry_zero.hpp Fri Sep 04 07:13:01 2009 -0400 @@ -1,6 +1,6 @@ /* * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2008 Red Hat, Inc. + * Copyright 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,30 +29,32 @@ ShouldNotCallThis(); } - public: - typedef void (*method_entry_t)(methodOop method, intptr_t base_pc, TRAPS); - typedef void (*osr_entry_t)(methodOop method, - address osr_buf, - intptr_t base_pc, - TRAPS); - private: - method_entry_t _entry_point; + address _entry_point; public: - method_entry_t entry_point() const { + address entry_point() const { return _entry_point; } - void set_entry_point(method_entry_t entry_point) { + void set_entry_point(address entry_point) { _entry_point = entry_point; } + private: + typedef void (*NormalEntryFunc)(methodOop method, + intptr_t base_pc, + TRAPS); + typedef void (*OSREntryFunc)(methodOop method, + address osr_buf, + intptr_t base_pc, + TRAPS); + public: void invoke(methodOop method, TRAPS) const { - entry_point()(method, (intptr_t) this, THREAD); + ((NormalEntryFunc) entry_point())(method, (intptr_t) this, THREAD); } void invoke_osr(methodOop method, address osr_buf, TRAPS) const { - ((osr_entry_t) entry_point())(method, osr_buf, (intptr_t) this, THREAD); + ((OSREntryFunc) entry_point())(method, osr_buf, (intptr_t) this, THREAD); } public: diff -r 903849a786da ports/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp Fri Sep 04 05:43:23 2009 -0400 +++ b/ports/hotspot/src/cpu/zero/vm/nativeInst_zero.cpp Fri Sep 04 07:13:01 2009 -0400 @@ -42,7 +42,8 @@ assert(dest == SharedRuntime::get_handle_wrong_method_stub(), "should be"); #ifdef CC_INTERP - ((ZeroEntry*) verified_entry)->set_entry_point(CppInterpreter::normal_entry); + ((ZeroEntry*) verified_entry)->set_entry_point( + (address) CppInterpreter::normal_entry); #else Unimplemented(); #endif // CC_INTERP diff -r 903849a786da ports/hotspot/src/share/vm/shark/sharkCompiler.cpp --- a/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Fri Sep 04 05:43:23 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkCompiler.cpp Fri Sep 04 07:13:01 2009 -0400 @@ -169,8 +169,7 @@ memory_manager()->set_entry_for_function(function, entry); module()->getFunctionList().push_back(function); entry->set_entry_point( - (ZeroEntry::method_entry_t) - execution_engine()->getPointerToFunction(function)); + (address) execution_engine()->getPointerToFunction(function)); address code_start = entry->code_start(); address code_limit = entry->code_limit(); diff -r 903849a786da ports/hotspot/src/share/vm/shark/sharkEntry.hpp --- a/ports/hotspot/src/share/vm/shark/sharkEntry.hpp Fri Sep 04 05:43:23 2009 -0400 +++ b/ports/hotspot/src/share/vm/shark/sharkEntry.hpp Fri Sep 04 07:13:01 2009 -0400 @@ -31,7 +31,7 @@ public: address code_start() const { - return (address) entry_point(); + return entry_point(); } address code_limit() const { From gnu_andrew at member.fsf.org Fri Sep 4 06:53:24 2009 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Fri, 4 Sep 2009 14:53:24 +0100 Subject: Zero type changes In-Reply-To: <20090904112442.GB3312@redhat.com> References: <20090904112442.GB3312@redhat.com> Message-ID: <17c6771e0909040653p50eb6e28h50e8fc872062a25b@mail.gmail.com> 2009/9/4 Gary Benson : > Hi all, > > This commit changes the name of some types that didn't match the > usual HotSpot coding standards. > > Cheers, > Gary > > -- > http://gbenson.net/ > Is this for the new version of the submitted Zero patch? If so, I'll commit it to the IcedTea forest. -- Andrew :-) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From gbenson at redhat.com Fri Sep 4 07:08:47 2009 From: gbenson at redhat.com (Gary Benson) Date: Fri, 4 Sep 2009 15:08:47 +0100 Subject: Zero type changes In-Reply-To: <17c6771e0909040653p50eb6e28h50e8fc872062a25b@mail.gmail.com> References: <20090904112442.GB3312@redhat.com> <17c6771e0909040653p50eb6e28h50e8fc872062a25b@mail.gmail.com> Message-ID: <20090904140846.GC3312@redhat.com> Andrew John Hughes wrote: > 2009/9/4 Gary Benson : > > This commit changes the name of some types that didn't match the > > usual HotSpot coding standards. > > Is this for the new version of the submitted Zero patch? If so, I'll > commit it to the IcedTea forest. It might be easier to wait until I've created a new webrev, then back out the previous one and apply the new one. Up to you though :) Cheers, Gary -- http://gbenson.net/ From gnu_andrew at member.fsf.org Fri Sep 4 07:14:54 2009 From: gnu_andrew at member.fsf.org (Andrew John Hughes) Date: Fri, 4 Sep 2009 15:14:54 +0100 Subject: Zero type changes In-Reply-To: <20090904140846.GC3312@redhat.com> References: <20090904112442.GB3312@redhat.com> <17c6771e0909040653p50eb6e28h50e8fc872062a25b@mail.gmail.com> <20090904140846.GC3312@redhat.com> Message-ID: <17c6771e0909040714h328d2fb0t87dac8dd99efc909@mail.gmail.com> 2009/9/4 Gary Benson : > Andrew John Hughes wrote: >> 2009/9/4 Gary Benson : >> > This commit changes the name of some types that didn't match the >> > usual HotSpot coding standards. >> >> Is this for the new version of the submitted Zero patch? If so, I'll >> commit it to the IcedTea forest. > > It might be easier to wait until I've created a new webrev, then back > out the previous one and apply the new one. ?Up to you though :) > > Cheers, > Gary > > -- > http://gbenson.net/ > Yeah I may as well wait for the new webrev so I know what I'm getting :) Shouldn't be any need to back out the old one though, it should merge on top just fine. -- Andrew :-) Free Java Software Engineer Red Hat, Inc. (http://www.redhat.com) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8 From gbenson at redhat.com Wed Sep 9 02:00:56 2009 From: gbenson at redhat.com (Gary Benson) Date: Wed, 9 Sep 2009 10:00:56 +0100 Subject: Zero stack printer changes Message-ID: <20090909090056.GA3281@redhat.com> Hi all, This patch rearranges the stack printer code in Zero so that it slots in better with HotSpot's existing frame walker and therefore requires less modification to vmError.cpp as requested by Tom Rodriguez. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r 175266c8ad02 ChangeLog --- a/ChangeLog Tue Sep 08 11:47:14 2009 +0100 +++ b/ChangeLog Wed Sep 09 04:44:36 2009 -0400 @@ -1,3 +1,50 @@ +2009-09-09 Gary Benson + + * ports/hotspot/src/cpu/zero/vm/stack_zero.hpp + (ZeroFrame::identify_word): New method. + (ZeroFrame::identify_vp_word): Likewise. + + * ports/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp + (EntryFrame::identify_word): New method. + * ports/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp + (InterpreterFrame::identify_word): New method. + * ports/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp + (SharkFrame::identify_word): New method. + * ports/hotspot/src/cpu/zero/vm/deoptimizerFrame_zero.hpp + (DeoptimizerFrame::identify_word): Likewise. + + * ports/hotspot/src/cpu/zero/vm/frame_zero.hpp + (frame::frame): Added frame pointer argument. + (frame::_fp): New field. + (frame::fp): Return the above, instead of a dummy value. + (frame::zero_print_on_error): New method. + * ports/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp + (frame::frame): Initialize frame pointer. + * ports/hotspot/src/cpu/zero/vm/frame_zero.cpp + (frame::sender_for_entry_frame): Pass frame pointer. + (frame::sender_for_interpreter_frame): Likewise. + (frame::sender_for_compiled_frame): Likewise. + (frame::sender_for_deoptimizer_frame): Likewise. + (frame::zero_print_on_error): New method. + (ZeroFrame::identify_word): Likewise. + (EntryFrame::identify_word): Likewise. + (InterpreterFrame::identify_word): Likewise. + (SharkFrame::identify_word): Likewise. + (ZeroFrame::identify_vp_word): Likewise. + (DeoptimizerFrame::identify_word): Likewise. + + * ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp + (JavaThread::pd_last_frame): Pass frame pointer. + + * ports/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp + (os::current_frame): Implemented. + + * patches/icedtea-zero.patch + (VMError::report): Replace stack printer code. + (hotspot/src/share/vm/includeDB_core): Updated. + + * ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp: Removed. + 2009-09-08 Gary Benson * ports/hotspot/src/cpu/zero/vm/stack_zero.hpp: Whitespace changes. diff -r 175266c8ad02 patches/icedtea-zero.patch --- a/patches/icedtea-zero.patch Tue Sep 08 11:47:14 2009 +0100 +++ b/patches/icedtea-zero.patch Wed Sep 09 04:44:36 2009 -0400 @@ -144,43 +144,48 @@ --- openjdk/hotspot/src/share/vm/utilities/vmError.cpp.orig 2008-07-27 08:37:02.000000000 +0000 +++ openjdk/hotspot/src/share/vm/utilities/vmError.cpp 2008-07-27 08:38:13.000000000 +0000 -@@ -25,6 +25,10 @@ - # include "incls/_precompiled.incl" - # include "incls/_vmError.cpp.incl" - -+# ifdef ZERO -+# include -+# endif // ZERO -+ - // List of environment variables that should be reported in error log file. - const char *env_list[] = { - // All platforms -@@ -392,6 +397,7 @@ - st->cr(); - } - -+#ifndef ZERO - STEP(110, "(printing stack bounds)" ) - - if (_verbose) { -@@ -449,11 +455,16 @@ - st->cr(); - } - } -+#endif // !ZERO - - STEP(130, "(printing Java stack)" ) +@@ -462,6 +462,40 @@ if (_verbose && _thread && _thread->is_Java_thread()) { JavaThread* jt = (JavaThread*)_thread; +#ifdef ZERO -+ st->print_cr("Java stack:"); -+ ZeroStackPrinter(st, buf, sizeof(buf)).print(jt); ++ if (jt->zero_stack()->sp() && jt->top_zero_frame()) { ++ // StackFrameStream uses the frame anchor, which may not have ++ // been set up. This can be done at any time in Zero, however, ++ // so if it hasn't been set up then we just set it up now and ++ // clear it again when we're done. ++ bool has_last_Java_frame = jt->has_last_Java_frame(); ++ if (!has_last_Java_frame) ++ jt->set_last_Java_frame(); ++ st->print("Java frames:"); ++ ++ // If the top frame is a Shark frame and the frame anchor isn't ++ // set up then it's possible that the information in the frame ++ // is garbage: it could be from a previous decache, or it could ++ // simply have never been written. So we print a warning... ++ StackFrameStream sfs(jt); ++ if (!has_last_Java_frame && !sfs.is_done()) { ++ if (sfs.current()->zeroframe()->is_shark_frame()) { ++ st->print(" (TOP FRAME MAY BE JUNK)"); ++ } ++ } ++ st->cr(); ++ ++ // Print the frames ++ for(int i = 0; !sfs.is_done(); sfs.next(), i++) { ++ sfs.current()->zero_print_on_error(i, st, buf, sizeof(buf)); ++ st->cr(); ++ } ++ ++ // Reset the frame anchor if necessary ++ if (!has_last_Java_frame) ++ jt->reset_last_Java_frame(); ++ } +#else if (jt->has_last_Java_frame()) { st->print_cr("Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)"); for(StackFrameStream sfs(jt); !sfs.is_done(); sfs.next()) { -@@ -461,6 +472,7 @@ +@@ -469,6 +503,7 @@ st->cr(); } } @@ -188,21 +193,7 @@ } STEP(140, "(printing VM operation)" ) -@@ -472,6 +484,14 @@ void VMError::report(outputStream* st) { - op->print_on_error(st); - st->cr(); - st->cr(); -+#ifdef ZERO -+ if (op->calling_thread()->is_Java_thread()) { -+ st->print_cr("Calling thread's Java stack:"); -+ ZeroStackPrinter(st, buf, sizeof(buf)).print( -+ (JavaThread *) op->calling_thread()); -+ st->cr(); -+ } -+#endif // ZERO - } - } - + Index: openjdk/hotspot/src/share/vm/runtime/jniHandles.cpp =================================================================== --- openjdk/hotspot/src/share/vm/runtime/jniHandles.cpp.orig 2009-06-10 11:30:46.000000000 +0200 @@ -219,3 +210,20 @@ } +--- openjdk/hotspot/src/share/vm/includeDB_core 2009-09-08 13:22:25.000000000 +0100 ++++ openjdk/hotspot/src/share/vm/includeDB_core 2009-09-08 13:41:57.000000000 +0100 +@@ -1655,12 +1655,14 @@ + frame_.cpp frame.inline.hpp + frame_.cpp handles.inline.hpp + frame_.cpp interpreter.hpp ++frame_.cpp interpreterRuntime.hpp + frame_.cpp javaCalls.hpp + frame_.cpp markOop.hpp + frame_.cpp methodOop.hpp + frame_.cpp monitorChunk.hpp + frame_.cpp oop.inline.hpp + frame_.cpp resourceArea.hpp ++frame_.cpp scopeDesc.hpp + frame_.cpp signature.hpp + frame_.cpp stubCodeGenerator.hpp + frame_.cpp stubRoutines.hpp diff -r 175266c8ad02 ports/hotspot/src/cpu/zero/vm/deoptimizerFrame_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/deoptimizerFrame_zero.hpp Tue Sep 08 11:47:14 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/deoptimizerFrame_zero.hpp Wed Sep 09 04:44:36 2009 -0400 @@ -45,4 +45,11 @@ public: static DeoptimizerFrame *build(ZeroStack* stack); + + public: + void identify_word(int frame_index, + int offset, + char* fieldbuf, + char* valuebuf, + int buflen) const; }; diff -r 175266c8ad02 ports/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp Tue Sep 08 11:47:14 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/entryFrame_zero.hpp Wed Sep 09 04:44:36 2009 -0400 @@ -57,4 +57,11 @@ JavaCallWrapper *call_wrapper() const { return (JavaCallWrapper *) value_of_word(call_wrapper_off); } + + public: + void identify_word(int frame_index, + int offset, + char* fieldbuf, + char* valuebuf, + int buflen) const; }; diff -r 175266c8ad02 ports/hotspot/src/cpu/zero/vm/frame_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/frame_zero.cpp Tue Sep 08 11:47:14 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/frame_zero.cpp Wed Sep 09 04:44:36 2009 -0400 @@ -1,6 +1,6 @@ /* * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007, 2008 Red Hat, Inc. + * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,19 +47,19 @@ "sender should be next Java frame"); map->clear(); assert(map->include_argument_oops(), "should be set by clear"); - return frame(sender_sp()); + return frame(sender_sp(), sp() + 1); } frame frame::sender_for_interpreter_frame(RegisterMap *map) const { - return frame(sender_sp()); + return frame(sender_sp(), sp() + 1); } frame frame::sender_for_compiled_frame(RegisterMap *map) const { - return frame(sender_sp()); + return frame(sender_sp(), sp() + 1); } frame frame::sender_for_deoptimizer_frame(RegisterMap *map) const { - return frame(sender_sp()); + return frame(sender_sp(), sp() + 1); } frame frame::sender(RegisterMap* map) const { @@ -180,3 +180,243 @@ int index = (Interpreter::expr_offset_in_bytes(offset) / wordSize); return &interpreter_frame_tos_address()[index]; } + +void frame::zero_print_on_error(int frame_index, + outputStream* st, + char* buf, + int buflen) const { + // Divide the buffer between the field and the value + buflen >>= 1; + char *fieldbuf = buf; + char *valuebuf = buf + buflen; + + // Print each word of the frame + for (intptr_t *addr = fp(); addr <= sp(); addr++) { + int offset = sp() - addr; + + // Fill in default values, then try and improve them + snprintf(fieldbuf, buflen, "word[%d]", offset); + snprintf(valuebuf, buflen, PTR_FORMAT, *addr); + zeroframe()->identify_word(frame_index, offset, fieldbuf, valuebuf, buflen); + fieldbuf[buflen - 1] = '\0'; + valuebuf[buflen - 1] = '\0'; + + // Print the result + st->print_cr(" " PTR_FORMAT ": %-21s = %s", addr, fieldbuf, valuebuf); + } +} + +void ZeroFrame::identify_word(int frame_index, + int offset, + char* fieldbuf, + char* valuebuf, + int buflen) const { + switch (offset) { + case next_frame_off: + strncpy(fieldbuf, "next_frame", buflen); + break; + + case frame_type_off: + strncpy(fieldbuf, "frame_type", buflen); + if (is_entry_frame()) + strncpy(valuebuf, "ENTRY_FRAME", buflen); + else if (is_interpreter_frame()) + strncpy(valuebuf, "INTERPRETER_FRAME", buflen); + else if (is_shark_frame()) + strncpy(valuebuf, "SHARK_FRAME", buflen); + else if (is_deoptimizer_frame()) + strncpy(valuebuf, "DEOPTIMIZER_FRAME", buflen); + break; + + default: + if (is_entry_frame()) { + as_entry_frame()->identify_word( + frame_index, offset, fieldbuf, valuebuf, buflen); + } + else if (is_interpreter_frame()) { + as_interpreter_frame()->identify_word( + frame_index, offset, fieldbuf, valuebuf, buflen); + } + else if (is_shark_frame()) { + as_shark_frame()->identify_word( + frame_index, offset, fieldbuf, valuebuf, buflen); + } + else if (is_deoptimizer_frame()) { + as_deoptimizer_frame()->identify_word( + frame_index, offset, fieldbuf, valuebuf, buflen); + } + } +} + +void EntryFrame::identify_word(int frame_index, + int offset, + char* fieldbuf, + char* valuebuf, + int buflen) const { + switch (offset) { + case call_wrapper_off: + strncpy(fieldbuf, "call_wrapper", buflen); + break; + + default: + snprintf(fieldbuf, buflen, "local[%d]", offset - 3); + } +} + +void InterpreterFrame::identify_word(int frame_index, + int offset, + char* fieldbuf, + char* valuebuf, + int buflen) const { + interpreterState istate = interpreter_state(); + bool is_valid = istate->self_link() == istate; + intptr_t *addr = addr_of_word(offset); + + // Fixed part + if (addr >= (intptr_t *) istate) { + const char *field = istate->name_of_field_at_address((address) addr); + if (field) { + if (is_valid && !strcmp(field, "_method")) { + istate->method()->name_and_sig_as_C_string(valuebuf, buflen); + } + else if (is_valid && !strcmp(field, "_bcp") && istate->bcp()) { + snprintf(valuebuf, buflen, PTR_FORMAT " (bci %d)", + istate->bcp(), istate->method()->bci_from(istate->bcp())); + } + snprintf(fieldbuf, buflen, "%sistate->%s", + field[strlen(field) - 1] == ')' ? "(": "", field); + } + else if (addr == (intptr_t *) istate) { + strncpy(fieldbuf, "(vtable for istate)", buflen); + } + return; + } + + // Variable part + if (!is_valid) + return; + + // JNI stuff + if (istate->method()->is_native() && addr < istate->stack_base()) { + address hA = istate->method()->signature_handler(); + if (hA != NULL) { + if (hA != (address) InterpreterRuntime::slow_signature_handler) { + InterpreterRuntime::SignatureHandler *handler = + InterpreterRuntime::SignatureHandler::from_handlerAddr(hA); + + intptr_t *params = istate->stack_base() - handler->argument_count(); + if (addr >= params) { + int param = addr - params; + const char *desc = ""; + if (param == 0) + desc = " (JNIEnv)"; + else if (param == 1) { + if (istate->method()->is_static()) + desc = " (mirror)"; + else + desc = " (this)"; + } + snprintf(fieldbuf, buflen, "parameter[%d]%s", param, desc); + return; + } + + for (int i = 0; i < handler->argument_count(); i++) { + if (params[i] == (intptr_t) addr) { + snprintf(fieldbuf, buflen, "unboxed parameter[%d]", i); + return; + } + } + } + } + return; + } + + // Monitors and stack + identify_vp_word(frame_index, addr, + (intptr_t *) istate->monitor_base(), + istate->stack_base(), + fieldbuf, buflen); +} + +void SharkFrame::identify_word(int frame_index, + int offset, + char* fieldbuf, + char* valuebuf, + int buflen) const { + // Fixed part + switch (offset) { + case pc_off: + strncpy(fieldbuf, "pc", buflen); + if (method()->is_oop()) { + nmethod *code = method()->code(); + if (code && code->pc_desc_at(pc())) { + SimpleScopeDesc ssd(code, pc()); + snprintf(valuebuf, buflen, PTR_FORMAT " (bci %d)", pc(), ssd.bci()); + } + } + return; + + case unextended_sp_off: + strncpy(fieldbuf, "unextended_sp", buflen); + return; + + case method_off: + strncpy(fieldbuf, "method", buflen); + if (method()->is_oop()) { + method()->name_and_sig_as_C_string(valuebuf, buflen); + } + return; + + case oop_tmp_off: + strncpy(fieldbuf, "oop_tmp", buflen); + return; + } + + // Variable part + if (method()->is_oop()) { + identify_vp_word(frame_index, addr_of_word(offset), + addr_of_word(header_words + 1), + unextended_sp() + method()->max_stack(), + fieldbuf, buflen); + } +} + +void ZeroFrame::identify_vp_word(int frame_index, + intptr_t* addr, + intptr_t* monitor_base, + intptr_t* stack_base, + char* fieldbuf, + int buflen) const { + // Monitors + if (addr >= stack_base && addr < monitor_base) { + int monitor_size = frame::interpreter_frame_monitor_size(); + int last_index = (monitor_base - stack_base) / monitor_size - 1; + int index = last_index - (addr - stack_base) / monitor_size; + intptr_t monitor = (intptr_t) ( + (BasicObjectLock *) monitor_base - 1 - index); + intptr_t offset = (intptr_t) addr - monitor; + + if (offset == BasicObjectLock::obj_offset_in_bytes()) + snprintf(fieldbuf, buflen, "monitor[%d]->_obj", index); + else if (offset == BasicObjectLock::lock_offset_in_bytes()) + snprintf(fieldbuf, buflen, "monitor[%d]->_lock", index); + + return; + } + + // Expression stack + if (addr < stack_base) { + snprintf(fieldbuf, buflen, "%s[%d]", + frame_index == 0 ? "stack_word" : "local", + (int) (stack_base - addr - 1)); + return; + } +} + +void DeoptimizerFrame::identify_word(int frame_index, + int offset, + char* fieldbuf, + char* valuebuf, + int buflen) const { + // Deoptimizer frames have no extra words to identify +} diff -r 175266c8ad02 ports/hotspot/src/cpu/zero/vm/frame_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/frame_zero.hpp Tue Sep 08 11:47:14 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/frame_zero.hpp Wed Sep 09 04:44:36 2009 -0400 @@ -23,24 +23,26 @@ * */ -// A frame represents a physical stack frame (an activation). Frames -// can be C or Java frames, and the Java frames can be interpreted or -// compiled. In contrast, vframes represent source-level activations, -// so that one physical frame can correspond to multiple source level -// frames because of inlining. A frame is comprised of {pc, sp} +// A frame represents a physical stack frame on the Zero stack. public: enum { pc_return_offset = 0 }; + // Constructor public: - // Constructors - frame(intptr_t* sp); + frame(intptr_t* sp, intptr_t* fp); - // accessors for the instance variables + // The sp of a Zero frame is the address of the highest word in + // that frame. We keep track of the lowest address too, so the + // boundaries of the frame are available for debug printing. + private: + intptr_t* _fp; + + public: intptr_t* fp() const { - return (intptr_t *) -1; + return _fp; } #ifdef CC_INTERP @@ -67,3 +69,9 @@ public: frame sender_for_deoptimizer_frame(RegisterMap* map) const; + + public: + void zero_print_on_error(int index, + outputStream* st, + char* buf, + int buflen) const; diff -r 175266c8ad02 ports/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp --- a/ports/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp Tue Sep 08 11:47:14 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp Wed Sep 09 04:44:36 2009 -0400 @@ -1,6 +1,6 @@ /* * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2007, 2008 Red Hat, Inc. + * Copyright 2007, 2008, 2009 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,13 +32,15 @@ inline frame::frame() { _sp = NULL; + _fp = NULL; _pc = NULL; _cb = NULL; _deopt_state = unknown; } -inline frame::frame(intptr_t* sp) { +inline frame::frame(intptr_t* sp, intptr_t* fp) { _sp = sp; + _fp = fp; switch (zeroframe()->type()) { case ZeroFrame::ENTRY_FRAME: _pc = StubRoutines::call_stub_return_pc(); diff -r 175266c8ad02 ports/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp Tue Sep 08 11:47:14 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/interpreterFrame_zero.hpp Wed Sep 09 04:44:36 2009 -0400 @@ -65,5 +65,12 @@ interpreterState interpreter_state() const { return (interpreterState) addr_of_word(istate_off); } + + public: + void identify_word(int frame_index, + int offset, + char* fieldbuf, + char* valuebuf, + int buflen) const; }; #endif // CC_INTERP diff -r 175266c8ad02 ports/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp Tue Sep 08 11:47:14 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/sharkFrame_zero.hpp Wed Sep 09 04:44:36 2009 -0400 @@ -70,4 +70,11 @@ methodOop method() const { return (methodOop) value_of_word(method_off); } + + public: + void identify_word(int frame_index, + int offset, + char* fieldbuf, + char* valuebuf, + int buflen) const; }; diff -r 175266c8ad02 ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/stackPrinter_zero.hpp Tue Sep 08 11:47:14 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,291 +0,0 @@ -/* - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. - * Copyright 2008, 2009 Red Hat, Inc. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - */ - -#include -#include - -class ZeroStackPrinter { - private: - outputStream* _st; - char* _buf; - int _buflen; - - public: - ZeroStackPrinter(outputStream *st, char *buf, int buflen) - : _st(st), _buf(buf), _buflen(buflen) {} - - void print(JavaThread *thread) { - intptr_t *lo_addr = thread->zero_stack()->sp(); - if (!lo_addr) { - _st->print_cr(" stack not set up"); - return; - } - - intptr_t *hi_addr = (intptr_t *) thread->top_zero_frame(); - if (!hi_addr) { - _st->print_cr("no frames pushed"); - return; - } - assert(hi_addr >= lo_addr, "corrupted stack"); - - bool top_frame = true; - while (hi_addr) { - if (!top_frame) - _st->cr(); - ZeroFrame *frame = (ZeroFrame *) hi_addr; - for (intptr_t *addr = lo_addr; addr <= hi_addr; addr++) - print_word(frame, addr, top_frame); - lo_addr = hi_addr + 1; - hi_addr = *(intptr_t **) hi_addr; - top_frame = false; - } - } - - private: - void print_word(ZeroFrame *frame, intptr_t *addr, bool top_frame) { - const char *field = NULL; - const char *value = NULL; - - int word = (intptr_t *) frame - addr; - switch (word) { - case ZeroFrame::next_frame_off: - field = "next_frame"; - break; - case ZeroFrame::frame_type_off: - field = "frame_type"; - switch (*addr) { - case ZeroFrame::ENTRY_FRAME: - value = "ENTRY_FRAME"; - break; - case ZeroFrame::INTERPRETER_FRAME: - value = "INTERPRETER_FRAME"; - break; - case ZeroFrame::SHARK_FRAME: - value = "SHARK_FRAME"; - break; - case ZeroFrame::DEOPTIMIZER_FRAME: - value = "DEOPTIMIZER_FRAME"; - break; - } - break; - } - - if (!field) { - if (frame->is_entry_frame()) { - if (word == EntryFrame::call_wrapper_off) { - field = "call_wrapper"; - } - else { - snprintf(_buf, _buflen, "local[%d]", word - 3); - field = _buf; - } - } - if (frame->is_interpreter_frame()) { - interpreterState istate = - ((InterpreterFrame *) frame)->interpreter_state(); - bool is_valid = istate->self_link() == istate; - - if (addr >= (intptr_t *) istate) { - field = istate->name_of_field_at_address((address) addr); - if (field) { - if (is_valid && !strcmp(field, "_method")) { - value = istate->method()->name_and_sig_as_C_string(_buf,_buflen); - field = "istate->_method"; - } - else if (is_valid && !strcmp(field, "_bcp") && istate->bcp()) { - snprintf(_buf, _buflen, PTR_FORMAT " (bci %d)", istate->bcp(), - istate->method()->bci_from(istate->bcp())); - value = _buf; - field = "istate->_bcp"; - } - else { - snprintf(_buf, _buflen, "%sistate->%s", - field[strlen(field) - 1] == ')' ? "(": "", field); - field = _buf; - } - } - else if (addr == (intptr_t *) istate) { - field = "(vtable for istate)"; - } - } - else if (is_valid) { - intptr_t *monitor_base = (intptr_t *) istate->monitor_base(); - if (addr >= istate->stack_base() && addr < monitor_base) { - int monitor_size = frame::interpreter_frame_monitor_size(); - int last_index = - (monitor_base - istate->stack_base()) / monitor_size - 1; - int index = - last_index - (addr - istate->stack_base()) / monitor_size; - intptr_t monitor = (intptr_t) (istate->monitor_base() - 1 - index); - intptr_t offset = (intptr_t) addr - monitor; - - if (offset == BasicObjectLock::obj_offset_in_bytes()) { - snprintf(_buf, _buflen, "monitor[%d]->_obj", index); - field = _buf; - } - else if (offset == BasicObjectLock::lock_offset_in_bytes()) { - snprintf(_buf, _buflen, "monitor[%d]->_lock", index); - field = _buf; - } - } - else if (addr < istate->stack_base()) { - if (istate->method()->is_native()) { - address hA = istate->method()->signature_handler(); - if (hA != NULL) { - if (hA != (address)InterpreterRuntime::slow_signature_handler){ - InterpreterRuntime::SignatureHandler *handler = - InterpreterRuntime::SignatureHandler::from_handlerAddr(hA); - - intptr_t *params = - istate->stack_base() - handler->argument_count(); - - if (addr >= params) { - int param = addr - params; - const char *desc = ""; - if (param == 0) - desc = " (JNIEnv)"; - else if (param == 1) { - if (istate->method()->is_static()) - desc = " (mirror)"; - else - desc = " (this)"; - } - snprintf(_buf, _buflen, "parameter[%d]%s", param, desc); - field = _buf; - } - else { - for (int i = 0; i < handler->argument_count(); i++) { - if (params[i] == (intptr_t) addr) { - snprintf(_buf, _buflen, "unboxed parameter[%d]", i); - field = _buf; - break; - } - } - } - } - } - } - else { - snprintf(_buf, _buflen, "%s[" INTPTR_FORMAT "]", - top_frame ? "stack_word" : "local", - istate->stack_base() - addr - 1); - field = _buf; - } - } - } - } - if (frame->is_shark_frame()) { - SharkFrame *sf = frame->as_shark_frame(); - methodOop method = sf->method(); - - if (word == SharkFrame::pc_off) { - field = "pc"; - if (method->is_oop()) { - nmethod *code = method->code(); - address pc = sf->pc(); - if (code->pc_desc_at(pc)) { - SimpleScopeDesc ssd(code, pc); - snprintf(_buf, _buflen, PTR_FORMAT " (bci %d)", pc, ssd.bci()); - value = _buf; - } - } - } - else if (word == SharkFrame::unextended_sp_off) { - field = "unextended_sp"; - } - else if (word == SharkFrame::method_off) { - field = "method"; - if (method->is_oop()) - value = method->name_and_sig_as_C_string(_buf, _buflen); - } - else if (word == SharkFrame::oop_tmp_off) { - field = "oop_tmp"; - } - else { - SharkFrame *sf = (SharkFrame *) frame; - intptr_t *monitor_base = - (intptr_t *) frame - SharkFrame::header_words + 1; - intptr_t *stack_base = - sf->unextended_sp() + sf->method()->max_stack(); - - if (addr >= stack_base && addr < monitor_base) { - int monitor_size = frame::interpreter_frame_monitor_size(); - int last_index = (monitor_base - stack_base) / monitor_size - 1; - int index = last_index - (addr - stack_base) / monitor_size; - intptr_t monitor = - (intptr_t) ((BasicObjectLock *) monitor_base - 1 - index); - intptr_t offset = (intptr_t) addr - monitor; - - if (offset == BasicObjectLock::obj_offset_in_bytes()) { - snprintf(_buf, _buflen, "monitor[%d]->_obj", index); - field = _buf; - } - else if (offset == BasicObjectLock::lock_offset_in_bytes()) { - snprintf(_buf, _buflen, "monitor[%d]->_lock", index); - field = _buf; - } - } - else { - snprintf(_buf, _buflen, "%s[" INTPTR_FORMAT "]", - top_frame ? "stack_word" : "local", - stack_base - addr - 1); - field = _buf; - } - } - } - } - - if (!field) { - snprintf(_buf, _buflen, "word[%d]", word); - field = _buf; - } - _st->print(" %p: %-21s = ", addr, field); - if (value) - _st->print_cr("%s", value); - else - _st->print_cr(PTR_FORMAT, *addr); - } -}; - -#ifndef PRODUCT -extern "C" { - void print_zero_threads() { - char buf[O_BUFLEN]; - ZeroStackPrinter zsp(tty, buf, sizeof(buf)); - - for (JavaThread *t = Threads::first(); t; t = t->next()) { - tty->print(PTR_FORMAT, t); - tty->print(" "); - t->print_on_error(tty, buf, sizeof(buf)); - tty->cr(); - tty->cr(); - - zsp.print(t); - if (t->next()) - tty->cr(); - } - } -} -#endif // !PRODUCT diff -r 175266c8ad02 ports/hotspot/src/cpu/zero/vm/stack_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/stack_zero.hpp Tue Sep 08 11:47:14 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/stack_zero.hpp Wed Sep 09 04:44:36 2009 -0400 @@ -179,4 +179,19 @@ assert(is_deoptimizer_frame(), "should be"); return (DeoptimizerFrame *) this; } + + public: + void identify_word(int frame_index, + int offset, + char* fieldbuf, + char* valuebuf, + int buflen) const; + + protected: + void identify_vp_word(int frame_index, + intptr_t* addr, + intptr_t* monitor_base, + intptr_t* stack_base, + char* fieldbuf, + int buflen) const; }; diff -r 175266c8ad02 ports/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp --- a/ports/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Tue Sep 08 11:47:14 2009 +0100 +++ b/ports/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp Wed Sep 09 04:44:36 2009 -0400 @@ -36,7 +36,18 @@ } frame os::current_frame() { - Unimplemented(); + // The only thing that calls this is the stack printing code in + // VMError::report: + // - Step 110 (printing stack bounds) uses the sp in the frame + // to determine the amount of free space on the stack. We + // set the sp to a close approximation of the real value in + // order to allow this step to complete. + // - Step 120 (printing native stack) tries to walk the stack. + // The frame we create has a NULL pc, which is ignored as an + // invalid frame. + frame dummy = frame(); + dummy.set_sp((intptr_t *) current_stack_pointer()); + return dummy; } char* os::non_memory_address_word() { diff -r 175266c8ad02 ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp --- a/ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp Tue Sep 08 11:47:14 2009 +0100 +++ b/ports/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp Wed Sep 09 04:44:36 2009 -0400 @@ -79,7 +79,7 @@ private: frame pd_last_frame() { assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); - return frame(last_Java_sp()); + return frame(last_Java_sp(), zero_stack()->sp()); } public: From gbenson at redhat.com Tue Sep 15 03:15:14 2009 From: gbenson at redhat.com (Gary Benson) Date: Tue, 15 Sep 2009 11:15:14 +0100 Subject: Zero fixes Message-ID: <20090915101514.GA3467@redhat.com> Hi all, This patch unreverts a couple of things that Ed reverted in his commits of the past few days. Cheers, Gary -- http://gbenson.net/ -------------- next part -------------- diff -r f07666c3167a ChangeLog --- a/ChangeLog Tue Sep 15 09:48:53 2009 +0100 +++ b/ChangeLog Tue Sep 15 06:00:28 2009 -0400 @@ -1,3 +1,12 @@ +2009-09-15 Gary Benson + + * ports/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp: + Reinstated copyright header and #endif comment. + + * ports/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp: + Removed reinstated comment, moved opening brace back to + previous line, and reinstated #endif comment. + 2009-09-15 Edward Nevill * asm_helper.cpp: Missed from previous checkin diff -r f07666c3167a ports/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp --- a/ports/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp Tue Sep 15 09:48:53 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp Tue Sep 15 06:00:29 2009 -0400 @@ -26,9 +26,7 @@ #include "incls/_precompiled.incl" #include "incls/_bytecodes_zero.cpp.incl" -void Bytecodes::pd_initialize() -{ - // No zero specific initialization +void Bytecodes::pd_initialize() { #ifdef HOTSPOT_ASM def(_iaccess_0, "_iaccess_0", "b_jj", NULL, T_INT, 1, true, _aload_0); def(_iaccess_1, "_iaccess_1", "b_jj", NULL, T_INT, 1, true, _aload_1); @@ -72,5 +70,5 @@ def(_iload_2_iload_N, "iload_2_iload_N", "b_", NULL, T_INT, 2, false, _iload_2); def(_iload_3_iload_N, "iload_3_iload_N", "b_", NULL, T_INT, 2, false, _iload_3); -#endif +#endif // HOTSPOT_ASM } diff -r f07666c3167a ports/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp --- a/ports/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp Tue Sep 15 09:48:53 2009 +0100 +++ b/ports/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp Tue Sep 15 06:00:29 2009 -0400 @@ -1,3 +1,28 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2009 Red Hat, Inc. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + * + */ + #ifdef HOTSPOT_ASM #define _iaccess_0 ((Bytecodes::Code)0xdb) #define _iaccess_1 ((Bytecodes::Code)0xdc) @@ -36,4 +61,4 @@ _iload_1_iload_N , // 251 _iload_2_iload_N , // 252 _iload_3_iload_N , // 253 -#endif +#endif // HOTSPOT_ASM From enevill at arm.com Wed Sep 16 05:56:52 2009 From: enevill at arm.com (Edward Nevill) Date: Wed, 16 Sep 2009 13:56:52 +0100 Subject: Help! Running JCK, Harness and Agent modes Message-ID: <001c01ca36cd$29b258b0$7d170a10$@com> Hi all, Hope this is the right group and hope you can help. I am trying to run the JCK on the ARM Zero port of OpenJDK. Because of the tight memory constraints and the speed of the ARM board I am using for this I am trying to run the test harness on an X86 box and the test agent on the ARM board. I can successfully run the sample tests when I do not use a separate harness and agent. The problem is that all the tests fail with exit code 2. In the -trace output from the agent I see that it is correctly getting exit code 0. IE the log says RETURN Passed. Exit code 0 SEND STATUS But in the test harness it says Unexpected exit code: exit code 2. I have tried swapping the 2 around, ie running the harness on the ARM board and the agent on the X86 and this works successfully. Here is the command I am using to start the agent. /java/enevill/hg/b16_karmic_gcc4.4_jtreg/j2sdk-image/bin/java -cp 6b/sampleJCK-compiler-6b/lib/javatest.jar com.sun.javatest.AgentFrame -passive -trace -start Attached is the output of the trace and the configuration file (.jti). Thx in advance for your help, Ed. Note: X-Posted to zero-dev at openjdk.java.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/zero-dev/attachments/20090916/9cecdf74/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: jck_log Type: application/octet-stream Size: 6303 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/zero-dev/attachments/20090916/9cecdf74/attachment.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: sample.jti Type: application/octet-stream Size: 3661 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/zero-dev/attachments/20090916/9cecdf74/attachment-0001.obj From xerxes at zafena.se Thu Sep 17 04:51:01 2009 From: xerxes at zafena.se (=?ISO-8859-1?Q?Xerxes_R=E5nby?=) Date: Thu, 17 Sep 2009 13:51:01 +0200 Subject: FYI: Shark debug LLVM 2.6 API fix and Shark debugging tips. Message-ID: <4AB222A5.8080800@zafena.se> The attached and committed patch fixed the following Shark compile error during debug builds when using LLVM 2.6 or later. /home/xerxes/icedtea6-1.6/openjdk-ecj/hotspot/src/share/vm/shark/sharkBuilder.cpp: In member function 'llvm::CallInst* SharkBuilder::CreateDump(llvm::Value*)': /home/xerxes/icedtea6-1.6/openjdk-ecj/hotspot/src/share/vm/shark/sharkBuilder.cpp:518: error: 'class llvm::StringRef' has no member named 'c_str' make[7]: *** [sharkBuilder.o] Error 1 If you want to create a Shark debug build then apply the mixtec-hacks.patch found in http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2009-April/005361.html it enables some more shark specific debug options like: -XX:+SharkTraceInstalls that will print when compiled methods are inserted into the jvm -XX:SharkPrintBitcodeOf=methodName displays the llvm ir for the method -XX:SharkPrintAsmOf=methodName displays the generated asm for the compiled method ... and makes shark generally more debugger friendly. Cheers Xerxes -------------- next part -------------- A non-text attachment was scrubbed... Name: 081f65658c7e.patch Type: text/x-patch Size: 1338 bytes Desc: not available Url : http://mail.openjdk.java.net/pipermail/zero-dev/attachments/20090917/5737c6fc/attachment.bin