src/share/vm/oops/symbol.hpp

changeset 4675
63e54c37ac64
parent 4267
bd7a7ce2e264
child 5306
d9eed26d638a
     1.1 --- a/src/share/vm/oops/symbol.hpp	Fri Feb 22 10:16:51 2013 -0800
     1.2 +++ b/src/share/vm/oops/symbol.hpp	Wed Feb 27 09:40:30 2013 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  /*
     1.5 - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     1.6 + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     1.7   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.8   *
     1.9   * This code is free software; you can redistribute it and/or modify it
    1.10 @@ -27,7 +27,6 @@
    1.11  
    1.12  #include "utilities/utf8.hpp"
    1.13  #include "memory/allocation.hpp"
    1.14 -#include "runtime/atomic.hpp"
    1.15  
    1.16  // A Symbol is a canonicalized string.
    1.17  // All Symbols reside in global SymbolTable and are reference counted.
    1.18 @@ -150,8 +149,8 @@
    1.19  
    1.20    // Reference counting.  See comments above this class for when to use.
    1.21    int refcount() const      { return _refcount; }
    1.22 -  inline void increment_refcount();
    1.23 -  inline void decrement_refcount();
    1.24 +  void increment_refcount();
    1.25 +  void decrement_refcount();
    1.26  
    1.27    int byte_at(int index) const {
    1.28      assert(index >=0 && index < _length, "symbol index overflow");
    1.29 @@ -232,26 +231,4 @@
    1.30   return (((uintptr_t)this < (uintptr_t)other) ? -1
    1.31     : ((uintptr_t)this == (uintptr_t) other) ? 0 : 1);
    1.32  }
    1.33 -
    1.34 -inline void Symbol::increment_refcount() {
    1.35 -  // Only increment the refcount if positive.  If negative either
    1.36 -  // overflow has occurred or it is a permanent symbol in a read only
    1.37 -  // shared archive.
    1.38 -  if (_refcount >= 0) {
    1.39 -    Atomic::inc(&_refcount);
    1.40 -    NOT_PRODUCT(Atomic::inc(&_total_count);)
    1.41 -  }
    1.42 -}
    1.43 -
    1.44 -inline void Symbol::decrement_refcount() {
    1.45 -  if (_refcount >= 0) {
    1.46 -    Atomic::dec(&_refcount);
    1.47 -#ifdef ASSERT
    1.48 -    if (_refcount < 0) {
    1.49 -      print();
    1.50 -      assert(false, "reference count underflow for symbol");
    1.51 -    }
    1.52 -#endif
    1.53 -  }
    1.54 -}
    1.55  #endif // SHARE_VM_OOPS_SYMBOL_HPP

mercurial