This commit is contained in:
Coleen Phillimore 2014-07-14 10:15:21 -04:00
commit c9b2bc62c9
2991 changed files with 67823 additions and 46239 deletions

View file

@ -416,9 +416,18 @@ IRT_ENTRY(address, InterpreterRuntime::exception_handler_for_exception(JavaThrea
// tracing
if (TraceExceptions) {
ttyLocker ttyl;
ResourceMark rm(thread);
tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")", h_exception->print_value_string(), (address)h_exception());
Symbol* message = java_lang_Throwable::detail_message(h_exception());
ttyLocker ttyl; // Lock after getting the detail message
if (message != NULL) {
tty->print_cr("Exception <%s: %s> (" INTPTR_FORMAT ")",
h_exception->print_value_string(), message->as_C_string(),
(address)h_exception());
} else {
tty->print_cr("Exception <%s> (" INTPTR_FORMAT ")",
h_exception->print_value_string(),
(address)h_exception());
}
tty->print_cr(" thrown in interpreter method <%s>", h_method->print_value_string());
tty->print_cr(" at bci %d for thread " INTPTR_FORMAT, current_bci, thread);
}
@ -1079,6 +1088,7 @@ IRT_END
address SignatureHandlerLibrary::set_handler_blob() {
BufferBlob* handler_blob = BufferBlob::create("native signature handlers", blob_size);
if (handler_blob == NULL) {
CompileBroker::handle_full_code_cache();
return NULL;
}
address handler = handler_blob->code_begin();

View file

@ -180,7 +180,7 @@ InterpreterOopMap::~InterpreterOopMap() {
}
}
bool InterpreterOopMap::is_empty() {
bool InterpreterOopMap::is_empty() const {
bool result = _method == NULL;
assert(_method != NULL || (_bci == 0 &&
(_mask_size == 0 || _mask_size == USHRT_MAX) &&
@ -196,7 +196,7 @@ void InterpreterOopMap::initialize() {
for (int i = 0; i < N; i++) _bit_mask[i] = 0;
}
void InterpreterOopMap::iterate_oop(OffsetClosure* oop_closure) {
void InterpreterOopMap::iterate_oop(OffsetClosure* oop_closure) const {
int n = number_of_entries();
int word_index = 0;
uintptr_t value = 0;
@ -238,16 +238,14 @@ void InterpreterOopMap::iterate_all(OffsetClosure* oop_closure, OffsetClosure* v
#endif
void InterpreterOopMap::print() {
void InterpreterOopMap::print() const {
int n = number_of_entries();
tty->print("oop map for ");
method()->print_value();
tty->print(" @ %d = [%d] { ", bci(), n);
for (int i = 0; i < n; i++) {
#ifdef ENABLE_ZAP_DEAD_LOCALS
if (is_dead(i)) tty->print("%d+ ", i);
else
#endif
if (is_oop(i)) tty->print("%d ", i);
}
tty->print_cr("}");
@ -402,13 +400,11 @@ void OopMapCacheEntry::set_mask(CellTypeState *vars, CellTypeState *stack, int s
value |= (mask << oop_bit_number );
}
#ifdef ENABLE_ZAP_DEAD_LOCALS
// set dead bit
if (!cell->is_live()) {
value |= (mask << dead_bit_number);
assert(!cell->is_reference(), "dead value marked as oop");
}
#endif
}
// make sure last word is stored
@ -469,7 +465,7 @@ void InterpreterOopMap::resource_copy(OopMapCacheEntry* from) {
}
}
inline unsigned int OopMapCache::hash_value_for(methodHandle method, int bci) {
inline unsigned int OopMapCache::hash_value_for(methodHandle method, int bci) const {
// We use method->code_size() rather than method->identity_hash() below since
// the mark may not be present if a pointer to the method is already reversed.
return ((unsigned int) bci)
@ -522,7 +518,7 @@ void OopMapCache::flush_obsolete_entries() {
void OopMapCache::lookup(methodHandle method,
int bci,
InterpreterOopMap* entry_for) {
InterpreterOopMap* entry_for) const {
MutexLocker x(&_mut);
OopMapCacheEntry* entry = NULL;

View file

@ -66,19 +66,15 @@ class InterpreterOopMap: ResourceObj {
public:
enum {
N = 2, // the number of words reserved
N = 4, // the number of words reserved
// for inlined mask storage
small_mask_limit = N * BitsPerWord, // the maximum number of bits
// available for small masks,
// small_mask_limit can be set to 0
// for testing bit_mask allocation
#ifdef ENABLE_ZAP_DEAD_LOCALS
bits_per_entry = 2,
dead_bit_number = 1,
#else
bits_per_entry = 1,
#endif
oop_bit_number = 0
};
@ -101,32 +97,27 @@ class InterpreterOopMap: ResourceObj {
// access methods
Method* method() const { return _method; }
void set_method(Method* v) { _method = v; }
void set_method(Method* v) { _method = v; }
int bci() const { return _bci; }
void set_bci(int v) { _bci = v; }
int mask_size() const { return _mask_size; }
void set_mask_size(int v) { _mask_size = v; }
int number_of_entries() const { return mask_size() / bits_per_entry; }
// Test bit mask size and return either the in-line bit mask or allocated
// bit mask.
uintptr_t* bit_mask() { return (uintptr_t*)(mask_size() <= small_mask_limit ? (intptr_t)_bit_mask : _bit_mask[0]); }
uintptr_t* bit_mask() const { return (uintptr_t*)(mask_size() <= small_mask_limit ? (intptr_t)_bit_mask : _bit_mask[0]); }
// return the word size of_bit_mask. mask_size() <= 4 * MAX_USHORT
size_t mask_word_size() {
size_t mask_word_size() const {
return (mask_size() + BitsPerWord - 1) / BitsPerWord;
}
uintptr_t entry_at(int offset) { int i = offset * bits_per_entry; return bit_mask()[i / BitsPerWord] >> (i % BitsPerWord); }
uintptr_t entry_at(int offset) const { int i = offset * bits_per_entry; return bit_mask()[i / BitsPerWord] >> (i % BitsPerWord); }
void set_expression_stack_size(int sz) { _expression_stack_size = sz; }
#ifdef ENABLE_ZAP_DEAD_LOCALS
bool is_dead(int offset) { return (entry_at(offset) & (1 << dead_bit_number)) != 0; }
#endif
void set_expression_stack_size(int sz) { _expression_stack_size = sz; }
// Lookup
bool match(methodHandle method, int bci) { return _method == method() && _bci == bci; }
bool is_empty();
bool match(methodHandle method, int bci) const { return _method == method() && _bci == bci; }
bool is_empty() const;
// Initialization
void initialize();
@ -141,12 +132,14 @@ class InterpreterOopMap: ResourceObj {
// in-line), allocate the space from a Resource area.
void resource_copy(OopMapCacheEntry* from);
void iterate_oop(OffsetClosure* oop_closure);
void print();
void iterate_oop(OffsetClosure* oop_closure) const;
void print() const;
bool is_oop (int offset) { return (entry_at(offset) & (1 << oop_bit_number )) != 0; }
int number_of_entries() const { return mask_size() / bits_per_entry; }
bool is_dead(int offset) const { return (entry_at(offset) & (1 << dead_bit_number)) != 0; }
bool is_oop (int offset) const { return (entry_at(offset) & (1 << oop_bit_number )) != 0; }
int expression_stack_size() { return _expression_stack_size; }
int expression_stack_size() const { return _expression_stack_size; }
#ifdef ENABLE_ZAP_DEAD_LOCALS
void iterate_all(OffsetClosure* oop_closure, OffsetClosure* value_closure, OffsetClosure* dead_closure);
@ -161,10 +154,10 @@ class OopMapCache : public CHeapObj<mtClass> {
OopMapCacheEntry* _array;
unsigned int hash_value_for(methodHandle method, int bci);
unsigned int hash_value_for(methodHandle method, int bci) const;
OopMapCacheEntry* entry_at(int i) const;
Mutex _mut;
mutable Mutex _mut;
void flush();
@ -177,7 +170,7 @@ class OopMapCache : public CHeapObj<mtClass> {
// Returns the oopMap for (method, bci) in parameter "entry".
// Returns false if an oop map was not found.
void lookup(methodHandle method, int bci, InterpreterOopMap* entry);
void lookup(methodHandle method, int bci, InterpreterOopMap* entry) const;
// Compute an oop map without updating the cache or grabbing any locks (for debugging)
static void compute_one_oop_map(methodHandle method, int bci, InterpreterOopMap* entry);