# HG changeset patch # User fparain # Date 1329143084 28800 # Node ID 1bb2838e2fc1c6093ea03ec08121b496bf477573 # Parent 094138495da4cfd1462670e65bc7bab4c0ed0123# Parent 54d3535a6dd3239c7128428b4e19147fe82d37ac Merge diff -r 54d3535a6dd3 -r 1bb2838e2fc1 .hgtags --- a/.hgtags Sun Feb 12 19:33:11 2012 -0800 +++ b/.hgtags Mon Feb 13 06:24:44 2012 -0800 @@ -218,3 +218,5 @@ a80fd4f45d7aaa154ed2f86a129f3c9c4035ec7a jdk8-b24 b22de824749922986ce4d442bed029916b832807 hs23-b13 64b46f975ab82948c1e021e17775ff4fab8bc40e hs23-b14 +9ad8feb5afbddec46d3cfe29fb5f73c2e99d5a43 jdk8-b25 +d71e662fe03741b6de498ca2077220148405a978 hs23-b15 diff -r 54d3535a6dd3 -r 1bb2838e2fc1 make/hotspot_version --- a/make/hotspot_version Sun Feb 12 19:33:11 2012 -0800 +++ b/make/hotspot_version Mon Feb 13 06:24:44 2012 -0800 @@ -35,7 +35,7 @@ HS_MAJOR_VER=23 HS_MINOR_VER=0 -HS_BUILD_NUMBER=15 +HS_BUILD_NUMBER=16 JDK_MAJOR_VER=1 JDK_MINOR_VER=8 diff -r 54d3535a6dd3 -r 1bb2838e2fc1 src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp --- a/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp Sun Feb 12 19:33:11 2012 -0800 +++ b/src/cpu/sparc/vm/c1_CodeStubs_sparc.cpp Mon Feb 13 06:24:44 2012 -0800 @@ -472,7 +472,7 @@ __ load_klass(src_reg, tmp_reg); Address ref_type_adr(tmp_reg, instanceKlass::reference_type_offset()); - __ ld(ref_type_adr, tmp_reg); + __ ldub(ref_type_adr, tmp_reg); // _reference_type field is of type ReferenceType (enum) assert(REF_NONE == 0, "check this code"); diff -r 54d3535a6dd3 -r 1bb2838e2fc1 src/cpu/x86/vm/c1_CodeStubs_x86.cpp --- a/src/cpu/x86/vm/c1_CodeStubs_x86.cpp Sun Feb 12 19:33:11 2012 -0800 +++ b/src/cpu/x86/vm/c1_CodeStubs_x86.cpp Mon Feb 13 06:24:44 2012 -0800 @@ -520,7 +520,7 @@ __ load_klass(tmp_reg, src_reg); Address ref_type_adr(tmp_reg, instanceKlass::reference_type_offset()); - __ cmpl(ref_type_adr, REF_NONE); + __ cmpb(ref_type_adr, REF_NONE); __ jcc(Assembler::equal, _continuation); // Is marking active? diff -r 54d3535a6dd3 -r 1bb2838e2fc1 src/cpu/x86/vm/stubGenerator_x86_64.cpp --- a/src/cpu/x86/vm/stubGenerator_x86_64.cpp Sun Feb 12 19:33:11 2012 -0800 +++ b/src/cpu/x86/vm/stubGenerator_x86_64.cpp Mon Feb 13 06:24:44 2012 -0800 @@ -2978,7 +2978,9 @@ int frame_complete = __ pc() - start; // Set up last_Java_sp and last_Java_fp - __ set_last_Java_frame(rsp, rbp, NULL); + address the_pc = __ pc(); + __ set_last_Java_frame(rsp, rbp, the_pc); + __ andptr(rsp, -(StackAlignmentInBytes)); // Align stack // Call runtime if (arg1 != noreg) { @@ -2997,7 +2999,7 @@ oop_maps->add_gc_map(__ pc() - start, map); - __ reset_last_Java_frame(true, false); + __ reset_last_Java_frame(true, true); __ leave(); // required for proper stackwalking of RuntimeStub frame diff -r 54d3535a6dd3 -r 1bb2838e2fc1 src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp --- a/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp Sun Feb 12 19:33:11 2012 -0800 +++ b/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp Mon Feb 13 06:24:44 2012 -0800 @@ -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 @@ -362,7 +362,7 @@ } intptr_t* _get_previous_fp() { -#if defined(SPARC_WORKS) || defined(__clang__) +#if defined(SPARC_WORKS) || defined(__clang__) || defined(__llvm__) register intptr_t **ebp; __asm__("mov %%"SPELL_REG_FP", %0":"=r"(ebp)); #else diff -r 54d3535a6dd3 -r 1bb2838e2fc1 src/share/vm/oops/instanceKlass.hpp --- a/src/share/vm/oops/instanceKlass.hpp Sun Feb 12 19:33:11 2012 -0800 +++ b/src/share/vm/oops/instanceKlass.hpp Mon Feb 13 06:24:44 2012 -0800 @@ -240,7 +240,6 @@ Thread* _init_thread; // Pointer to current thread doing initialization (to handle recusive initialization) int _vtable_len; // length of Java vtable (in words) int _itable_len; // length of Java itable (in words) - ReferenceType _reference_type; // reference type OopMapCache* volatile _oop_map_cache; // OopMapCache for all methods in the klass (allocated lazily) JNIid* _jni_ids; // First JNI identifier for static fields in this class jmethodID* _methods_jmethod_ids; // jmethodIDs corresponding to method_idnum, or NULL if none @@ -265,6 +264,8 @@ // _idnum_allocated_count. u1 _init_state; // state of class + u1 _reference_type; // reference type + // embedded Java vtable follows here // embedded Java itables follows here // embedded static fields follows here @@ -407,8 +408,11 @@ void eager_initialize(Thread *thread); // reference type - ReferenceType reference_type() const { return _reference_type; } - void set_reference_type(ReferenceType t) { _reference_type = t; } + ReferenceType reference_type() const { return (ReferenceType)_reference_type; } + void set_reference_type(ReferenceType t) { + assert(t == (u1)t, "overflow"); + _reference_type = (u1)t; + } static ByteSize reference_type_offset() { return in_ByteSize(sizeof(klassOopDesc) + offset_of(instanceKlass, _reference_type)); } diff -r 54d3535a6dd3 -r 1bb2838e2fc1 src/share/vm/opto/graphKit.cpp --- a/src/share/vm/opto/graphKit.cpp Sun Feb 12 19:33:11 2012 -0800 +++ b/src/share/vm/opto/graphKit.cpp Mon Feb 13 06:24:44 2012 -0800 @@ -1522,6 +1522,11 @@ const TypeOopPtr* val_type, BasicType bt, bool use_precise) { + // Transformation of a value which could be NULL pointer (CastPP #NULL) + // could be delayed during Parse (for example, in adjust_map_after_if()). + // Execute transformation here to avoid barrier generation in such case. + if (_gvn.type(val) == TypePtr::NULL_PTR) + val = _gvn.makecon(TypePtr::NULL_PTR); set_control(ctl); if (stopped()) return top(); // Dead path ? diff -r 54d3535a6dd3 -r 1bb2838e2fc1 src/share/vm/opto/library_call.cpp --- a/src/share/vm/opto/library_call.cpp Sun Feb 12 19:33:11 2012 -0800 +++ b/src/share/vm/opto/library_call.cpp Mon Feb 13 06:24:44 2012 -0800 @@ -2153,7 +2153,7 @@ // // if (offset == java_lang_ref_Reference::_reference_offset) { // if (base != null) { - // if (klass(base)->reference_type() != REF_NONE)) { + // if (instance_of(base, java.lang.ref.Reference)) { // pre_barrier(_, pre_val, ...); // } // } @@ -2165,8 +2165,6 @@ IdealKit ideal(this); #define __ ideal. - const int reference_type_offset = in_bytes(instanceKlass::reference_type_offset()); - Node* referent_off = __ ConX(java_lang_ref_Reference::referent_offset); __ if_then(offset, BoolTest::eq, referent_off, unlikely); { @@ -2678,7 +2676,13 @@ cas = _gvn.transform(new (C, 5) CompareAndSwapLNode(control(), mem, adr, newval, oldval)); break; case T_OBJECT: - // reference stores need a store barrier. + // Transformation of a value which could be NULL pointer (CastPP #NULL) + // could be delayed during Parse (for example, in adjust_map_after_if()). + // Execute transformation here to avoid barrier generation in such case. + if (_gvn.type(newval) == TypePtr::NULL_PTR) + newval = _gvn.makecon(TypePtr::NULL_PTR); + + // Reference stores need a store barrier. // (They don't if CAS fails, but it isn't worth checking.) pre_barrier(true /* do_load*/, control(), base, adr, alias_idx, newval, value_type->make_oopptr(), diff -r 54d3535a6dd3 -r 1bb2838e2fc1 src/share/vm/opto/macro.cpp --- a/src/share/vm/opto/macro.cpp Sun Feb 12 19:33:11 2012 -0800 +++ b/src/share/vm/opto/macro.cpp Mon Feb 13 06:24:44 2012 -0800 @@ -234,11 +234,20 @@ } } else { // G1 pre/post barriers - assert(p2x->outcnt() == 2, "expects 2 users: Xor and URShift nodes"); + assert(p2x->outcnt() <= 2, "expects 1 or 2 users: Xor and URShift nodes"); // It could be only one user, URShift node, in Object.clone() instrinsic // but the new allocation is passed to arraycopy stub and it could not // be scalar replaced. So we don't check the case. + // An other case of only one user (Xor) is when the value check for NULL + // in G1 post barrier is folded after CCP so the code which used URShift + // is removed. + + // Take Region node before eliminating post barrier since it also + // eliminates CastP2X node when it has only one user. + Node* this_region = p2x->in(0); + assert(this_region != NULL, ""); + // Remove G1 post barrier. // Search for CastP2X->Xor->URShift->Cmp path which @@ -263,8 +272,6 @@ // Remove G1 pre barrier. // Search "if (marking != 0)" check and set it to "false". - Node* this_region = p2x->in(0); - assert(this_region != NULL, ""); // There is no G1 pre barrier if previous stored value is NULL // (for example, after initialization). if (this_region->is_Region() && this_region->req() == 3) { @@ -292,7 +299,7 @@ } // Now CastP2X can be removed since it is used only on dead path // which currently still alive until igvn optimize it. - assert(p2x->unique_out()->Opcode() == Op_URShiftX, ""); + assert(p2x->outcnt() == 0 || p2x->unique_out()->Opcode() == Op_URShiftX, ""); _igvn.replace_node(p2x, top()); } } diff -r 54d3535a6dd3 -r 1bb2838e2fc1 src/share/vm/runtime/vmStructs.cpp --- a/src/share/vm/runtime/vmStructs.cpp Sun Feb 12 19:33:11 2012 -0800 +++ b/src/share/vm/runtime/vmStructs.cpp Mon Feb 13 06:24:44 2012 -0800 @@ -314,7 +314,7 @@ nonstatic_field(instanceKlass, _init_thread, Thread*) \ nonstatic_field(instanceKlass, _vtable_len, int) \ nonstatic_field(instanceKlass, _itable_len, int) \ - nonstatic_field(instanceKlass, _reference_type, ReferenceType) \ + nonstatic_field(instanceKlass, _reference_type, u1) \ volatile_nonstatic_field(instanceKlass, _oop_map_cache, OopMapCache*) \ nonstatic_field(instanceKlass, _jni_ids, JNIid*) \ nonstatic_field(instanceKlass, _osr_nmethods_head, nmethod*) \ diff -r 54d3535a6dd3 -r 1bb2838e2fc1 src/share/vm/utilities/xmlstream.cpp --- a/src/share/vm/utilities/xmlstream.cpp Sun Feb 12 19:33:11 2012 -0800 +++ b/src/share/vm/utilities/xmlstream.cpp Mon Feb 13 06:24:44 2012 -0800 @@ -192,8 +192,11 @@ _element_close_stack_ptr = cur_tag + strlen(cur_tag) + 1; _element_depth -= 1; } - if (bad_tag && !VMThread::should_terminate() && !is_error_reported()) + if (bad_tag && !VMThread::should_terminate() && !VM_Exit::vm_exited() && + !is_error_reported()) + { assert(false, "bad tag in log"); + } } #endif