Mercurial > hg > openjdk > icedtea > jdk7 > hotspot
changeset 3586:270a40a57b3d hs23.2-b08
Merge
author | amurillo |
---|---|
date | Fri, 29 Jun 2012 15:43:13 -0700 |
parents | c4dedc59d44d (diff) 981f551d0f91 (current diff) |
children | 7a37cec9d0d4 |
files | make/hotspot_version |
diffstat | 13 files changed, 357 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Fri Jun 29 14:28:10 2012 -0700 +++ b/.hgtags Fri Jun 29 15:43:13 2012 -0700 @@ -174,6 +174,15 @@ 9ad1548c6b63d596c411afc35147ffd5254426d9 hs21-b12 c149193c768b8b7233da4c3a3fdc0756b975848e hs21-b13 c149193c768b8b7233da4c3a3fdc0756b975848e jdk7-b143 +fe189d4a44e9e8f0c7d78fcbd1c63701745752ca jdk7-b144 +62f39d40ebf176306a916812729df586f9d10f43 hs21-b14 +82a81d5c5700a69333e12532bf0c4d33e885c7fc jdk7-b145 +82a81d5c5700a69333e12532bf0c4d33e885c7fc hs21-b15 +38fa55e5e79232d48f1bb8cf27d88bc094c9375a jdk7-b146 +38fa55e5e79232d48f1bb8cf27d88bc094c9375a hs21-b16 +81d815b05abb564aa1f4100ae13491c949b9a07e jdk7-b147 +81d815b05abb564aa1f4100ae13491c949b9a07e hs21-b17 +9b0ca45cd756d538c4c30afab280a91868eee1a5 jdk7u2-b01 0cc8a70952c368e06de2adab1f2649a408f5e577 jdk8-b01 31e253c1da429124bb87570ab095d9bc89850d0a jdk8-b02 3a2fb61165dfc72e398179a2796d740c8da5b8c0 jdk8-b03 @@ -185,14 +194,34 @@ 7c29742c41b44fb0cd5a13c7ac8834f3f2ca649e hs22-b02 3a2fb61165dfc72e398179a2796d740c8da5b8c0 hs22-b03 ce9bde819dcba4a5d2822229d9183e69c74326ca hs22-b04 +8580b4f22e294cc1392a472e3ee263bca74751ce jdk7u2-b04 +2c820a7d4f304ebb6d310187eae20c15d6ced3b0 jdk7u2-b05 +43252bd4c09d30254de3b35148e5ea05e15f2cfb jdk7u2-b06 +8bab8fb7adb060d2dfcf4bb6b19281905fc0edb3 jdk7u2-b07 513a84dd0f8b56dc0836b4e0bdd5dd0a778fc634 hs22-b05 650d15d8f37255d3b805aa00c5bd1c30984b203d hs22-b06 +8035e71ac3f6c8a453f7e9483e7144731388b14e jdk7u2-b08 +cd3d4ec354fd040c1f47614991b3fe6d5cc5e9da hs22-b07 +b93bc193d73bd4d07150a3e8f85a8ca4bb18157c jdk7u2-b09 +623aec2a90f721fd0de9877bf7be8624874fd557 hs22-b08 +482e282037d780ca48a0eaaa4015b8ae20f0e0a9 jdk7u2-b11 +c8abdaa56b471195aefbac6ee385d7d35b8aec74 hs22-b09 +4061b13e3e6be63b6f157ef773f374f2355fdb48 jdk7u2-b12 +3ba0bb2e7c8ddac172f5b995aae57329cdd2dafa hs22-b10 +f17fe2f4b6aacc19cbb8ee39476f2f13a1c4d3cd jdk7u2-b13 +0744602f85c6fe62255326df595785eb2b32166d jdk7u2-b21 +a40d238623e5b1ab1224ea6b36dc5b23d0a53880 jdk7u3-b02 +6986bfb4c82e00b938c140f2202133350e6e73f8 jdk7u3-b03 +8e6375b46717d74d4885f839b4e72d03f357a45f jdk7u3-b04 +366e6ba09c99d8ec26c6d4b71e079189674a58fe jdk7u3-b20 +4c62237db349e5e151ca60a743b323ef63305947 jdk7u3-b05 da883b9e6d3788057f9577e72712998ed82c9b7e hs23-b01 49ed7eacfd16616166ff066493143889741097af jdk8-b08 7c20d272643f47195478708eff593a9cce40fec4 jdk8-b09 e4f412d2b75d2c797acff965aa2c420e3d358f09 hs23-b02 d815de2e85e511b7deab2a83cf80c0224d011da9 jdk8-b10 4d3850d9d326ac3a9bee2d867727e954322d014e hs23-b03 +7e508fbcb95078cc7513e2af93463c0e2616eea4 jdk7u4-b01 4538caeef7b6cbd4302bebced805d65e68ccf301 jdk8-b11 6534482ff68ad79066dfe15dfb6d8905f09681bd hs23-b04 1d3900713a67a0a39faf4e12c9c158d55aebef87 jdk8-b12 @@ -200,39 +229,83 @@ b92ca8e229d29004f840c67e620833d23a346761 jdk8-b13 088d09a130ff02d8f5f05e92256baabe412f0439 jdk8-b14 6c2a55d4902f202e1c2de1df17b7da083a2c31e8 hs23-b06 +35aadd2e739b7231dd4c2a26d9fc24b286afc576 jdk7u4-b03 +278a1c1706f0e83c1c3401cde5bf4cf814adbc9d jdk7u4-b04 +35aadd2e739b7231dd4c2a26d9fc24b286afc576 jdk7u4-b02 fde2a39ed7f39233b287fbc278f437aac06c275b jdk8-b15 d1f29d4e0bc60e8bd7ae961f1306d8ab33290212 jdk8-b17 d1f29d4e0bc60e8bd7ae961f1306d8ab33290212 jdk8-b16 6de8c9ba5907e4c5ca05ac4b8d84a8e2cbd92399 hs23-b07 a2fef924d8e6f37dac2a887315e3502876cc8e24 hs23-b08 +1647361df7ba31c6fa8e838d5061b9930673e26c jdk7u4-b05 61165f53f1656b9f99e4fb806429bf98b99d59c3 jdk8-b18 4bcf61041217f8677dcec18e90e9196acc945bba hs23-b09 +b09b616c066f4837dea9dcf1eb0edb85640e03a3 jdk7u4-b06 9232e0ecbc2cec54dcc8f93004fb00c214446460 jdk8-b19 fe2c8764998112b7fefcd7d41599714813ae4327 jdk8-b20 9952d1c439d64c5fd4ad1236a63a62bd5a49d4c3 jdk8-b21 513351373923f74a7c91755748b95c9771e59f96 hs23-b10 +3804879a5ea02b8dfe24faf5a4c2d70acbcdb95b jdk7u4-b07 +899ddc704d9faed9733dd43fd81c87fa6a4362cf jdk7u4-b08 24727fb37561779077fdfa5a33342246f20e5c0f jdk8-b22 dcc292399a39113957eebbd3e487b7e05e2c79fc hs23-b11 +c5695e7d2e4fcd11f176533ae04a78896d538e96 jdk7u4-b09 e850d8e7ea54b91c7aa656e297f0f9f38dd4c296 jdk8-b23 9e177d44b10fe92ecffa965fef9c5ac5433c1b46 hs23-b12 +305636960fa422e05784179b887b44814c4fb9fe jdk7u4-b10 a80fd4f45d7aaa154ed2f86a129f3c9c4035ec7a jdk8-b24 b22de824749922986ce4d442bed029916b832807 hs23-b13 64b46f975ab82948c1e021e17775ff4fab8bc40e hs23-b14 +acb171a8d7d60eba19660168398b49ea556f02d7 jdk7u4-b11 9ad8feb5afbddec46d3cfe29fb5f73c2e99d5a43 jdk8-b25 d71e662fe03741b6de498ca2077220148405a978 hs23-b15 +87b4042571ef6245fa2163f2c3ca5176f1d1856c jdk7u4-b12 fd3060701216a11c0df6dcd053c6fd7c2b17a42c jdk8-b26 f92a171cf0071ca6c3fa8231d7d570377f8b2f4d hs23-b16 f92a171cf0071ca6c3fa8231d7d570377f8b2f4d hs23-b16 931e5f39e365a0d550d79148ff87a7f9e864d2e1 hs23-b16 +efb5f2662c96c472caa3327090268c75a86dd9c0 jdk7u4-b13 +82e719a2e6416838b4421637646cbfd7104c7716 jdk7u4-b14 +e5f7f95411fb9e837800b4152741c962118e5d7a jdk7u5-b01 +1c483d994a78e46c4656b6f3773c7014346d0f19 jdk7u4-b15 34a4f7687460b1b2bfb1d87191919c5f101aa988 hs23-b17 +c6a96f7a781dd23d2b9fd6353fcd87493616c803 jdk7u4-b16 418bcab91d2c07c720190d39e1b7f7e39b214994 hs23-b18 +e266ffd6a7d7ccd6e06a442155c5e2457c1884de jdk7u4-b17 ad5eb0a72fb1d6d7aa6ec7e9cfd06045aef51728 hs23-b19 +f1b786625e0c2ce215d70dda637a127edb2688f2 jdk7u4-b18 1834c6835b75ed0c0f6fdb55a4ae56cc82e0f15c hs23-b20 +a1292d4e07097cf68addadca35553fd1255dc555 jdk7u4-b19 34fce1d343b0d9f5e1e5ea30d93e840d260f3dce hs23-b21 +ad6f5eaa165edc94caaa0ac582828718a63a3d02 jdk7u4-b20 +c7c6b00122cf49c4147229689904a20779e73b85 jdk7u4-b30 +93ec23d55b87d46bada8f32b84eb67b427436858 jdk7u4-b21 +1eb9f79307a83f967359c00c56a63d0cf5f36b12 jdk7u4-b22 +aed9d0f0f050f8676dbc4541f0ecd28920f2bb09 jdk7u4-b31 +dc978aca3cebf9633b2c556532c597865d1bb3d9 jdk7u5-b02 +6024bdfed9bfe372a6758701a501f35af16a281c jdk7u5-b04 +42ee6a26a5438c792ba304613e9c6a2c82ad88a8 jdk7u5-b05 +6434cb74457e50a211f6a9dd2629dcd0d5068a73 jdk7u5-b30 +82e719a2e6416838b4421637646cbfd7104c7716 jdk7u6-b01 +6b71938ee832043c337aa837fc0eb3bef088fd52 jdk7u6-b02 +bca9e76ea25409d97d5b0c8f788e673e9cf49a09 jdk7u6-b03 +b82c43fba5c0d219568ebabfa48a5e62c07467af jdk7u6-b04 +77b43af50556ed9da98efcda9875ee112fcad66b jdk7u6-b05 +be1d97cdee46fd6ba7192eeefd6fa9bfd4988c22 jdk7u6-b06 +144f8a1a43cb9e0656d1265b42a934baf552f454 jdk7u6-b07 +6b668c1049a8910aabc9d23345d357f20fa24714 jdk7u6-b08 +94d7a305da4dcf46049efd81c2afca512d2afa7f jdk7u6-b09 1fcba869fe4a932616067e051565590ff375a63b hs23.2-b01 +702b62a5e1a546ba5eea17619f9056a86fec03f1 jdk7u6-b10 b7ae1ee1d2e49bbfbcf35587cb51c04abf2710a2 hs23.2-b02 +5921bdc6ce5cd9e3511a4177f9995becb2c2981d jdk7u6-b11 e974e15945658e574e6c344c4a7ba225f5708c10 hs23.2-b03 +f08a3a0e60c32cb0e8350e72fdc54849759096a4 jdk7u6-b12 7a8d3cd6562170f4c262e962270f679ac503f456 hs23.2-b04 +28746e6d615f27816f483485a53b790c7a463f0c jdk7u6-b13 202880d633e646d4936798d0fba6efc0cab04dc8 hs23.2-b05 +6b0f178141388f5721aa5365cb542715acbf0cc7 jdk7u6-b14 +ced728021cf5402205a0bb25e3d85c2bf2dc55f0 jdk7u6-b15 7871a1b632cb17784de4f2afb0102702809a66f9 hs23.2-b06 d1c1573de6ca46d9a386e6a0cc84ac7d716253fc hs23.2-b07 +cefe884c708aa6dfd63aff45f6c698a6bc346791 jdk7u6-b16
--- a/.jcheck/conf Fri Jun 29 14:28:10 2012 -0700 +++ b/.jcheck/conf Fri Jun 29 15:43:13 2012 -0700 @@ -1,1 +1,2 @@ -project=jdk8 +project=jdk7 +bugids=dup
--- a/THIRD_PARTY_README Fri Jun 29 14:28:10 2012 -0700 +++ b/THIRD_PARTY_README Fri Jun 29 15:43:13 2012 -0700 @@ -216,15 +216,16 @@ is included with JRE 7, JDK 7, and OpenJDK 7. You are receiving a copy of the Elliptic Curve Cryptography library in source -form with the JDK 7 source distribution and object code in the JRE 7 & JDK 7 -runtime. - -The terms of the Oracle license do NOT apply to the Elliptic Curve -Cryptography library program; it is licensed under the following license, -separately from the Oracle programs you receive. If you do not wish to install -this program, you may delete the library named libsunec.so (on Solaris and -Linux systems) or sunec.dll (on Windows systems) from the JRE bin directory -reserved for native libraries. +form with the JDK 7 and OpenJDK7 source distributions, and as object code in +the JRE 7 & JDK 7 runtimes. + +In the case of the JRE 7 & JDK 7 runtimes, the terms of the Oracle license do +NOT apply to the Elliptic Curve Cryptography library; it is licensed under the +following license, separately from Oracle's JDK & JRE. If you do not wish to +install the Elliptic Curve Cryptography library, you may delete the library +named libsunec.so (on Solaris and Linux systems) or sunec.dll (on Windows +systems) from the JRE bin directory reserved for native libraries. + --- begin of LICENSE --- @@ -1000,7 +1001,7 @@ ------------------------------------------------------------------------------- -%% This notice is provided with respect to libpng 1.2.18, which is +%% This notice is provided with respect to libpng 1.5.4, which is included with JRE 7, JDK 7, and OpenJDK 7. --- begin of LICENSE --- @@ -1014,8 +1015,10 @@ If you modify libpng you may insert additional notices immediately following this sentence. -libpng versions 1.2.6, August 15, 2004, through 1.2.18, May 15, 2007, are -Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are +This code is released under the libpng license. + +libpng versions 1.2.6, August 15, 2004, through 1.5.4, July 7, 2011, are +Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.2.5 with the following individual added to the list of Contributing Authors @@ -1112,7 +1115,7 @@ Glenn Randers-Pehrson glennrp at users.sourceforge.net -May 15, 2007 +July 7, 2011 --- end of LICENSE ---
--- a/src/share/vm/ci/ciField.cpp Fri Jun 29 14:28:10 2012 -0700 +++ b/src/share/vm/ci/ciField.cpp Fri Jun 29 15:43:13 2012 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -67,7 +67,7 @@ // ------------------------------------------------------------------ // ciField::ciField -ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with(NULL) { +ciField::ciField(ciInstanceKlass* klass, int index): _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) { ASSERT_IN_VM; CompilerThread *thread = CompilerThread::current(); @@ -143,7 +143,7 @@ initialize_from(&field_desc); } -ciField::ciField(fieldDescriptor *fd): _known_to_link_with(NULL) { +ciField::ciField(fieldDescriptor *fd): _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) { ASSERT_IN_VM; _cp_index = -1; @@ -315,6 +315,10 @@ bool ciField::will_link(ciInstanceKlass* accessing_klass, Bytecodes::Code bc) { VM_ENTRY_MARK; + assert(bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic || + bc == Bytecodes::_getfield || bc == Bytecodes::_putfield, + "unexpected bytecode"); + if (_offset == -1) { // at creation we couldn't link to our holder so we need to // maintain that stance, otherwise there's no safe way to use this @@ -322,8 +326,22 @@ return false; } - if (_known_to_link_with == accessing_klass) { - return true; + // Check for static/nonstatic mismatch + bool is_static = (bc == Bytecodes::_getstatic || bc == Bytecodes::_putstatic); + if (is_static != this->is_static()) { + return false; + } + + // Get and put can have different accessibility rules + bool is_put = (bc == Bytecodes::_putfield || bc == Bytecodes::_putstatic); + if (is_put) { + if (_known_to_link_with_put == accessing_klass) { + return true; + } + } else { + if (_known_to_link_with_get == accessing_klass) { + return true; + } } FieldAccessInfo result; @@ -334,8 +352,13 @@ true, false, KILL_COMPILE_ON_FATAL_(false)); // update the hit-cache, unless there is a problem with memory scoping: - if (accessing_klass->is_shared() || !is_shared()) - _known_to_link_with = accessing_klass; + if (accessing_klass->is_shared() || !is_shared()) { + if (is_put) { + _known_to_link_with_put = accessing_klass; + } else { + _known_to_link_with_get = accessing_klass; + } + } return true; }
--- a/src/share/vm/ci/ciField.hpp Fri Jun 29 14:28:10 2012 -0700 +++ b/src/share/vm/ci/ciField.hpp Fri Jun 29 15:43:13 2012 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -49,7 +49,8 @@ ciType* _type; int _offset; bool _is_constant; - ciInstanceKlass* _known_to_link_with; + ciInstanceKlass* _known_to_link_with_put; + ciInstanceKlass* _known_to_link_with_get; ciConstant _constant_value; // Used for will_link
--- a/src/share/vm/classfile/verifier.cpp Fri Jun 29 14:28:10 2012 -0700 +++ b/src/share/vm/classfile/verifier.cpp Fri Jun 29 15:43:13 2012 -0700 @@ -1884,10 +1884,10 @@ VerificationType type = current_frame->pop_stack( VerificationType::reference_check(), CHECK_VERIFY(this)); if (type == VerificationType::uninitialized_this_type()) { - // The method must be an <init> method of either this class, or one of its - // superclasses + // The method must be an <init> method of this class or its superclass + klassOop superk = current_class()->super(); if (ref_class_type.name() != current_class()->name() && - !name_in_supers(ref_class_type.name(), current_class())) { + ref_class_type.name() != superk->klass_part()->name()) { verify_error(bci, "Bad <init> method call"); return; }
--- a/src/share/vm/compiler/compilerOracle.cpp Fri Jun 29 14:28:10 2012 -0700 +++ b/src/share/vm/compiler/compilerOracle.cpp Fri Jun 29 15:43:13 2012 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -551,13 +551,22 @@ } static const char* cc_file() { - if (CompileCommandFile == NULL) +#ifdef ASSERT + if (CompileCommandFile == NULL) { return ".hotspot_compiler"; + } +#endif return CompileCommandFile; } + +bool CompilerOracle::has_command_file() { + return cc_file() != NULL; +} + bool CompilerOracle::_quiet = false; void CompilerOracle::parse_from_file() { + assert(has_command_file(), "command file must be specified"); FILE* stream = fopen(cc_file(), "rt"); if (stream == NULL) return; @@ -600,6 +609,7 @@ } void CompilerOracle::append_comment_to_file(const char* message) { + assert(has_command_file(), "command file must be specified"); fileStream stream(fopen(cc_file(), "at")); stream.print("# "); for (int index = 0; message[index] != '\0'; index++) { @@ -610,6 +620,7 @@ } void CompilerOracle::append_exclude_to_file(methodHandle method) { + assert(has_command_file(), "command file must be specified"); fileStream stream(fopen(cc_file(), "at")); stream.print("exclude "); Klass::cast(method->method_holder())->name()->print_symbol_on(&stream); @@ -624,7 +635,9 @@ void compilerOracle_init() { CompilerOracle::parse_from_string(CompileCommand, CompilerOracle::parse_from_line); CompilerOracle::parse_from_string(CompileOnly, CompilerOracle::parse_compile_only); - CompilerOracle::parse_from_file(); + if (CompilerOracle::has_command_file()) { + CompilerOracle::parse_from_file(); + } if (lists[PrintCommand] != NULL) { if (PrintAssembly) { warning("CompileCommand and/or .hotspot_compiler file contains 'print' commands, but PrintAssembly is also enabled");
--- a/src/share/vm/compiler/compilerOracle.hpp Fri Jun 29 14:28:10 2012 -0700 +++ b/src/share/vm/compiler/compilerOracle.hpp Fri Jun 29 15:43:13 2012 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -36,6 +36,10 @@ static bool _quiet; public: + + // True if the command file has been specified or is implicit + static bool has_command_file(); + // Reads from file and adds to lists static void parse_from_file();
--- a/src/share/vm/opto/runtime.cpp Fri Jun 29 14:28:10 2012 -0700 +++ b/src/share/vm/opto/runtime.cpp Fri Jun 29 15:43:13 2012 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -896,7 +896,8 @@ methodOop method = ((nmethod*)n)->method(); tty->print_cr("# Method where it happened %s.%s ", Klass::cast(method->method_holder())->name()->as_C_string(), method->name()->as_C_string()); tty->print_cr("#"); - if (ShowMessageBoxOnError && UpdateHotSpotCompilerFileOnError) { + if (ShowMessageBoxOnError && UpdateHotSpotCompilerFileOnError && + CompilerOracle::has_command_file()) { const char* title = "HotSpot Runtime Error"; const char* question = "Do you want to exclude compilation of this method in future runs?"; if (os::message_box(title, question)) {
--- a/src/share/vm/runtime/arguments.cpp Fri Jun 29 14:28:10 2012 -0700 +++ b/src/share/vm/runtime/arguments.cpp Fri Jun 29 15:43:13 2012 -0700 @@ -3001,12 +3001,14 @@ } } +#ifdef ASSERT // Parse default .hotspotrc settings file if (!settings_file_specified) { if (!process_settings_file(".hotspotrc", false, args->ignoreUnrecognized)) { return JNI_EINVAL; } } +#endif if (PrintVMOptions) { for (index = 0; index < args->nOptions; index++) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/runtime/7110720/Test7110720.sh Fri Jun 29 15:43:13 2012 -0700 @@ -0,0 +1,122 @@ +# +# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# + + +# +# @test Test7110720.sh +# @bug 7110720 +# @summary improve VM configuration file loading +# @run shell Test7110720.sh +# + +if [ "${TESTSRC}" = "" ] + then TESTSRC=. +fi + +if [ "${TESTJAVA}" = "" ] +then + PARENT=`dirname \`which java\`` + TESTJAVA=`dirname ${PARENT}` + echo "TESTJAVA not set, selecting " ${TESTJAVA} + echo "If this is incorrect, try setting the variable manually." +fi + +if [ "${TESTCLASSES}" = "" ] +then + echo "TESTCLASSES not set. Test cannot execute. Failed." + exit 1 +fi + +# Jtreg sets TESTVMOPTS which may include -d64 which is +# required to test a 64-bit JVM on some platforms. +# If another test harness still creates HOME/JDK64BIT, +# we can recognise that. + +# set platform-dependent variables +OS=`uname -s` +case "$OS" in + SunOS | Linux ) + FS="/" + RM=/bin/rm + CP=/bin/cp + MV=/bin/mv + ## for solaris, linux it's HOME + FILE_LOCATION=$HOME + if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ] + then + TESTVMOPTS=`cat ${FILE_LOCATION}${FS}JDK64BIT` + fi + ;; + Windows_* ) + FS="\\" + RM=rm + CP=cp + MV=mv + ;; + * ) + echo "Unrecognized system!" + exit 1; + ;; +esac + + +JAVA=${TESTJAVA}${FS}bin${FS}java + +# Don't test debug builds, they do read the config files: +${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "debug" >/dev/null +if [ "$?" = "0" ]; then + echo Skipping test for debug build. + exit 0 +fi + +ok=yes + +$RM -f .hotspot_compiler .hotspotrc + +${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage in" >/dev/null +if [ "$?" = "0" ]; then + echo "FAILED: base case failure" + exit 1 +fi + + +echo "garbage in, garbage out" > .hotspot_compiler +${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage in" >/dev/null +if [ "$?" = "0" ]; then + echo "FAILED: .hotspot_compiler was read" + ok=no +fi + +$MV .hotspot_compiler hs_comp.txt +${JAVA} ${TESTVMOPTS} -XX:CompileCommandFile=hs_comp.txt -version 2>&1 | grep "garbage in" >/dev/null +if [ "$?" = "1" ]; then + echo "FAILED: explicit compiler command file not read" + ok=no +fi + +$RM -f .hotspot_compiler hs_comp.txt + +echo "garbage" > .hotspotrc +${JAVA} ${TESTVMOPTS} -version 2>&1 | grep "garbage" >/dev/null +if [ "$?" = "0" ]; then + echo "FAILED: .hotspotrc was read" + ok=no +fi + +$MV .hotspotrc hs_flags.txt +${JAVA} ${TESTVMOPTS} -XX:Flags=hs_flags.txt -version 2>&1 | grep "garbage" >/dev/null +if [ "$?" = "1" ]; then + echo "FAILED: explicit flags file not read" + ok=no +fi + +if [ "${ok}" = "no" ]; then + echo "Some tests failed." + exit 1 +else + echo "Passed" + exit 0 +fi +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/runtime/7160757/Test7160757.java Fri Jun 29 15:43:13 2012 -0700 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 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 + * 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test Test7160757.java + * @bug 7160757 + * @summary Tests that superclass initialization is not skipped + */ + +public class Test7160757 { + + public static void main(String args[]) throws Exception { + + ClassLoader loader = new SLoader(); + try { + Class.forName("S", true, loader); + System.out.println("FAILED"); + throw new Exception("Should have thrown a VerifyError."); + } catch (VerifyError e) { + System.out.println(e); + System.out.println("PASSED"); + } + } + + static class SLoader extends ClassLoader { + + /** + * public class S extends Throwable { + * public S() { + * aload_0 + * invokespecial Object.<init>() + * return + * } + * } + */ + static byte b(int i) { return (byte)i; } + static byte S_class[] = { + b(0xca), b(0xfe), b(0xba), b(0xbe), 0x00, 0x00, 0x00, 0x32, + 0x00, 0x0c, 0x0a, 0x00, 0x0b, 0x00, 0x07, 0x07, + 0x00, 0x08, 0x07, 0x00, 0x09, 0x01, 0x00, 0x06, + 0x3c, 0x69, 0x6e, 0x69, 0x74, 0x3e, 0x01, 0x00, + 0x03, 0x28, 0x29, 0x56, 0x01, 0x00, 0x04, 0x43, + 0x6f, 0x64, 0x65, 0x0c, 0x00, 0x04, 0x00, 0x05, + 0x01, 0x00, 0x01, 0x53, 0x01, 0x00, 0x13, 0x6a, + 0x61, 0x76, 0x61, 0x2f, 0x6c, 0x61, 0x6e, 0x67, + 0x2f, 0x54, 0x68, 0x72, 0x6f, 0x77, 0x61, 0x62, + 0x6c, 0x65, 0x01, 0x00, 0x10, 0x6a, 0x61, 0x76, + 0x61, 0x2f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x07, 0x00, 0x0a, + 0x00, 0x21, 0x00, 0x02, 0x00, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, + 0x00, 0x05, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00, + 0x00, 0x11, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, + 0x00, 0x05, 0x2a, b(0xb7), 0x00, 0x01, b(0xb1), 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + public Class findClass(String name) throws ClassNotFoundException { + return defineClass(name, S_class, 0, S_class.length); + } + } +}