comparison src/share/vm/oops/symbol.cpp @ 8675:63e54c37ac64

8008959: Fix non-PCH build on Linux, Windows and MacOS X Summary: Fix the build without precompiled headers by either including the missing ".inline.hpp" files into the appropriate files or by turning inline-functions declared in header files into ordinary functions in ".cpp" files. Reviewed-by: coleenp, stefank, dholmes
author simonis
date Wed, 27 Feb 2013 09:40:30 +0100
parents fcc9e7681d63
children 8c03fc47511d
comparison
equal deleted inserted replaced
8105:94478a033036 8675:63e54c37ac64
1 /* 1 /*
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
25 25
26 #include "precompiled.hpp" 26 #include "precompiled.hpp"
27 #include "classfile/altHashing.hpp" 27 #include "classfile/altHashing.hpp"
28 #include "classfile/classLoaderData.hpp" 28 #include "classfile/classLoaderData.hpp"
29 #include "oops/symbol.hpp" 29 #include "oops/symbol.hpp"
30 #include "runtime/atomic.inline.hpp"
30 #include "runtime/os.hpp" 31 #include "runtime/os.hpp"
31 #include "memory/allocation.inline.hpp" 32 #include "memory/allocation.inline.hpp"
32 #include "memory/resourceArea.hpp" 33 #include "memory/resourceArea.hpp"
33 34
34 Symbol::Symbol(const u1* name, int length, int refcount) : _refcount(refcount), _length(length) { 35 Symbol::Symbol(const u1* name, int length, int refcount) : _refcount(refcount), _length(length) {
208 ResourceMark rm; 209 ResourceMark rm;
209 // Use alternate hashing algorithm on this symbol. 210 // Use alternate hashing algorithm on this symbol.
210 return AltHashing::murmur3_32(seed, (const jbyte*)as_C_string(), utf8_length()); 211 return AltHashing::murmur3_32(seed, (const jbyte*)as_C_string(), utf8_length());
211 } 212 }
212 213
214 void Symbol::increment_refcount() {
215 // Only increment the refcount if positive. If negative either
216 // overflow has occurred or it is a permanent symbol in a read only
217 // shared archive.
218 if (_refcount >= 0) {
219 Atomic::inc(&_refcount);
220 NOT_PRODUCT(Atomic::inc(&_total_count);)
221 }
222 }
223
224 void Symbol::decrement_refcount() {
225 if (_refcount >= 0) {
226 Atomic::dec(&_refcount);
227 #ifdef ASSERT
228 if (_refcount < 0) {
229 print();
230 assert(false, "reference count underflow for symbol");
231 }
232 #endif
233 }
234 }
235
213 void Symbol::print_on(outputStream* st) const { 236 void Symbol::print_on(outputStream* st) const {
214 if (this == NULL) { 237 if (this == NULL) {
215 st->print_cr("NULL"); 238 st->print_cr("NULL");
216 } else { 239 } else {
217 st->print("Symbol: '"); 240 st->print("Symbol: '");