comparison src/share/vm/oops/symbol.cpp @ 12146:9758d9f36299

8021954: VM SIGSEGV during classloading on MacOS; hs_err_pid file produced Summary: declare all user-defined operator new()s within Hotspot code with the empty throw() exception specification Reviewed-by: coleenp, twisti, dholmes, hseigel, dcubed, kvn, ccheung Contributed-by: lois.foltan@oracle.com
author coleenp
date Thu, 29 Aug 2013 18:56:29 -0400
parents d9eed26d638a
children cd6b3f1a94ff
comparison
equal deleted inserted replaced
12145:cef1e56a4d88 12146:9758d9f36299
39 for (int i = 0; i < _length; i++) { 39 for (int i = 0; i < _length; i++) {
40 byte_at_put(i, name[i]); 40 byte_at_put(i, name[i]);
41 } 41 }
42 } 42 }
43 43
44 void* Symbol::operator new(size_t sz, int len, TRAPS) { 44 void* Symbol::operator new(size_t sz, int len, TRAPS) throw() {
45 int alloc_size = size(len)*HeapWordSize; 45 int alloc_size = size(len)*HeapWordSize;
46 address res = (address) AllocateHeap(alloc_size, mtSymbol); 46 address res = (address) AllocateHeap(alloc_size, mtSymbol);
47 return res; 47 return res;
48 } 48 }
49 49
50 void* Symbol::operator new(size_t sz, int len, Arena* arena, TRAPS) { 50 void* Symbol::operator new(size_t sz, int len, Arena* arena, TRAPS) throw() {
51 int alloc_size = size(len)*HeapWordSize; 51 int alloc_size = size(len)*HeapWordSize;
52 address res = (address)arena->Amalloc(alloc_size); 52 address res = (address)arena->Amalloc(alloc_size);
53 return res; 53 return res;
54 } 54 }
55 55
56 void* Symbol::operator new(size_t sz, int len, ClassLoaderData* loader_data, TRAPS) { 56 void* Symbol::operator new(size_t sz, int len, ClassLoaderData* loader_data, TRAPS) throw() {
57 address res; 57 address res;
58 int alloc_size = size(len)*HeapWordSize; 58 int alloc_size = size(len)*HeapWordSize;
59 res = (address) Metaspace::allocate(loader_data, size(len), true, 59 res = (address) Metaspace::allocate(loader_data, size(len), true,
60 MetaspaceObj::SymbolType, CHECK_NULL); 60 MetaspaceObj::SymbolType, CHECK_NULL);
61 return res; 61 return res;