提交 a4baaf9d 编写于 作者: C coleenp

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
上级 4f1e9592
/* /*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "adlc.hpp" #include "adlc.hpp"
void* Chunk::operator new(size_t requested_size, size_t length) { void* Chunk::operator new(size_t requested_size, size_t length) throw() {
return CHeapObj::operator new(requested_size + length); return CHeapObj::operator new(requested_size + length);
} }
...@@ -163,7 +163,7 @@ bool Arena::contains( const void *ptr ) const { ...@@ -163,7 +163,7 @@ bool Arena::contains( const void *ptr ) const {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// CHeapObj // CHeapObj
void* CHeapObj::operator new(size_t size){ void* CHeapObj::operator new(size_t size) throw() {
return (void *) malloc(size); return (void *) malloc(size);
} }
......
/* /*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
class CHeapObj { class CHeapObj {
public: public:
void* operator new(size_t size); void* operator new(size_t size) throw();
void operator delete(void* p); void operator delete(void* p);
void* new_array(size_t size); void* new_array(size_t size);
}; };
...@@ -53,7 +53,7 @@ class CHeapObj { ...@@ -53,7 +53,7 @@ class CHeapObj {
class ValueObj { class ValueObj {
public: public:
void* operator new(size_t size); void* operator new(size_t size) throw();
void operator delete(void* p); void operator delete(void* p);
}; };
...@@ -61,7 +61,7 @@ class ValueObj { ...@@ -61,7 +61,7 @@ class ValueObj {
class AllStatic { class AllStatic {
public: public:
void* operator new(size_t size); void* operator new(size_t size) throw();
void operator delete(void* p); void operator delete(void* p);
}; };
...@@ -70,7 +70,7 @@ class AllStatic { ...@@ -70,7 +70,7 @@ class AllStatic {
// Linked list of raw memory chunks // Linked list of raw memory chunks
class Chunk: public CHeapObj { class Chunk: public CHeapObj {
public: public:
void* operator new(size_t size, size_t length); void* operator new(size_t size, size_t length) throw();
void operator delete(void* p, size_t length); void operator delete(void* p, size_t length);
Chunk(size_t length); Chunk(size_t length);
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -485,7 +485,7 @@ int get_legal_text(FileBuff &fbuf, char **legal_text) ...@@ -485,7 +485,7 @@ int get_legal_text(FileBuff &fbuf, char **legal_text)
// VS2005 has its own definition, identical to this one. // VS2005 has its own definition, identical to this one.
#if !defined(_WIN32) || defined(_WIN64) || _MSC_VER < 1400 #if !defined(_WIN32) || defined(_WIN64) || _MSC_VER < 1400
void *operator new( size_t size, int, const char *, int ) { void *operator new( size_t size, int, const char *, int ) throw() {
return ::operator new( size ); return ::operator new( size );
} }
#endif #endif
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -296,7 +296,7 @@ class CodeBuffer: public StackObj { ...@@ -296,7 +296,7 @@ class CodeBuffer: public StackObj {
// CodeBuffers must be allocated on the stack except for a single // CodeBuffers must be allocated on the stack except for a single
// special case during expansion which is handled internally. This // special case during expansion which is handled internally. This
// is done to guarantee proper cleanup of resources. // is done to guarantee proper cleanup of resources.
void* operator new(size_t size) { return ResourceObj::operator new(size); } void* operator new(size_t size) throw() { return ResourceObj::operator new(size); }
void operator delete(void* p) { ShouldNotCallThis(); } void operator delete(void* p) { ShouldNotCallThis(); }
public: public:
......
/* /*
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -279,8 +279,8 @@ class InstructionMark: public StackObj { ...@@ -279,8 +279,8 @@ class InstructionMark: public StackObj {
// Base class for objects allocated by the compiler in the compilation arena // Base class for objects allocated by the compiler in the compilation arena
class CompilationResourceObj ALLOCATION_SUPER_CLASS_SPEC { class CompilationResourceObj ALLOCATION_SUPER_CLASS_SPEC {
public: public:
void* operator new(size_t size) { return Compilation::current()->arena()->Amalloc(size); } void* operator new(size_t size) throw() { return Compilation::current()->arena()->Amalloc(size); }
void* operator new(size_t size, Arena* arena) { void* operator new(size_t size, Arena* arena) throw() {
return arena->Amalloc(size); return arena->Amalloc(size);
} }
void operator delete(void* p) {} // nothing to do void operator delete(void* p) {} // nothing to do
......
/* /*
* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -323,7 +323,7 @@ class Instruction: public CompilationResourceObj { ...@@ -323,7 +323,7 @@ class Instruction: public CompilationResourceObj {
} }
public: public:
void* operator new(size_t size) { void* operator new(size_t size) throw() {
Compilation* c = Compilation::current(); Compilation* c = Compilation::current();
void* res = c->arena()->Amalloc(size); void* res = c->arena()->Amalloc(size);
((Instruction*)res)->_id = c->get_next_id(); ((Instruction*)res)->_id = c->get_next_id();
...@@ -1611,7 +1611,7 @@ LEAF(BlockBegin, StateSplit) ...@@ -1611,7 +1611,7 @@ LEAF(BlockBegin, StateSplit)
friend class SuxAndWeightAdjuster; friend class SuxAndWeightAdjuster;
public: public:
void* operator new(size_t size) { void* operator new(size_t size) throw() {
Compilation* c = Compilation::current(); Compilation* c = Compilation::current();
void* res = c->arena()->Amalloc(size); void* res = c->arena()->Amalloc(size);
((BlockBegin*)res)->_id = c->get_next_id(); ((BlockBegin*)res)->_id = c->get_next_id();
......
/* /*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -245,7 +245,7 @@ BufferBlob* BufferBlob::create(const char* name, CodeBuffer* cb) { ...@@ -245,7 +245,7 @@ BufferBlob* BufferBlob::create(const char* name, CodeBuffer* cb) {
} }
void* BufferBlob::operator new(size_t s, unsigned size) { void* BufferBlob::operator new(size_t s, unsigned size) throw() {
void* p = CodeCache::allocate(size); void* p = CodeCache::allocate(size);
return p; return p;
} }
...@@ -347,14 +347,14 @@ RuntimeStub* RuntimeStub::new_runtime_stub(const char* stub_name, ...@@ -347,14 +347,14 @@ RuntimeStub* RuntimeStub::new_runtime_stub(const char* stub_name,
} }
void* RuntimeStub::operator new(size_t s, unsigned size) { void* RuntimeStub::operator new(size_t s, unsigned size) throw() {
void* p = CodeCache::allocate(size, true); void* p = CodeCache::allocate(size, true);
if (!p) fatal("Initial size of CodeCache is too small"); if (!p) fatal("Initial size of CodeCache is too small");
return p; return p;
} }
// operator new shared by all singletons: // operator new shared by all singletons:
void* SingletonBlob::operator new(size_t s, unsigned size) { void* SingletonBlob::operator new(size_t s, unsigned size) throw() {
void* p = CodeCache::allocate(size, true); void* p = CodeCache::allocate(size, true);
if (!p) fatal("Initial size of CodeCache is too small"); if (!p) fatal("Initial size of CodeCache is too small");
return p; return p;
......
/* /*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -209,7 +209,7 @@ class BufferBlob: public CodeBlob { ...@@ -209,7 +209,7 @@ class BufferBlob: public CodeBlob {
BufferBlob(const char* name, int size); BufferBlob(const char* name, int size);
BufferBlob(const char* name, int size, CodeBuffer* cb); BufferBlob(const char* name, int size, CodeBuffer* cb);
void* operator new(size_t s, unsigned size); void* operator new(size_t s, unsigned size) throw();
public: public:
// Creation // Creation
...@@ -283,7 +283,7 @@ class RuntimeStub: public CodeBlob { ...@@ -283,7 +283,7 @@ class RuntimeStub: public CodeBlob {
bool caller_must_gc_arguments bool caller_must_gc_arguments
); );
void* operator new(size_t s, unsigned size); void* operator new(size_t s, unsigned size) throw();
public: public:
// Creation // Creation
...@@ -321,7 +321,7 @@ class SingletonBlob: public CodeBlob { ...@@ -321,7 +321,7 @@ class SingletonBlob: public CodeBlob {
friend class VMStructs; friend class VMStructs;
protected: protected:
void* operator new(size_t s, unsigned size); void* operator new(size_t s, unsigned size) throw();
public: public:
SingletonBlob( SingletonBlob(
......
/* /*
* Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -38,7 +38,7 @@ class DIR_Chunk { ...@@ -38,7 +38,7 @@ class DIR_Chunk {
int _length; // number of bytes in the stream int _length; // number of bytes in the stream
int _hash; // hash of stream bytes (for quicker reuse) int _hash; // hash of stream bytes (for quicker reuse)
void* operator new(size_t ignore, DebugInformationRecorder* dir) { void* operator new(size_t ignore, DebugInformationRecorder* dir) throw() {
assert(ignore == sizeof(DIR_Chunk), ""); assert(ignore == sizeof(DIR_Chunk), "");
if (dir->_next_chunk >= dir->_next_chunk_limit) { if (dir->_next_chunk >= dir->_next_chunk_limit) {
const int CHUNK = 100; const int CHUNK = 100;
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -800,7 +800,7 @@ nmethod::nmethod( ...@@ -800,7 +800,7 @@ nmethod::nmethod(
} }
#endif // def HAVE_DTRACE_H #endif // def HAVE_DTRACE_H
void* nmethod::operator new(size_t size, int nmethod_size) throw () { void* nmethod::operator new(size_t size, int nmethod_size) throw() {
// Not critical, may return null if there is too little continuous memory // Not critical, may return null if there is too little continuous memory
return CodeCache::allocate(nmethod_size); return CodeCache::allocate(nmethod_size);
} }
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -265,7 +265,7 @@ class nmethod : public CodeBlob { ...@@ -265,7 +265,7 @@ class nmethod : public CodeBlob {
int comp_level); int comp_level);
// helper methods // helper methods
void* operator new(size_t size, int nmethod_size); void* operator new(size_t size, int nmethod_size) throw();
const char* reloc_string_for(u_char* begin, u_char* end); const char* reloc_string_for(u_char* begin, u_char* end);
// Returns true if this thread changed the state of the nmethod or // Returns true if this thread changed the state of the nmethod or
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -677,7 +677,7 @@ class Relocation VALUE_OBJ_CLASS_SPEC { ...@@ -677,7 +677,7 @@ class Relocation VALUE_OBJ_CLASS_SPEC {
} }
public: public:
void* operator new(size_t size, const RelocationHolder& holder) { void* operator new(size_t size, const RelocationHolder& holder) throw() {
if (size > sizeof(holder._relocbuf)) guarantee_size(); if (size > sizeof(holder._relocbuf)) guarantee_size();
assert((void* const *)holder.reloc() == &holder._relocbuf[0], "ptrs must agree"); assert((void* const *)holder.reloc() == &holder._relocbuf[0], "ptrs must agree");
return holder.reloc(); return holder.reloc();
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -49,7 +49,7 @@ VMReg VtableStub::_receiver_location = VMRegImpl::Bad(); ...@@ -49,7 +49,7 @@ VMReg VtableStub::_receiver_location = VMRegImpl::Bad();
static int num_vtable_chunks = 0; static int num_vtable_chunks = 0;
void* VtableStub::operator new(size_t size, int code_size) { void* VtableStub::operator new(size_t size, int code_size) throw() {
assert(size == sizeof(VtableStub), "mismatched size"); assert(size == sizeof(VtableStub), "mismatched size");
num_vtable_chunks++; num_vtable_chunks++;
// compute real VtableStub size (rounded to nearest word) // compute real VtableStub size (rounded to nearest word)
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -46,7 +46,7 @@ class VtableStub { ...@@ -46,7 +46,7 @@ class VtableStub {
bool _is_vtable_stub; // True if vtable stub, false, is itable stub bool _is_vtable_stub; // True if vtable stub, false, is itable stub
/* code follows here */ // The vtableStub code /* code follows here */ // The vtableStub code
void* operator new(size_t size, int code_size); void* operator new(size_t size, int code_size) throw();
VtableStub(bool is_vtable_stub, int index) VtableStub(bool is_vtable_stub, int index)
: _next(NULL), _is_vtable_stub(is_vtable_stub), : _next(NULL), _is_vtable_stub(is_vtable_stub),
......
/* /*
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -144,9 +144,9 @@ class AdaptivePaddedAverage : public AdaptiveWeightedAverage { ...@@ -144,9 +144,9 @@ class AdaptivePaddedAverage : public AdaptiveWeightedAverage {
_padded_avg(0.0), _deviation(0.0), _padding(padding) {} _padded_avg(0.0), _deviation(0.0), _padding(padding) {}
// Placement support // Placement support
void* operator new(size_t ignored, void* p) { return p; } void* operator new(size_t ignored, void* p) throw() { return p; }
// Allocator // Allocator
void* operator new(size_t size) { return CHeapObj<mtGC>::operator new(size); } void* operator new(size_t size) throw() { return CHeapObj<mtGC>::operator new(size); }
// Accessor // Accessor
float padded_average() const { return _padded_avg; } float padded_average() const { return _padded_avg; }
......
/* /*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -163,7 +163,7 @@ extern void safe_free (const char *file, unsigned line, void *ptr); ...@@ -163,7 +163,7 @@ extern void safe_free (const char *file, unsigned line, void *ptr);
extern void *safe_calloc (const char *file, unsigned line, unsigned nitems, unsigned size); extern void *safe_calloc (const char *file, unsigned line, unsigned nitems, unsigned size);
extern void *safe_realloc(const char *file, unsigned line, void *ptr, unsigned size); extern void *safe_realloc(const char *file, unsigned line, void *ptr, unsigned size);
extern char *safe_strdup (const char *file, unsigned line, const char *src); extern char *safe_strdup (const char *file, unsigned line, const char *src);
inline void *operator new( size_t size ) { return malloc(size); } inline void *operator new( size_t size ) throw() { return malloc(size); }
inline void operator delete( void *ptr ) { free(ptr); } inline void operator delete( void *ptr ) { free(ptr); }
#endif #endif
......
...@@ -49,19 +49,19 @@ ...@@ -49,19 +49,19 @@
# include "os_bsd.inline.hpp" # include "os_bsd.inline.hpp"
#endif #endif
void* StackObj::operator new(size_t size) { ShouldNotCallThis(); return 0; } void* StackObj::operator new(size_t size) throw() { ShouldNotCallThis(); return 0; }
void StackObj::operator delete(void* p) { ShouldNotCallThis(); } void StackObj::operator delete(void* p) { ShouldNotCallThis(); }
void* StackObj::operator new [](size_t size) { ShouldNotCallThis(); return 0; } void* StackObj::operator new [](size_t size) throw() { ShouldNotCallThis(); return 0; }
void StackObj::operator delete [](void* p) { ShouldNotCallThis(); } void StackObj::operator delete [](void* p) { ShouldNotCallThis(); }
void* _ValueObj::operator new(size_t size) { ShouldNotCallThis(); return 0; } void* _ValueObj::operator new(size_t size) throw() { ShouldNotCallThis(); return 0; }
void _ValueObj::operator delete(void* p) { ShouldNotCallThis(); } void _ValueObj::operator delete(void* p) { ShouldNotCallThis(); }
void* _ValueObj::operator new [](size_t size) { ShouldNotCallThis(); return 0; } void* _ValueObj::operator new [](size_t size) throw() { ShouldNotCallThis(); return 0; }
void _ValueObj::operator delete [](void* p) { ShouldNotCallThis(); } void _ValueObj::operator delete [](void* p) { ShouldNotCallThis(); }
void* MetaspaceObj::operator new(size_t size, ClassLoaderData* loader_data, void* MetaspaceObj::operator new(size_t size, ClassLoaderData* loader_data,
size_t word_size, bool read_only, size_t word_size, bool read_only,
MetaspaceObj::Type type, TRAPS) { MetaspaceObj::Type type, TRAPS) throw() {
// Klass has it's own operator new // Klass has it's own operator new
return Metaspace::allocate(loader_data, word_size, read_only, return Metaspace::allocate(loader_data, word_size, read_only,
type, CHECK_NULL); type, CHECK_NULL);
...@@ -80,7 +80,7 @@ void MetaspaceObj::print_address_on(outputStream* st) const { ...@@ -80,7 +80,7 @@ void MetaspaceObj::print_address_on(outputStream* st) const {
st->print(" {"INTPTR_FORMAT"}", this); st->print(" {"INTPTR_FORMAT"}", this);
} }
void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) { void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flags) throw() {
address res; address res;
switch (type) { switch (type) {
case C_HEAP: case C_HEAP:
...@@ -97,12 +97,12 @@ void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flag ...@@ -97,12 +97,12 @@ void* ResourceObj::operator new(size_t size, allocation_type type, MEMFLAGS flag
return res; return res;
} }
void* ResourceObj::operator new [](size_t size, allocation_type type, MEMFLAGS flags) { void* ResourceObj::operator new [](size_t size, allocation_type type, MEMFLAGS flags) throw() {
return (address) operator new(size, type, flags); return (address) operator new(size, type, flags);
} }
void* ResourceObj::operator new(size_t size, const std::nothrow_t& nothrow_constant, void* ResourceObj::operator new(size_t size, const std::nothrow_t& nothrow_constant,
allocation_type type, MEMFLAGS flags) { allocation_type type, MEMFLAGS flags) throw() {
//should only call this with std::nothrow, use other operator new() otherwise //should only call this with std::nothrow, use other operator new() otherwise
address res; address res;
switch (type) { switch (type) {
...@@ -121,7 +121,7 @@ void* ResourceObj::operator new(size_t size, const std::nothrow_t& nothrow_cons ...@@ -121,7 +121,7 @@ void* ResourceObj::operator new(size_t size, const std::nothrow_t& nothrow_cons
} }
void* ResourceObj::operator new [](size_t size, const std::nothrow_t& nothrow_constant, void* ResourceObj::operator new [](size_t size, const std::nothrow_t& nothrow_constant,
allocation_type type, MEMFLAGS flags) { allocation_type type, MEMFLAGS flags) throw() {
return (address)operator new(size, nothrow_constant, type, flags); return (address)operator new(size, nothrow_constant, type, flags);
} }
...@@ -370,7 +370,7 @@ class ChunkPoolCleaner : public PeriodicTask { ...@@ -370,7 +370,7 @@ class ChunkPoolCleaner : public PeriodicTask {
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
// Chunk implementation // Chunk implementation
void* Chunk::operator new (size_t requested_size, AllocFailType alloc_failmode, size_t length) { void* Chunk::operator new (size_t requested_size, AllocFailType alloc_failmode, size_t length) throw() {
// requested_size is equal to sizeof(Chunk) but in order for the arena // requested_size is equal to sizeof(Chunk) but in order for the arena
// allocations to come out aligned as expected the size must be aligned // allocations to come out aligned as expected the size must be aligned
// to expected arena alignment. // to expected arena alignment.
...@@ -478,18 +478,18 @@ Arena::~Arena() { ...@@ -478,18 +478,18 @@ Arena::~Arena() {
NOT_PRODUCT(Atomic::dec(&_instance_count);) NOT_PRODUCT(Atomic::dec(&_instance_count);)
} }
void* Arena::operator new(size_t size) { void* Arena::operator new(size_t size) throw() {
assert(false, "Use dynamic memory type binding"); assert(false, "Use dynamic memory type binding");
return NULL; return NULL;
} }
void* Arena::operator new (size_t size, const std::nothrow_t& nothrow_constant) { void* Arena::operator new (size_t size, const std::nothrow_t& nothrow_constant) throw() {
assert(false, "Use dynamic memory type binding"); assert(false, "Use dynamic memory type binding");
return NULL; return NULL;
} }
// dynamic memory type binding // dynamic memory type binding
void* Arena::operator new(size_t size, MEMFLAGS flags) { void* Arena::operator new(size_t size, MEMFLAGS flags) throw() {
#ifdef ASSERT #ifdef ASSERT
void* p = (void*)AllocateHeap(size, flags|otArena, CALLER_PC); void* p = (void*)AllocateHeap(size, flags|otArena, CALLER_PC);
if (PrintMallocFree) trace_heap_malloc(size, "Arena-new", p); if (PrintMallocFree) trace_heap_malloc(size, "Arena-new", p);
...@@ -499,7 +499,7 @@ void* Arena::operator new(size_t size, MEMFLAGS flags) { ...@@ -499,7 +499,7 @@ void* Arena::operator new(size_t size, MEMFLAGS flags) {
#endif #endif
} }
void* Arena::operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) { void* Arena::operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) throw() {
#ifdef ASSERT #ifdef ASSERT
void* p = os::malloc(size, flags|otArena, CALLER_PC); void* p = os::malloc(size, flags|otArena, CALLER_PC);
if (PrintMallocFree) trace_heap_malloc(size, "Arena-new", p); if (PrintMallocFree) trace_heap_malloc(size, "Arena-new", p);
...@@ -688,22 +688,22 @@ void* Arena::internal_malloc_4(size_t x) { ...@@ -688,22 +688,22 @@ void* Arena::internal_malloc_4(size_t x) {
// define ALLOW_OPERATOR_NEW_USAGE for platform on which global operator new allowed. // define ALLOW_OPERATOR_NEW_USAGE for platform on which global operator new allowed.
// //
#ifndef ALLOW_OPERATOR_NEW_USAGE #ifndef ALLOW_OPERATOR_NEW_USAGE
void* operator new(size_t size){ void* operator new(size_t size) throw() {
assert(false, "Should not call global operator new"); assert(false, "Should not call global operator new");
return 0; return 0;
} }
void* operator new [](size_t size){ void* operator new [](size_t size) throw() {
assert(false, "Should not call global operator new[]"); assert(false, "Should not call global operator new[]");
return 0; return 0;
} }
void* operator new(size_t size, const std::nothrow_t& nothrow_constant){ void* operator new(size_t size, const std::nothrow_t& nothrow_constant) throw() {
assert(false, "Should not call global operator new"); assert(false, "Should not call global operator new");
return 0; return 0;
} }
void* operator new [](size_t size, std::nothrow_t& nothrow_constant){ void* operator new [](size_t size, std::nothrow_t& nothrow_constant) throw() {
assert(false, "Should not call global operator new[]"); assert(false, "Should not call global operator new[]");
return 0; return 0;
} }
......
...@@ -204,12 +204,12 @@ const bool NMT_track_callsite = false; ...@@ -204,12 +204,12 @@ const bool NMT_track_callsite = false;
template <MEMFLAGS F> class CHeapObj ALLOCATION_SUPER_CLASS_SPEC { template <MEMFLAGS F> class CHeapObj ALLOCATION_SUPER_CLASS_SPEC {
public: public:
_NOINLINE_ void* operator new(size_t size, address caller_pc = 0); _NOINLINE_ void* operator new(size_t size, address caller_pc = 0) throw();
_NOINLINE_ void* operator new (size_t size, const std::nothrow_t& nothrow_constant, _NOINLINE_ void* operator new (size_t size, const std::nothrow_t& nothrow_constant,
address caller_pc = 0); address caller_pc = 0) throw();
_NOINLINE_ void* operator new [](size_t size, address caller_pc = 0); _NOINLINE_ void* operator new [](size_t size, address caller_pc = 0) throw();
_NOINLINE_ void* operator new [](size_t size, const std::nothrow_t& nothrow_constant, _NOINLINE_ void* operator new [](size_t size, const std::nothrow_t& nothrow_constant,
address caller_pc = 0); address caller_pc = 0) throw();
void operator delete(void* p); void operator delete(void* p);
void operator delete [] (void* p); void operator delete [] (void* p);
}; };
...@@ -219,9 +219,9 @@ template <MEMFLAGS F> class CHeapObj ALLOCATION_SUPER_CLASS_SPEC { ...@@ -219,9 +219,9 @@ template <MEMFLAGS F> class CHeapObj ALLOCATION_SUPER_CLASS_SPEC {
class StackObj ALLOCATION_SUPER_CLASS_SPEC { class StackObj ALLOCATION_SUPER_CLASS_SPEC {
private: private:
void* operator new(size_t size); void* operator new(size_t size) throw();
void operator delete(void* p); void operator delete(void* p);
void* operator new [](size_t size); void* operator new [](size_t size) throw();
void operator delete [](void* p); void operator delete [](void* p);
}; };
...@@ -245,9 +245,9 @@ class StackObj ALLOCATION_SUPER_CLASS_SPEC { ...@@ -245,9 +245,9 @@ class StackObj ALLOCATION_SUPER_CLASS_SPEC {
// //
class _ValueObj { class _ValueObj {
private: private:
void* operator new(size_t size); void* operator new(size_t size) throw();
void operator delete(void* p); void operator delete(void* p);
void* operator new [](size_t size); void* operator new [](size_t size) throw();
void operator delete [](void* p); void operator delete [](void* p);
}; };
...@@ -316,7 +316,7 @@ class MetaspaceObj { ...@@ -316,7 +316,7 @@ class MetaspaceObj {
void* operator new(size_t size, ClassLoaderData* loader_data, void* operator new(size_t size, ClassLoaderData* loader_data,
size_t word_size, bool read_only, size_t word_size, bool read_only,
Type type, Thread* thread); Type type, Thread* thread) throw();
// can't use TRAPS from this header file. // can't use TRAPS from this header file.
void operator delete(void* p) { ShouldNotCallThis(); } void operator delete(void* p) { ShouldNotCallThis(); }
}; };
...@@ -339,7 +339,7 @@ class Chunk: CHeapObj<mtChunk> { ...@@ -339,7 +339,7 @@ class Chunk: CHeapObj<mtChunk> {
Chunk* _next; // Next Chunk in list Chunk* _next; // Next Chunk in list
const size_t _len; // Size of this Chunk const size_t _len; // Size of this Chunk
public: public:
void* operator new(size_t size, AllocFailType alloc_failmode, size_t length); void* operator new(size_t size, AllocFailType alloc_failmode, size_t length) throw();
void operator delete(void* p); void operator delete(void* p);
Chunk(size_t length); Chunk(size_t length);
...@@ -422,12 +422,12 @@ protected: ...@@ -422,12 +422,12 @@ protected:
char* hwm() const { return _hwm; } char* hwm() const { return _hwm; }
// new operators // new operators
void* operator new (size_t size); void* operator new (size_t size) throw();
void* operator new (size_t size, const std::nothrow_t& nothrow_constant); void* operator new (size_t size, const std::nothrow_t& nothrow_constant) throw();
// dynamic memory type tagging // dynamic memory type tagging
void* operator new(size_t size, MEMFLAGS flags); void* operator new(size_t size, MEMFLAGS flags) throw();
void* operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags); void* operator new(size_t size, const std::nothrow_t& nothrow_constant, MEMFLAGS flags) throw();
void operator delete(void* p); void operator delete(void* p);
// Fast allocate in the arena. Common case is: pointer test + increment. // Fast allocate in the arena. Common case is: pointer test + increment.
...@@ -583,44 +583,44 @@ class ResourceObj ALLOCATION_SUPER_CLASS_SPEC { ...@@ -583,44 +583,44 @@ class ResourceObj ALLOCATION_SUPER_CLASS_SPEC {
#endif // ASSERT #endif // ASSERT
public: public:
void* operator new(size_t size, allocation_type type, MEMFLAGS flags); void* operator new(size_t size, allocation_type type, MEMFLAGS flags) throw();
void* operator new [](size_t size, allocation_type type, MEMFLAGS flags); void* operator new [](size_t size, allocation_type type, MEMFLAGS flags) throw();
void* operator new(size_t size, const std::nothrow_t& nothrow_constant, void* operator new(size_t size, const std::nothrow_t& nothrow_constant,
allocation_type type, MEMFLAGS flags); allocation_type type, MEMFLAGS flags) throw();
void* operator new [](size_t size, const std::nothrow_t& nothrow_constant, void* operator new [](size_t size, const std::nothrow_t& nothrow_constant,
allocation_type type, MEMFLAGS flags); allocation_type type, MEMFLAGS flags) throw();
void* operator new(size_t size, Arena *arena) { void* operator new(size_t size, Arena *arena) throw() {
address res = (address)arena->Amalloc(size); address res = (address)arena->Amalloc(size);
DEBUG_ONLY(set_allocation_type(res, ARENA);) DEBUG_ONLY(set_allocation_type(res, ARENA);)
return res; return res;
} }
void* operator new [](size_t size, Arena *arena) { void* operator new [](size_t size, Arena *arena) throw() {
address res = (address)arena->Amalloc(size); address res = (address)arena->Amalloc(size);
DEBUG_ONLY(set_allocation_type(res, ARENA);) DEBUG_ONLY(set_allocation_type(res, ARENA);)
return res; return res;
} }
void* operator new(size_t size) { void* operator new(size_t size) throw() {
address res = (address)resource_allocate_bytes(size); address res = (address)resource_allocate_bytes(size);
DEBUG_ONLY(set_allocation_type(res, RESOURCE_AREA);) DEBUG_ONLY(set_allocation_type(res, RESOURCE_AREA);)
return res; return res;
} }
void* operator new(size_t size, const std::nothrow_t& nothrow_constant) { void* operator new(size_t size, const std::nothrow_t& nothrow_constant) throw() {
address res = (address)resource_allocate_bytes(size, AllocFailStrategy::RETURN_NULL); address res = (address)resource_allocate_bytes(size, AllocFailStrategy::RETURN_NULL);
DEBUG_ONLY(if (res != NULL) set_allocation_type(res, RESOURCE_AREA);) DEBUG_ONLY(if (res != NULL) set_allocation_type(res, RESOURCE_AREA);)
return res; return res;
} }
void* operator new [](size_t size) { void* operator new [](size_t size) throw() {
address res = (address)resource_allocate_bytes(size); address res = (address)resource_allocate_bytes(size);
DEBUG_ONLY(set_allocation_type(res, RESOURCE_AREA);) DEBUG_ONLY(set_allocation_type(res, RESOURCE_AREA);)
return res; return res;
} }
void* operator new [](size_t size, const std::nothrow_t& nothrow_constant) { void* operator new [](size_t size, const std::nothrow_t& nothrow_constant) throw() {
address res = (address)resource_allocate_bytes(size, AllocFailStrategy::RETURN_NULL); address res = (address)resource_allocate_bytes(size, AllocFailStrategy::RETURN_NULL);
DEBUG_ONLY(if (res != NULL) set_allocation_type(res, RESOURCE_AREA);) DEBUG_ONLY(if (res != NULL) set_allocation_type(res, RESOURCE_AREA);)
return res; return res;
......
...@@ -85,7 +85,7 @@ inline void FreeHeap(void* p, MEMFLAGS memflags = mtInternal) { ...@@ -85,7 +85,7 @@ inline void FreeHeap(void* p, MEMFLAGS memflags = mtInternal) {
template <MEMFLAGS F> void* CHeapObj<F>::operator new(size_t size, template <MEMFLAGS F> void* CHeapObj<F>::operator new(size_t size,
address caller_pc){ address caller_pc) throw() {
void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC)); void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC));
#ifdef ASSERT #ifdef ASSERT
if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p); if (PrintMallocFree) trace_heap_malloc(size, "CHeapObj-new", p);
...@@ -94,7 +94,7 @@ template <MEMFLAGS F> void* CHeapObj<F>::operator new(size_t size, ...@@ -94,7 +94,7 @@ template <MEMFLAGS F> void* CHeapObj<F>::operator new(size_t size,
} }
template <MEMFLAGS F> void* CHeapObj<F>::operator new (size_t size, template <MEMFLAGS F> void* CHeapObj<F>::operator new (size_t size,
const std::nothrow_t& nothrow_constant, address caller_pc) { const std::nothrow_t& nothrow_constant, address caller_pc) throw() {
void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC), void* p = (void*)AllocateHeap(size, F, (caller_pc != 0 ? caller_pc : CALLER_PC),
AllocFailStrategy::RETURN_NULL); AllocFailStrategy::RETURN_NULL);
#ifdef ASSERT #ifdef ASSERT
...@@ -104,12 +104,12 @@ template <MEMFLAGS F> void* CHeapObj<F>::operator new (size_t size, ...@@ -104,12 +104,12 @@ template <MEMFLAGS F> void* CHeapObj<F>::operator new (size_t size,
} }
template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size, template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size,
address caller_pc){ address caller_pc) throw() {
return CHeapObj<F>::operator new(size, caller_pc); return CHeapObj<F>::operator new(size, caller_pc);
} }
template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size, template <MEMFLAGS F> void* CHeapObj<F>::operator new [](size_t size,
const std::nothrow_t& nothrow_constant, address caller_pc) { const std::nothrow_t& nothrow_constant, address caller_pc) throw() {
return CHeapObj<F>::operator new(size, nothrow_constant, caller_pc); return CHeapObj<F>::operator new(size, nothrow_constant, caller_pc);
} }
......
/* /*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -102,11 +102,11 @@ MemRegion MemRegion::minus(const MemRegion mr2) const { ...@@ -102,11 +102,11 @@ MemRegion MemRegion::minus(const MemRegion mr2) const {
return MemRegion(); return MemRegion();
} }
void* MemRegion::operator new(size_t size) { void* MemRegion::operator new(size_t size) throw() {
return (address)AllocateHeap(size, mtGC, 0, AllocFailStrategy::RETURN_NULL); return (address)AllocateHeap(size, mtGC, 0, AllocFailStrategy::RETURN_NULL);
} }
void* MemRegion::operator new [](size_t size) { void* MemRegion::operator new [](size_t size) throw() {
return (address)AllocateHeap(size, mtGC, 0, AllocFailStrategy::RETURN_NULL); return (address)AllocateHeap(size, mtGC, 0, AllocFailStrategy::RETURN_NULL);
} }
void MemRegion::operator delete(void* p) { void MemRegion::operator delete(void* p) {
......
/* /*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -94,8 +94,8 @@ public: ...@@ -94,8 +94,8 @@ public:
size_t word_size() const { return _word_size; } size_t word_size() const { return _word_size; }
bool is_empty() const { return word_size() == 0; } bool is_empty() const { return word_size() == 0; }
void* operator new(size_t size); void* operator new(size_t size) throw();
void* operator new [](size_t size); void* operator new [](size_t size) throw();
void operator delete(void* p); void operator delete(void* p);
void operator delete [](void* p); void operator delete [](void* p);
}; };
...@@ -111,13 +111,13 @@ public: ...@@ -111,13 +111,13 @@ public:
class MemRegionClosureRO: public MemRegionClosure { class MemRegionClosureRO: public MemRegionClosure {
public: public:
void* operator new(size_t size, ResourceObj::allocation_type type, MEMFLAGS flags) { void* operator new(size_t size, ResourceObj::allocation_type type, MEMFLAGS flags) throw() {
return ResourceObj::operator new(size, type, flags); return ResourceObj::operator new(size, type, flags);
} }
void* operator new(size_t size, Arena *arena) { void* operator new(size_t size, Arena *arena) throw() {
return ResourceObj::operator new(size, arena); return ResourceObj::operator new(size, arena);
} }
void* operator new(size_t size) { void* operator new(size_t size) throw() {
return ResourceObj::operator new(size); return ResourceObj::operator new(size);
} }
......
...@@ -139,7 +139,7 @@ Method* Klass::uncached_lookup_method(Symbol* name, Symbol* signature) const { ...@@ -139,7 +139,7 @@ Method* Klass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
return NULL; return NULL;
} }
void* Klass::operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) { void* Klass::operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) throw() {
return Metaspace::allocate(loader_data, word_size, /*read_only*/false, return Metaspace::allocate(loader_data, word_size, /*read_only*/false,
MetaspaceObj::ClassType, CHECK_NULL); MetaspaceObj::ClassType, CHECK_NULL);
} }
......
...@@ -179,7 +179,7 @@ class Klass : public Metadata { ...@@ -179,7 +179,7 @@ class Klass : public Metadata {
// Constructor // Constructor
Klass(); Klass();
void* operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS); void* operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) throw();
public: public:
bool is_klass() const volatile { return true; } bool is_klass() const volatile { return true; }
......
...@@ -41,19 +41,19 @@ Symbol::Symbol(const u1* name, int length, int refcount) { ...@@ -41,19 +41,19 @@ Symbol::Symbol(const u1* name, int length, int refcount) {
} }
} }
void* Symbol::operator new(size_t sz, int len, TRAPS) { void* Symbol::operator new(size_t sz, int len, TRAPS) throw() {
int alloc_size = size(len)*HeapWordSize; int alloc_size = size(len)*HeapWordSize;
address res = (address) AllocateHeap(alloc_size, mtSymbol); address res = (address) AllocateHeap(alloc_size, mtSymbol);
return res; return res;
} }
void* Symbol::operator new(size_t sz, int len, Arena* arena, TRAPS) { void* Symbol::operator new(size_t sz, int len, Arena* arena, TRAPS) throw() {
int alloc_size = size(len)*HeapWordSize; int alloc_size = size(len)*HeapWordSize;
address res = (address)arena->Amalloc(alloc_size); address res = (address)arena->Amalloc(alloc_size);
return res; return res;
} }
void* Symbol::operator new(size_t sz, int len, ClassLoaderData* loader_data, TRAPS) { void* Symbol::operator new(size_t sz, int len, ClassLoaderData* loader_data, TRAPS) throw() {
address res; address res;
int alloc_size = size(len)*HeapWordSize; int alloc_size = size(len)*HeapWordSize;
res = (address) Metaspace::allocate(loader_data, size(len), true, res = (address) Metaspace::allocate(loader_data, size(len), true,
......
...@@ -136,9 +136,9 @@ class Symbol : private SymbolBase { ...@@ -136,9 +136,9 @@ class Symbol : private SymbolBase {
} }
Symbol(const u1* name, int length, int refcount); Symbol(const u1* name, int length, int refcount);
void* operator new(size_t size, int len, TRAPS); void* operator new(size_t size, int len, TRAPS) throw();
void* operator new(size_t size, int len, Arena* arena, TRAPS); void* operator new(size_t size, int len, Arena* arena, TRAPS) throw();
void* operator new(size_t size, int len, ClassLoaderData* loader_data, TRAPS); void* operator new(size_t size, int len, ClassLoaderData* loader_data, TRAPS) throw();
void operator delete(void* p); void operator delete(void* p);
......
/* /*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -260,7 +260,7 @@ class WarmCallInfo : public ResourceObj { ...@@ -260,7 +260,7 @@ class WarmCallInfo : public ResourceObj {
// Because WarmInfo objects live over the entire lifetime of the // Because WarmInfo objects live over the entire lifetime of the
// Compile object, they are allocated into the comp_arena, which // Compile object, they are allocated into the comp_arena, which
// does not get resource marked or reset during the compile process // does not get resource marked or reset during the compile process
void *operator new( size_t x, Compile* C ) { return C->comp_arena()->Amalloc(x); } void *operator new( size_t x, Compile* C ) throw() { return C->comp_arena()->Amalloc(x); }
void operator delete( void * ) { } // fast deallocation void operator delete( void * ) { } // fast deallocation
static WarmCallInfo* always_hot(); static WarmCallInfo* always_hot();
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -216,7 +216,7 @@ public: ...@@ -216,7 +216,7 @@ public:
// Because JVMState objects live over the entire lifetime of the // Because JVMState objects live over the entire lifetime of the
// Compile object, they are allocated into the comp_arena, which // Compile object, they are allocated into the comp_arena, which
// does not get resource marked or reset during the compile process // does not get resource marked or reset during the compile process
void *operator new( size_t x, Compile* C ) { return C->comp_arena()->Amalloc(x); } void *operator new( size_t x, Compile* C ) throw() { return C->comp_arena()->Amalloc(x); }
void operator delete( void * ) { } // fast deallocation void operator delete( void * ) { } // fast deallocation
// Create a new JVMState, ready for abstract interpretation. // Create a new JVMState, ready for abstract interpretation.
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -58,7 +58,7 @@ class State; ...@@ -58,7 +58,7 @@ class State;
class MachOper : public ResourceObj { class MachOper : public ResourceObj {
public: public:
// Allocate right next to the MachNodes in the same arena // Allocate right next to the MachNodes in the same arena
void *operator new( size_t x, Compile* C ) { return C->node_arena()->Amalloc_D(x); } void *operator new( size_t x, Compile* C ) throw() { return C->node_arena()->Amalloc_D(x); }
// Opcode // Opcode
virtual uint opcode() const = 0; virtual uint opcode() const = 0;
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -211,7 +211,7 @@ public: ...@@ -211,7 +211,7 @@ public:
// New Operator that takes a Compile pointer, this will eventually // New Operator that takes a Compile pointer, this will eventually
// be the "new" New operator. // be the "new" New operator.
inline void* operator new( size_t x, Compile* C) { inline void* operator new( size_t x, Compile* C) throw() {
Node* n = (Node*)C->node_arena()->Amalloc_D(x); Node* n = (Node*)C->node_arena()->Amalloc_D(x);
#ifdef ASSERT #ifdef ASSERT
n->_in = (Node**)n; // magic cookie for assertion check n->_in = (Node**)n; // magic cookie for assertion check
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -169,7 +169,7 @@ protected: ...@@ -169,7 +169,7 @@ protected:
public: public:
inline void* operator new( size_t x ) { inline void* operator new( size_t x ) throw() {
Compile* compile = Compile::current(); Compile* compile = Compile::current();
compile->set_type_last_size(x); compile->set_type_last_size(x);
void *temp = compile->type_arena()->Amalloc_D(x); void *temp = compile->type_arena()->Amalloc_D(x);
......
...@@ -264,7 +264,7 @@ class ProfilerNode { ...@@ -264,7 +264,7 @@ class ProfilerNode {
public: public:
void* operator new(size_t size, ThreadProfiler* tp); void* operator new(size_t size, ThreadProfiler* tp) throw();
void operator delete(void* p); void operator delete(void* p);
ProfilerNode() { ProfilerNode() {
...@@ -373,7 +373,7 @@ class ProfilerNode { ...@@ -373,7 +373,7 @@ class ProfilerNode {
} }
}; };
void* ProfilerNode::operator new(size_t size, ThreadProfiler* tp){ void* ProfilerNode::operator new(size_t size, ThreadProfiler* tp) throw() {
void* result = (void*) tp->area_top; void* result = (void*) tp->area_top;
tp->area_top += size; tp->area_top += size;
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -179,11 +179,11 @@ HandleMark::~HandleMark() { ...@@ -179,11 +179,11 @@ HandleMark::~HandleMark() {
_thread->set_last_handle_mark(previous_handle_mark()); _thread->set_last_handle_mark(previous_handle_mark());
} }
void* HandleMark::operator new(size_t size) { void* HandleMark::operator new(size_t size) throw() {
return AllocateHeap(size, mtThread); return AllocateHeap(size, mtThread);
} }
void* HandleMark::operator new [] (size_t size) { void* HandleMark::operator new [] (size_t size) throw() {
return AllocateHeap(size, mtThread); return AllocateHeap(size, mtThread);
} }
......
...@@ -309,8 +309,8 @@ class HandleMark { ...@@ -309,8 +309,8 @@ class HandleMark {
// called in the destructor of HandleMarkCleaner // called in the destructor of HandleMarkCleaner
void pop_and_restore(); void pop_and_restore();
// overloaded operators // overloaded operators
void* operator new(size_t size); void* operator new(size_t size) throw();
void* operator new [](size_t size); void* operator new [](size_t size) throw();
void operator delete(void* p); void operator delete(void* p);
void operator delete[](void* p); void operator delete[](void* p);
}; };
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -56,7 +56,7 @@ class HandleMarkCleaner: public StackObj { ...@@ -56,7 +56,7 @@ class HandleMarkCleaner: public StackObj {
} }
private: private:
inline void* operator new(size_t size, void* ptr) { inline void* operator new(size_t size, void* ptr) throw() {
return ptr; return ptr;
} }
}; };
......
...@@ -312,10 +312,10 @@ public: ...@@ -312,10 +312,10 @@ public:
public: public:
static int Knob_Verbose; static int Knob_Verbose;
static int Knob_SpinLimit; static int Knob_SpinLimit;
void* operator new (size_t size) { void* operator new (size_t size) throw() {
return AllocateHeap(size, mtInternal); return AllocateHeap(size, mtInternal);
} }
void* operator new[] (size_t size) { void* operator new[] (size_t size) throw() {
return operator new (size); return operator new (size);
} }
void operator delete(void* p) { void operator delete(void* p) {
......
/* /*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -140,7 +140,7 @@ void ParkEvent::Release (ParkEvent * ev) { ...@@ -140,7 +140,7 @@ void ParkEvent::Release (ParkEvent * ev) {
// well as bank access imbalance on Niagara-like platforms, // well as bank access imbalance on Niagara-like platforms,
// although Niagara's hash function should help. // although Niagara's hash function should help.
void * ParkEvent::operator new (size_t sz) { void * ParkEvent::operator new (size_t sz) throw() {
return (void *) ((intptr_t (AllocateHeap(sz + 256, mtInternal, CALLER_PC)) + 256) & -256) ; return (void *) ((intptr_t (AllocateHeap(sz + 256, mtInternal, CALLER_PC)) + 256) & -256) ;
} }
......
/* /*
* Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -166,7 +166,7 @@ class ParkEvent : public os::PlatformEvent { ...@@ -166,7 +166,7 @@ class ParkEvent : public os::PlatformEvent {
// aligned on 256-byte address boundaries. This ensures that the least // aligned on 256-byte address boundaries. This ensures that the least
// significant byte of a ParkEvent address is always 0. // significant byte of a ParkEvent address is always 0.
void * operator new (size_t sz) ; void * operator new (size_t sz) throw();
void operator delete (void * a) ; void operator delete (void * a) ;
public: public:
......
...@@ -113,8 +113,9 @@ class Thread: public ThreadShadow { ...@@ -113,8 +113,9 @@ class Thread: public ThreadShadow {
// Support for forcing alignment of thread objects for biased locking // Support for forcing alignment of thread objects for biased locking
void* _real_malloc_address; void* _real_malloc_address;
public: public:
void* operator new(size_t size) { return allocate(size, true); } void* operator new(size_t size) throw() { return allocate(size, true); }
void* operator new(size_t size, const std::nothrow_t& nothrow_constant) { return allocate(size, false); } void* operator new(size_t size, const std::nothrow_t& nothrow_constant) throw() {
return allocate(size, false); }
void operator delete(void* p); void operator delete(void* p);
protected: protected:
......
...@@ -53,13 +53,13 @@ template <class E, int SIZE> class FixedSizeMemPointerArray : ...@@ -53,13 +53,13 @@ template <class E, int SIZE> class FixedSizeMemPointerArray :
} }
} }
void* operator new(size_t size, const std::nothrow_t& nothrow_constant) { void* operator new(size_t size, const std::nothrow_t& nothrow_constant) throw() {
// the instance is part of memRecorder, needs to be tagged with 'otNMTRecorder' // the instance is part of memRecorder, needs to be tagged with 'otNMTRecorder'
// to avoid recursion // to avoid recursion
return os::malloc(size, (mtNMT | otNMTRecorder)); return os::malloc(size, (mtNMT | otNMTRecorder));
} }
void* operator new(size_t size) { void* operator new(size_t size) throw() {
assert(false, "use nothrow version"); assert(false, "use nothrow version");
return NULL; return NULL;
} }
......
/* /*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -63,12 +63,12 @@ MemTrackWorker::~MemTrackWorker() { ...@@ -63,12 +63,12 @@ MemTrackWorker::~MemTrackWorker() {
} }
} }
void* MemTrackWorker::operator new(size_t size) { void* MemTrackWorker::operator new(size_t size) throw() {
assert(false, "use nothrow version"); assert(false, "use nothrow version");
return NULL; return NULL;
} }
void* MemTrackWorker::operator new(size_t size, const std::nothrow_t& nothrow_constant) { void* MemTrackWorker::operator new(size_t size, const std::nothrow_t& nothrow_constant) throw() {
return allocate(size, false, mtNMT); return allocate(size, false, mtNMT);
} }
......
/* /*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -90,8 +90,8 @@ class MemTrackWorker : public NamedThread { ...@@ -90,8 +90,8 @@ class MemTrackWorker : public NamedThread {
public: public:
MemTrackWorker(MemSnapshot* snapshot); MemTrackWorker(MemSnapshot* snapshot);
~MemTrackWorker(); ~MemTrackWorker();
_NOINLINE_ void* operator new(size_t size); _NOINLINE_ void* operator new(size_t size) throw();
_NOINLINE_ void* operator new(size_t size, const std::nothrow_t& nothrow_constant); _NOINLINE_ void* operator new(size_t size, const std::nothrow_t& nothrow_constant) throw();
void start(); void start();
void run(); void run();
......
...@@ -317,7 +317,7 @@ protected: ...@@ -317,7 +317,7 @@ protected:
Array(const Array<T>&); Array(const Array<T>&);
void operator=(const Array<T>&); void operator=(const Array<T>&);
void* operator new(size_t size, ClassLoaderData* loader_data, int length, bool read_only, TRAPS) { void* operator new(size_t size, ClassLoaderData* loader_data, int length, bool read_only, TRAPS) throw() {
size_t word_size = Array::size(length); size_t word_size = Array::size(length);
return (void*) Metaspace::allocate(loader_data, word_size, read_only, return (void*) Metaspace::allocate(loader_data, word_size, read_only,
MetaspaceObj::array_type(sizeof(T)), CHECK_NULL); MetaspaceObj::array_type(sizeof(T)), CHECK_NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册