8041623: Solaris Studio 12.4 C++ 5.13, CHECK_UNHANDLED_OOPS use of class oop's copy constructor definitions causing error level diagnostic.

Thu, 29 May 2014 08:58:51 -0400

author
lfoltan
date
Thu, 29 May 2014 08:58:51 -0400
changeset 9314
46ab61b0758b
parent 9313
fd0ca2c1433b
child 9315
d8af86b0b638

8041623: Solaris Studio 12.4 C++ 5.13, CHECK_UNHANDLED_OOPS use of class oop's copy constructor definitions causing error level diagnostic.
Summary: Fix several minor compilation issues with volatile oops for CHECK_UNHANDLED_OOPS support.
Reviewed-by: coleenp, hseigel

src/share/vm/classfile/javaClasses.hpp file | annotate | diff | comparison | revisions
src/share/vm/oops/oopsHierarchy.hpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/thread.cpp file | annotate | diff | comparison | revisions
src/share/vm/services/memoryManager.cpp file | annotate | diff | comparison | revisions
src/share/vm/services/memoryPool.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/classfile/javaClasses.hpp	Tue Dec 31 08:58:08 2013 -0500
     1.2 +++ b/src/share/vm/classfile/javaClasses.hpp	Thu May 29 08:58:51 2014 -0400
     1.3 @@ -1209,7 +1209,7 @@
     1.4    static oop              target(         oop site)             { return site->obj_field(             _target_offset);         }
     1.5    static void         set_target(         oop site, oop target) {        site->obj_field_put(         _target_offset, target); }
     1.6  
     1.7 -  static volatile oop     target_volatile(oop site)             { return site->obj_field_volatile(    _target_offset);         }
     1.8 +  static volatile oop     target_volatile(oop site)             { return oop((oopDesc *)(site->obj_field_volatile(_target_offset))); }
     1.9    static void         set_target_volatile(oop site, oop target) {        site->obj_field_put_volatile(_target_offset, target); }
    1.10  
    1.11    // Testers
     2.1 --- a/src/share/vm/oops/oopsHierarchy.hpp	Tue Dec 31 08:58:08 2013 -0500
     2.2 +++ b/src/share/vm/oops/oopsHierarchy.hpp	Thu May 29 08:58:51 2014 -0400
     2.3 @@ -1,5 +1,5 @@
     2.4  /*
     2.5 - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     2.6 + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     2.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.8   *
     2.9   * This code is free software; you can redistribute it and/or modify it
    2.10 @@ -112,9 +112,7 @@
    2.11  
    2.12    // Assignment
    2.13    oop& operator=(const oop& o)                            { _o = o.obj(); return *this; }
    2.14 -#ifndef SOLARIS
    2.15    volatile oop& operator=(const oop& o) volatile          { _o = o.obj(); return *this; }
    2.16 -#endif
    2.17    volatile oop& operator=(const volatile oop& o) volatile { _o = o.obj(); return *this; }
    2.18  
    2.19    // Explict user conversions
    2.20 @@ -123,11 +121,10 @@
    2.21    operator void* () const volatile    { return (void *)obj(); }
    2.22  #endif
    2.23    operator HeapWord* () const         { return (HeapWord*)obj(); }
    2.24 -  operator oopDesc* () const          { return obj(); }
    2.25 +  operator oopDesc* () const volatile { return obj(); }
    2.26    operator intptr_t* () const         { return (intptr_t*)obj(); }
    2.27    operator PromotedObject* () const   { return (PromotedObject*)obj(); }
    2.28    operator markOop () const           { return markOop(obj()); }
    2.29 -
    2.30    operator address   () const         { return (address)obj(); }
    2.31  
    2.32    // from javaCalls.cpp
    2.33 @@ -161,11 +158,10 @@
    2.34              oop::operator=(o);                                             \
    2.35              return *this;                                                  \
    2.36         }                                                                   \
    2.37 -       NOT_SOLARIS(                                                        \
    2.38         volatile type##Oop& operator=(const type##Oop& o) volatile {        \
    2.39              (void)const_cast<oop&>(oop::operator=(o));                     \
    2.40              return *this;                                                  \
    2.41 -       })                                                                  \
    2.42 +       }                                                                   \
    2.43         volatile type##Oop& operator=(const volatile type##Oop& o) volatile {\
    2.44              (void)const_cast<oop&>(oop::operator=(o));                     \
    2.45              return *this;                                                  \
     3.1 --- a/src/share/vm/runtime/thread.cpp	Tue Dec 31 08:58:08 2013 -0500
     3.2 +++ b/src/share/vm/runtime/thread.cpp	Thu May 29 08:58:51 2014 -0400
     3.3 @@ -1451,7 +1451,7 @@
     3.4    _in_deopt_handler = 0;
     3.5    _doing_unsafe_access = false;
     3.6    _stack_guard_state = stack_guard_unused;
     3.7 -  (void)const_cast<oop&>(_exception_oop = NULL);
     3.8 +  (void)const_cast<oop&>(_exception_oop = oop(NULL));
     3.9    _exception_pc  = 0;
    3.10    _exception_handler_pc = 0;
    3.11    _is_method_handle_return = 0;
     4.1 --- a/src/share/vm/services/memoryManager.cpp	Tue Dec 31 08:58:08 2013 -0500
     4.2 +++ b/src/share/vm/services/memoryManager.cpp	Thu May 29 08:58:51 2014 -0400
     4.3 @@ -1,5 +1,5 @@
     4.4  /*
     4.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
     4.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
     4.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4.8   *
     4.9   * This code is free software; you can redistribute it and/or modify it
    4.10 @@ -46,7 +46,7 @@
    4.11  
    4.12  MemoryManager::MemoryManager() {
    4.13    _num_pools = 0;
    4.14 -  (void)const_cast<instanceOop&>(_memory_mgr_obj = NULL);
    4.15 +  (void)const_cast<instanceOop&>(_memory_mgr_obj = instanceOop(NULL));
    4.16  }
    4.17  
    4.18  void MemoryManager::add_pool(MemoryPool* pool) {
     5.1 --- a/src/share/vm/services/memoryPool.cpp	Tue Dec 31 08:58:08 2013 -0500
     5.2 +++ b/src/share/vm/services/memoryPool.cpp	Thu May 29 08:58:51 2014 -0400
     5.3 @@ -1,5 +1,5 @@
     5.4  /*
     5.5 - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
     5.6 + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
     5.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     5.8   *
     5.9   * This code is free software; you can redistribute it and/or modify it
    5.10 @@ -46,7 +46,7 @@
    5.11    _name = name;
    5.12    _initial_size = init_size;
    5.13    _max_size = max_size;
    5.14 -  (void)const_cast<instanceOop&>(_memory_pool_obj = NULL);
    5.15 +  (void)const_cast<instanceOop&>(_memory_pool_obj = instanceOop(NULL));
    5.16    _available_for_allocation = true;
    5.17    _num_managers = 0;
    5.18    _type = type;

mercurial