提交 d5a73dca 编写于 作者: A amurillo

Merge

...@@ -349,7 +349,7 @@ ifeq ($(OS_VENDOR), Darwin) ...@@ -349,7 +349,7 @@ ifeq ($(OS_VENDOR), Darwin)
# The macro takes the version with no dots, ex: 1070 # The macro takes the version with no dots, ex: 1070
CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \ CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \
-mmacosx-version-min=$(MACOSX_VERSION_MIN) -mmacosx-version-min=$(MACOSX_VERSION_MIN)
LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN) LFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
endif endif
......
...@@ -110,6 +110,9 @@ endif ...@@ -110,6 +110,9 @@ endif
ifneq ($(OS_VENDOR), Darwin) ifneq ($(OS_VENDOR), Darwin)
SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
else
# bring in minimum version argument or we'll fail on OSX 10.10
SA_LFLAGS = $(LFLAGS)
endif endif
SA_LFLAGS += $(LDFLAGS_HASH_STYLE) SA_LFLAGS += $(LDFLAGS_HASH_STYLE)
......
...@@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2015 ...@@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2015
HS_MAJOR_VER=25 HS_MAJOR_VER=25
HS_MINOR_VER=60 HS_MINOR_VER=60
HS_BUILD_NUMBER=07 HS_BUILD_NUMBER=08
JDK_MAJOR_VER=1 JDK_MAJOR_VER=1
JDK_MINOR_VER=8 JDK_MINOR_VER=8
......
...@@ -4418,11 +4418,11 @@ operand immF() %{ ...@@ -4418,11 +4418,11 @@ operand immF() %{
interface(CONST_INTER); interface(CONST_INTER);
%} %}
// constant 'float +0.0'. // Float Immediate: +0.0f.
operand immF_0() %{ operand immF_0() %{
predicate((n->getf() == 0) && predicate(jint_cast(n->getf()) == 0);
(fpclassify(n->getf()) == FP_ZERO) && (signbit(n->getf()) == 0));
match(ConF); match(ConF);
op_cost(0); op_cost(0);
format %{ %} format %{ %}
interface(CONST_INTER); interface(CONST_INTER);
......
...@@ -3760,13 +3760,9 @@ operand immD() %{ ...@@ -3760,13 +3760,9 @@ operand immD() %{
interface(CONST_INTER); interface(CONST_INTER);
%} %}
// Double Immediate: +0.0d
operand immD0() %{ operand immD0() %{
#ifdef _LP64
// on 64-bit architectures this comparision is faster
predicate(jlong_cast(n->getd()) == 0); predicate(jlong_cast(n->getd()) == 0);
#else
predicate((n->getd() == 0) && (fpclass(n->getd()) == FP_PZERO));
#endif
match(ConD); match(ConD);
op_cost(0); op_cost(0);
...@@ -3783,9 +3779,9 @@ operand immF() %{ ...@@ -3783,9 +3779,9 @@ operand immF() %{
interface(CONST_INTER); interface(CONST_INTER);
%} %}
// Float Immediate: 0 // Float Immediate: +0.0f
operand immF0() %{ operand immF0() %{
predicate((n->getf() == 0) && (fpclass(n->getf()) == FP_PZERO)); predicate(jint_cast(n->getf()) == 0);
match(ConF); match(ConF);
op_cost(0); op_cost(0);
......
...@@ -3987,11 +3987,6 @@ jint os::init_2(void) { ...@@ -3987,11 +3987,6 @@ jint os::init_2(void) {
return JNI_OK; return JNI_OK;
} }
// this is called at the end of vm_initialization
void os::init_3(void) {
return;
}
// Mark the polling page as unreadable // Mark the polling page as unreadable
void os::make_polling_page_unreadable(void) { void os::make_polling_page_unreadable(void) {
if (!guard_memory((char*)_polling_page, Aix::page_size())) { if (!guard_memory((char*)_polling_page, Aix::page_size())) {
......
...@@ -3745,9 +3745,6 @@ jint os::init_2(void) ...@@ -3745,9 +3745,6 @@ jint os::init_2(void)
return JNI_OK; return JNI_OK;
} }
// this is called at the end of vm_initialization
void os::init_3(void) { }
// Mark the polling page as unreadable // Mark the polling page as unreadable
void os::make_polling_page_unreadable(void) { void os::make_polling_page_unreadable(void) {
if( !guard_memory((char*)_polling_page, Bsd::page_size()) ) if( !guard_memory((char*)_polling_page, Bsd::page_size()) )
......
...@@ -160,35 +160,6 @@ static pthread_mutex_t dl_mutex; ...@@ -160,35 +160,6 @@ static pthread_mutex_t dl_mutex;
// Declarations // Declarations
static void unpackTime(timespec* absTime, bool isAbsolute, jlong time); static void unpackTime(timespec* absTime, bool isAbsolute, jlong time);
#ifdef JAVASE_EMBEDDED
class MemNotifyThread: public Thread {
friend class VMStructs;
public:
virtual void run();
private:
static MemNotifyThread* _memnotify_thread;
int _fd;
public:
// Constructor
MemNotifyThread(int fd);
// Tester
bool is_memnotify_thread() const { return true; }
// Printing
char* name() const { return (char*)"Linux MemNotify Thread"; }
// Returns the single instance of the MemNotifyThread
static MemNotifyThread* memnotify_thread() { return _memnotify_thread; }
// Create and start the single instance of MemNotifyThread
static void start();
};
#endif // JAVASE_EMBEDDED
// utility functions // utility functions
static int SR_initialize(); static int SR_initialize();
...@@ -4913,17 +4884,6 @@ jint os::init_2(void) ...@@ -4913,17 +4884,6 @@ jint os::init_2(void)
return JNI_OK; return JNI_OK;
} }
// this is called at the end of vm_initialization
void os::init_3(void) {
#ifdef JAVASE_EMBEDDED
// Start the MemNotifyThread
if (LowMemoryProtection) {
MemNotifyThread::start();
}
return;
#endif
}
// Mark the polling page as unreadable // Mark the polling page as unreadable
void os::make_polling_page_unreadable(void) { void os::make_polling_page_unreadable(void) {
if( !guard_memory((char*)_polling_page, Linux::page_size()) ) if( !guard_memory((char*)_polling_page, Linux::page_size()) )
...@@ -6100,83 +6060,6 @@ int os::get_core_path(char* buffer, size_t bufferSize) { ...@@ -6100,83 +6060,6 @@ int os::get_core_path(char* buffer, size_t bufferSize) {
return strlen(buffer); return strlen(buffer);
} }
#ifdef JAVASE_EMBEDDED
//
// A thread to watch the '/dev/mem_notify' device, which will tell us when the OS is running low on memory.
//
MemNotifyThread* MemNotifyThread::_memnotify_thread = NULL;
// ctor
//
MemNotifyThread::MemNotifyThread(int fd): Thread() {
assert(memnotify_thread() == NULL, "we can only allocate one MemNotifyThread");
_fd = fd;
if (os::create_thread(this, os::os_thread)) {
_memnotify_thread = this;
os::set_priority(this, NearMaxPriority);
os::start_thread(this);
}
}
// Where all the work gets done
//
void MemNotifyThread::run() {
assert(this == memnotify_thread(), "expected the singleton MemNotifyThread");
// Set up the select arguments
fd_set rfds;
if (_fd != -1) {
FD_ZERO(&rfds);
FD_SET(_fd, &rfds);
}
// Now wait for the mem_notify device to wake up
while (1) {
// Wait for the mem_notify device to signal us..
int rc = select(_fd+1, _fd != -1 ? &rfds : NULL, NULL, NULL, NULL);
if (rc == -1) {
perror("select!\n");
break;
} else if (rc) {
//ssize_t free_before = os::available_memory();
//tty->print ("Notified: Free: %dK \n",os::available_memory()/1024);
// The kernel is telling us there is not much memory left...
// try to do something about that
// If we are not already in a GC, try one.
if (!Universe::heap()->is_gc_active()) {
Universe::heap()->collect(GCCause::_allocation_failure);
//ssize_t free_after = os::available_memory();
//tty->print ("Post-Notify: Free: %dK\n",free_after/1024);
//tty->print ("GC freed: %dK\n", (free_after - free_before)/1024);
}
// We might want to do something like the following if we find the GC's are not helping...
// Universe::heap()->size_policy()->set_gc_time_limit_exceeded(true);
}
}
}
//
// See if the /dev/mem_notify device exists, and if so, start a thread to monitor it.
//
void MemNotifyThread::start() {
int fd;
fd = open ("/dev/mem_notify", O_RDONLY, 0);
if (fd < 0) {
return;
}
if (memnotify_thread() == NULL) {
new MemNotifyThread(fd);
}
}
#endif // JAVASE_EMBEDDED
/////////////// Unit tests /////////////// /////////////// Unit tests ///////////////
#ifndef PRODUCT #ifndef PRODUCT
......
...@@ -5194,10 +5194,6 @@ jint os::init_2(void) { ...@@ -5194,10 +5194,6 @@ jint os::init_2(void) {
return JNI_OK; return JNI_OK;
} }
void os::init_3(void) {
return;
}
// Mark the polling page as unreadable // Mark the polling page as unreadable
void os::make_polling_page_unreadable(void) { void os::make_polling_page_unreadable(void) {
if( mprotect((char *)_polling_page, page_size, PROT_NONE) != 0 ) if( mprotect((char *)_polling_page, page_size, PROT_NONE) != 0 )
......
...@@ -4062,10 +4062,6 @@ jint os::init_2(void) { ...@@ -4062,10 +4062,6 @@ jint os::init_2(void) {
return JNI_OK; return JNI_OK;
} }
void os::init_3(void) {
return;
}
// Mark the polling page as unreadable // Mark the polling page as unreadable
void os::make_polling_page_unreadable(void) { void os::make_polling_page_unreadable(void) {
DWORD old_status; DWORD old_status;
......
/* /*
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015, 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
...@@ -1091,6 +1091,7 @@ static void merge_in_new_methods(InstanceKlass* klass, ...@@ -1091,6 +1091,7 @@ static void merge_in_new_methods(InstanceKlass* klass,
} }
// update idnum for new location // update idnum for new location
merged_methods->at(i)->set_method_idnum(i); merged_methods->at(i)->set_method_idnum(i);
merged_methods->at(i)->set_orig_method_idnum(i);
} }
// Verify correct order // Verify correct order
......
/* /*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2015, 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
...@@ -222,6 +222,7 @@ private: ...@@ -222,6 +222,7 @@ private:
u2 _max_stack; // Maximum number of entries on the expression stack u2 _max_stack; // Maximum number of entries on the expression stack
u2 _max_locals; // Number of local variables used by this method u2 _max_locals; // Number of local variables used by this method
u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
u2 _orig_method_idnum; // Original unique identification number for the method
// Constructor // Constructor
ConstMethod(int byte_code_size, ConstMethod(int byte_code_size,
...@@ -475,6 +476,9 @@ public: ...@@ -475,6 +476,9 @@ public:
u2 method_idnum() const { return _method_idnum; } u2 method_idnum() const { return _method_idnum; }
void set_method_idnum(u2 idnum) { _method_idnum = idnum; } void set_method_idnum(u2 idnum) { _method_idnum = idnum; }
u2 orig_method_idnum() const { return _orig_method_idnum; }
void set_orig_method_idnum(u2 idnum) { _orig_method_idnum = idnum; }
// max stack // max stack
int max_stack() const { return _max_stack; } int max_stack() const { return _max_stack; }
void set_max_stack(int size) { _max_stack = size; } void set_max_stack(int size) { _max_stack = size; }
......
/* /*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2015, 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
...@@ -449,7 +449,6 @@ bool ConstantPoolCacheEntry::adjust_method_entry(Method* old_method, ...@@ -449,7 +449,6 @@ bool ConstantPoolCacheEntry::adjust_method_entry(Method* old_method,
new_method->name()->as_C_string(), new_method->name()->as_C_string(),
new_method->signature()->as_C_string())); new_method->signature()->as_C_string()));
} }
return true; return true;
} }
...@@ -477,7 +476,6 @@ bool ConstantPoolCacheEntry::adjust_method_entry(Method* old_method, ...@@ -477,7 +476,6 @@ bool ConstantPoolCacheEntry::adjust_method_entry(Method* old_method,
new_method->name()->as_C_string(), new_method->name()->as_C_string(),
new_method->signature()->as_C_string())); new_method->signature()->as_C_string()));
} }
return true; return true;
} }
...@@ -498,41 +496,39 @@ bool ConstantPoolCacheEntry::check_no_old_or_obsolete_entries() { ...@@ -498,41 +496,39 @@ bool ConstantPoolCacheEntry::check_no_old_or_obsolete_entries() {
// _f1 == NULL || !_f1->is_method() are OK here // _f1 == NULL || !_f1->is_method() are OK here
return true; return true;
} }
// return false if _f1 refers to an old or an obsolete method // return false if _f1 refers to a non-deleted old or obsolete method
return (NOT_PRODUCT(_f1->is_valid() &&) _f1->is_method() && return (NOT_PRODUCT(_f1->is_valid() &&) _f1->is_method() &&
!((Method*)_f1)->is_old() && !((Method*)_f1)->is_obsolete()); (f1_as_method()->is_deleted() ||
(!f1_as_method()->is_old() && !f1_as_method()->is_obsolete())));
} }
bool ConstantPoolCacheEntry::is_interesting_method_entry(Klass* k) { Method* ConstantPoolCacheEntry::get_interesting_method_entry(Klass* k) {
if (!is_method_entry()) { if (!is_method_entry()) {
// not a method entry so not interesting by default // not a method entry so not interesting by default
return false; return NULL;
} }
Method* m = NULL; Method* m = NULL;
if (is_vfinal()) { if (is_vfinal()) {
// virtual and final so _f2 contains method ptr instead of vtable index // virtual and final so _f2 contains method ptr instead of vtable index
m = f2_as_vfinal_method(); m = f2_as_vfinal_method();
} else if (is_f1_null()) { } else if (is_f1_null()) {
// NULL _f1 means this is a virtual entry so also not interesting // NULL _f1 means this is a virtual entry so also not interesting
return false; return NULL;
} else { } else {
if (!(_f1->is_method())) { if (!(_f1->is_method())) {
// _f1 can also contain a Klass* for an interface // _f1 can also contain a Klass* for an interface
return false; return NULL;
} }
m = f1_as_method(); m = f1_as_method();
} }
assert(m != NULL && m->is_method(), "sanity check"); assert(m != NULL && m->is_method(), "sanity check");
if (m == NULL || !m->is_method() || (k != NULL && m->method_holder() != k)) { if (m == NULL || !m->is_method() || (k != NULL && m->method_holder() != k)) {
// robustness for above sanity checks or method is not in // robustness for above sanity checks or method is not in
// the interesting class // the interesting class
return false; return NULL;
} }
// the method is in the interesting class so the entry is interesting // the method is in the interesting class so the entry is interesting
return true; return m;
} }
#endif // INCLUDE_JVMTI #endif // INCLUDE_JVMTI
...@@ -609,7 +605,7 @@ void ConstantPoolCache::initialize(const intArray& inverse_index_map, ...@@ -609,7 +605,7 @@ void ConstantPoolCache::initialize(const intArray& inverse_index_map,
// If any entry of this ConstantPoolCache points to any of // If any entry of this ConstantPoolCache points to any of
// old_methods, replace it with the corresponding new_method. // old_methods, replace it with the corresponding new_method.
void ConstantPoolCache::adjust_method_entries(Method** old_methods, Method** new_methods, void ConstantPoolCache::adjust_method_entries(Method** old_methods, Method** new_methods,
int methods_length, bool * trace_name_printed) { int methods_length, bool * trace_name_printed) {
if (methods_length == 0) { if (methods_length == 0) {
// nothing to do if there are no methods // nothing to do if there are no methods
...@@ -620,7 +616,7 @@ void ConstantPoolCache::adjust_method_entries(Method** old_methods, Method** new ...@@ -620,7 +616,7 @@ void ConstantPoolCache::adjust_method_entries(Method** old_methods, Method** new
Klass* old_holder = old_methods[0]->method_holder(); Klass* old_holder = old_methods[0]->method_holder();
for (int i = 0; i < length(); i++) { for (int i = 0; i < length(); i++) {
if (!entry_at(i)->is_interesting_method_entry(old_holder)) { if (entry_at(i)->get_interesting_method_entry(old_holder) == NULL) {
// skip uninteresting methods // skip uninteresting methods
continue; continue;
} }
...@@ -644,10 +640,33 @@ void ConstantPoolCache::adjust_method_entries(Method** old_methods, Method** new ...@@ -644,10 +640,33 @@ void ConstantPoolCache::adjust_method_entries(Method** old_methods, Method** new
} }
} }
// If any entry of this ConstantPoolCache points to any of
// old_methods, replace it with the corresponding new_method.
void ConstantPoolCache::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) {
for (int i = 0; i < length(); i++) {
ConstantPoolCacheEntry* entry = entry_at(i);
Method* old_method = entry->get_interesting_method_entry(holder);
if (old_method == NULL || !old_method->is_old()) {
continue; // skip uninteresting entries
}
if (old_method->is_deleted()) {
// clean up entries with deleted methods
entry->initialize_entry(entry->constant_pool_index());
continue;
}
Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
assert(new_method != NULL, "method_with_idnum() should not be NULL");
assert(old_method != new_method, "sanity check");
entry_at(i)->adjust_method_entry(old_method, new_method, trace_name_printed);
}
}
// the constant pool cache should never contain old or obsolete methods // the constant pool cache should never contain old or obsolete methods
bool ConstantPoolCache::check_no_old_or_obsolete_entries() { bool ConstantPoolCache::check_no_old_or_obsolete_entries() {
for (int i = 1; i < length(); i++) { for (int i = 1; i < length(); i++) {
if (entry_at(i)->is_interesting_method_entry(NULL) && if (entry_at(i)->get_interesting_method_entry(NULL) != NULL &&
!entry_at(i)->check_no_old_or_obsolete_entries()) { !entry_at(i)->check_no_old_or_obsolete_entries()) {
return false; return false;
} }
...@@ -657,7 +676,7 @@ bool ConstantPoolCache::check_no_old_or_obsolete_entries() { ...@@ -657,7 +676,7 @@ bool ConstantPoolCache::check_no_old_or_obsolete_entries() {
void ConstantPoolCache::dump_cache() { void ConstantPoolCache::dump_cache() {
for (int i = 1; i < length(); i++) { for (int i = 1; i < length(); i++) {
if (entry_at(i)->is_interesting_method_entry(NULL)) { if (entry_at(i)->get_interesting_method_entry(NULL) != NULL) {
entry_at(i)->print(tty, i); entry_at(i)->print(tty, i);
} }
} }
......
/* /*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2015, 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
...@@ -378,9 +378,9 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC { ...@@ -378,9 +378,9 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
// printed the klass name so that other routines in the adjust_* // printed the klass name so that other routines in the adjust_*
// group don't print the klass name. // group don't print the klass name.
bool adjust_method_entry(Method* old_method, Method* new_method, bool adjust_method_entry(Method* old_method, Method* new_method,
bool * trace_name_printed); bool* trace_name_printed);
bool check_no_old_or_obsolete_entries(); bool check_no_old_or_obsolete_entries();
bool is_interesting_method_entry(Klass* k); Method* get_interesting_method_entry(Klass* k);
#endif // INCLUDE_JVMTI #endif // INCLUDE_JVMTI
// Debugging & Printing // Debugging & Printing
...@@ -477,7 +477,8 @@ class ConstantPoolCache: public MetaspaceObj { ...@@ -477,7 +477,8 @@ class ConstantPoolCache: public MetaspaceObj {
// printed the klass name so that other routines in the adjust_* // printed the klass name so that other routines in the adjust_*
// group don't print the klass name. // group don't print the klass name.
void adjust_method_entries(Method** old_methods, Method** new_methods, void adjust_method_entries(Method** old_methods, Method** new_methods,
int methods_length, bool * trace_name_printed); int methods_length, bool* trace_name_printed);
void adjust_method_entries(InstanceKlass* holder, bool* trace_name_printed);
bool check_no_old_or_obsolete_entries(); bool check_no_old_or_obsolete_entries();
void dump_cache(); void dump_cache();
#endif // INCLUDE_JVMTI #endif // INCLUDE_JVMTI
......
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2015, 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
...@@ -2798,30 +2798,33 @@ Method* InstanceKlass::method_at_itable(Klass* holder, int index, TRAPS) { ...@@ -2798,30 +2798,33 @@ Method* InstanceKlass::method_at_itable(Klass* holder, int index, TRAPS) {
// not yet in the vtable due to concurrent subclass define and superinterface // not yet in the vtable due to concurrent subclass define and superinterface
// redefinition // redefinition
// Note: those in the vtable, should have been updated via adjust_method_entries // Note: those in the vtable, should have been updated via adjust_method_entries
void InstanceKlass::adjust_default_methods(Method** old_methods, Method** new_methods, void InstanceKlass::adjust_default_methods(InstanceKlass* holder, bool* trace_name_printed) {
int methods_length, bool* trace_name_printed) {
// search the default_methods for uses of either obsolete or EMCP methods // search the default_methods for uses of either obsolete or EMCP methods
if (default_methods() != NULL) { if (default_methods() != NULL) {
for (int j = 0; j < methods_length; j++) { for (int index = 0; index < default_methods()->length(); index ++) {
Method* old_method = old_methods[j]; Method* old_method = default_methods()->at(index);
Method* new_method = new_methods[j]; if (old_method == NULL || old_method->method_holder() != holder || !old_method->is_old()) {
continue; // skip uninteresting entries
for (int index = 0; index < default_methods()->length(); index ++) { }
if (default_methods()->at(index) == old_method) { assert(!old_method->is_deleted(), "default methods may not be deleted");
default_methods()->at_put(index, new_method);
if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) { Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
if (!(*trace_name_printed)) {
// RC_TRACE_MESG macro has an embedded ResourceMark assert(new_method != NULL, "method_with_idnum() should not be NULL");
RC_TRACE_MESG(("adjust: klassname=%s default methods from name=%s", assert(old_method != new_method, "sanity check");
external_name(),
old_method->method_holder()->external_name())); default_methods()->at_put(index, new_method);
*trace_name_printed = true; if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
} if (!(*trace_name_printed)) {
RC_TRACE(0x00100000, ("default method update: %s(%s) ", // RC_TRACE_MESG macro has an embedded ResourceMark
new_method->name()->as_C_string(), RC_TRACE_MESG(("adjust: klassname=%s default methods from name=%s",
new_method->signature()->as_C_string())); external_name(),
} old_method->method_holder()->external_name()));
*trace_name_printed = true;
} }
RC_TRACE(0x00100000, ("default method update: %s(%s) ",
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
} }
} }
} }
......
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2015, 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
...@@ -959,8 +959,7 @@ class InstanceKlass: public Klass { ...@@ -959,8 +959,7 @@ class InstanceKlass: public Klass {
Method* method_at_itable(Klass* holder, int index, TRAPS); Method* method_at_itable(Klass* holder, int index, TRAPS);
#if INCLUDE_JVMTI #if INCLUDE_JVMTI
void adjust_default_methods(Method** old_methods, Method** new_methods, void adjust_default_methods(InstanceKlass* holder, bool* trace_name_printed);
int methods_length, bool* trace_name_printed);
#endif // INCLUDE_JVMTI #endif // INCLUDE_JVMTI
// Garbage collection // Garbage collection
......
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2015, 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
...@@ -860,44 +860,43 @@ bool klassVtable::adjust_default_method(int vtable_index, Method* old_method, Me ...@@ -860,44 +860,43 @@ bool klassVtable::adjust_default_method(int vtable_index, Method* old_method, Me
} }
return updated; return updated;
} }
void klassVtable::adjust_method_entries(Method** old_methods, Method** new_methods,
int methods_length, bool * trace_name_printed) {
// search the vtable for uses of either obsolete or EMCP methods
for (int j = 0; j < methods_length; j++) {
Method* old_method = old_methods[j];
Method* new_method = new_methods[j];
// In the vast majority of cases we could get the vtable index
// by using: old_method->vtable_index()
// However, there are rare cases, eg. sun.awt.X11.XDecoratedPeer.getX()
// in sun.awt.X11.XFramePeer where methods occur more than once in the
// vtable, so, alas, we must do an exhaustive search.
for (int index = 0; index < length(); index++) {
if (unchecked_method_at(index) == old_method) {
put_method_at(new_method, index);
// For default methods, need to update the _default_methods array
// which can only have one method entry for a given signature
bool updated_default = false;
if (old_method->is_default_method()) {
updated_default = adjust_default_method(index, old_method, new_method);
}
if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) { // search the vtable for uses of either obsolete or EMCP methods
if (!(*trace_name_printed)) { void klassVtable::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) {
// RC_TRACE_MESG macro has an embedded ResourceMark int prn_enabled = 0;
RC_TRACE_MESG(("adjust: klassname=%s for methods from name=%s", for (int index = 0; index < length(); index++) {
klass()->external_name(), Method* old_method = unchecked_method_at(index);
old_method->method_holder()->external_name())); if (old_method == NULL || old_method->method_holder() != holder || !old_method->is_old()) {
*trace_name_printed = true; continue; // skip uninteresting entries
} }
// RC_TRACE macro has an embedded ResourceMark assert(!old_method->is_deleted(), "vtable methods may not be deleted");
RC_TRACE(0x00100000, ("vtable method update: %s(%s), updated default = %s",
new_method->name()->as_C_string(), Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
new_method->signature()->as_C_string(),
updated_default ? "true" : "false")); assert(new_method != NULL, "method_with_idnum() should not be NULL");
} assert(old_method != new_method, "sanity check");
// cannot 'break' here; see for-loop comment above.
put_method_at(new_method, index);
// For default methods, need to update the _default_methods array
// which can only have one method entry for a given signature
bool updated_default = false;
if (old_method->is_default_method()) {
updated_default = adjust_default_method(index, old_method, new_method);
}
if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
if (!(*trace_name_printed)) {
// RC_TRACE_MESG macro has an embedded ResourceMark
RC_TRACE_MESG(("adjust: klassname=%s for methods from name=%s",
klass()->external_name(),
old_method->method_holder()->external_name()));
*trace_name_printed = true;
} }
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00100000, ("vtable method update: %s(%s), updated default = %s",
new_method->name()->as_C_string(),
new_method->signature()->as_C_string(),
updated_default ? "true" : "false"));
} }
} }
} }
...@@ -1190,37 +1189,35 @@ void klassItable::initialize_with_method(Method* m) { ...@@ -1190,37 +1189,35 @@ void klassItable::initialize_with_method(Method* m) {
} }
#if INCLUDE_JVMTI #if INCLUDE_JVMTI
void klassItable::adjust_method_entries(Method** old_methods, Method** new_methods, // search the itable for uses of either obsolete or EMCP methods
int methods_length, bool * trace_name_printed) { void klassItable::adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed) {
// search the itable for uses of either obsolete or EMCP methods
for (int j = 0; j < methods_length; j++) { itableMethodEntry* ime = method_entry(0);
Method* old_method = old_methods[j]; for (int i = 0; i < _size_method_table; i++, ime++) {
Method* new_method = new_methods[j]; Method* old_method = ime->method();
itableMethodEntry* ime = method_entry(0); if (old_method == NULL || old_method->method_holder() != holder || !old_method->is_old()) {
continue; // skip uninteresting entries
// The itable can describe more than one interface and the same }
// method signature can be specified by more than one interface. assert(!old_method->is_deleted(), "itable methods may not be deleted");
// This means we have to do an exhaustive search to find all the
// old_method references. Method* new_method = holder->method_with_idnum(old_method->orig_method_idnum());
for (int i = 0; i < _size_method_table; i++) {
if (ime->method() == old_method) { assert(new_method != NULL, "method_with_idnum() should not be NULL");
ime->initialize(new_method); assert(old_method != new_method, "sanity check");
if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) { ime->initialize(new_method);
if (!(*trace_name_printed)) {
// RC_TRACE_MESG macro has an embedded ResourceMark if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
RC_TRACE_MESG(("adjust: name=%s", if (!(*trace_name_printed)) {
old_method->method_holder()->external_name())); // RC_TRACE_MESG macro has an embedded ResourceMark
*trace_name_printed = true; RC_TRACE_MESG(("adjust: name=%s",
} old_method->method_holder()->external_name()));
// RC_TRACE macro has an embedded ResourceMark *trace_name_printed = true;
RC_TRACE(0x00200000, ("itable method update: %s(%s)",
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
}
// cannot 'break' here; see for-loop comment above.
} }
ime++; // RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00200000, ("itable method update: %s(%s)",
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
} }
} }
} }
......
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2015, 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
...@@ -98,8 +98,7 @@ class klassVtable : public ResourceObj { ...@@ -98,8 +98,7 @@ class klassVtable : public ResourceObj {
// printed the klass name so that other routines in the adjust_* // printed the klass name so that other routines in the adjust_*
// group don't print the klass name. // group don't print the klass name.
bool adjust_default_method(int vtable_index, Method* old_method, Method* new_method); bool adjust_default_method(int vtable_index, Method* old_method, Method* new_method);
void adjust_method_entries(Method** old_methods, Method** new_methods, void adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed);
int methods_length, bool * trace_name_printed);
bool check_no_old_or_obsolete_entries(); bool check_no_old_or_obsolete_entries();
void dump_vtable(); void dump_vtable();
#endif // INCLUDE_JVMTI #endif // INCLUDE_JVMTI
...@@ -288,8 +287,7 @@ class klassItable : public ResourceObj { ...@@ -288,8 +287,7 @@ class klassItable : public ResourceObj {
// trace_name_printed is set to true if the current call has // trace_name_printed is set to true if the current call has
// printed the klass name so that other routines in the adjust_* // printed the klass name so that other routines in the adjust_*
// group don't print the klass name. // group don't print the klass name.
void adjust_method_entries(Method** old_methods, Method** new_methods, void adjust_method_entries(InstanceKlass* holder, bool * trace_name_printed);
int methods_length, bool * trace_name_printed);
bool check_no_old_or_obsolete_entries(); bool check_no_old_or_obsolete_entries();
void dump_itable(); void dump_itable();
#endif // INCLUDE_JVMTI #endif // INCLUDE_JVMTI
......
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2015, 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
...@@ -1419,6 +1419,7 @@ void Method::sort_methods(Array<Method*>* methods, bool idempotent, bool set_idn ...@@ -1419,6 +1419,7 @@ void Method::sort_methods(Array<Method*>* methods, bool idempotent, bool set_idn
for (int i = 0; i < length; i++) { for (int i = 0; i < length; i++) {
Method* m = methods->at(i); Method* m = methods->at(i);
m->set_method_idnum(i); m->set_method_idnum(i);
m->set_orig_method_idnum(i);
} }
} }
} }
......
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2015, 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,6 +265,9 @@ class Method : public Metadata { ...@@ -265,6 +265,9 @@ class Method : public Metadata {
u2 method_idnum() const { return constMethod()->method_idnum(); } u2 method_idnum() const { return constMethod()->method_idnum(); }
void set_method_idnum(u2 idnum) { constMethod()->set_method_idnum(idnum); } void set_method_idnum(u2 idnum) { constMethod()->set_method_idnum(idnum); }
u2 orig_method_idnum() const { return constMethod()->orig_method_idnum(); }
void set_orig_method_idnum(u2 idnum) { constMethod()->set_orig_method_idnum(idnum); }
// code size // code size
int code_size() const { return constMethod()->code_size(); } int code_size() const { return constMethod()->code_size(); }
...@@ -714,6 +717,8 @@ class Method : public Metadata { ...@@ -714,6 +717,8 @@ class Method : public Metadata {
void set_is_old() { _access_flags.set_is_old(); } void set_is_old() { _access_flags.set_is_old(); }
bool is_obsolete() const { return access_flags().is_obsolete(); } bool is_obsolete() const { return access_flags().is_obsolete(); }
void set_is_obsolete() { _access_flags.set_is_obsolete(); } void set_is_obsolete() { _access_flags.set_is_obsolete(); }
bool is_deleted() const { return access_flags().is_deleted(); }
void set_is_deleted() { _access_flags.set_is_deleted(); }
bool on_stack() const { return access_flags().on_stack(); } bool on_stack() const { return access_flags().on_stack(); }
void set_on_stack(const bool value); void set_on_stack(const bool value);
......
/* /*
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2015, 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
...@@ -777,9 +777,13 @@ jvmtiError VM_RedefineClasses::compare_and_normalize_class_versions( ...@@ -777,9 +777,13 @@ jvmtiError VM_RedefineClasses::compare_and_normalize_class_versions(
Method* idnum_owner = scratch_class->method_with_idnum(old_num); Method* idnum_owner = scratch_class->method_with_idnum(old_num);
if (idnum_owner != NULL) { if (idnum_owner != NULL) {
// There is already a method assigned this idnum -- switch them // There is already a method assigned this idnum -- switch them
// Take current and original idnum from the new_method
idnum_owner->set_method_idnum(new_num); idnum_owner->set_method_idnum(new_num);
idnum_owner->set_orig_method_idnum(k_new_method->orig_method_idnum());
} }
// Take current and original idnum from the old_method
k_new_method->set_method_idnum(old_num); k_new_method->set_method_idnum(old_num);
k_new_method->set_orig_method_idnum(k_old_method->orig_method_idnum());
if (thread->has_pending_exception()) { if (thread->has_pending_exception()) {
return JVMTI_ERROR_OUT_OF_MEMORY; return JVMTI_ERROR_OUT_OF_MEMORY;
} }
...@@ -812,9 +816,12 @@ jvmtiError VM_RedefineClasses::compare_and_normalize_class_versions( ...@@ -812,9 +816,12 @@ jvmtiError VM_RedefineClasses::compare_and_normalize_class_versions(
Method* idnum_owner = scratch_class->method_with_idnum(num); Method* idnum_owner = scratch_class->method_with_idnum(num);
if (idnum_owner != NULL) { if (idnum_owner != NULL) {
// There is already a method assigned this idnum -- switch them // There is already a method assigned this idnum -- switch them
// Take current and original idnum from the new_method
idnum_owner->set_method_idnum(new_num); idnum_owner->set_method_idnum(new_num);
idnum_owner->set_orig_method_idnum(k_new_method->orig_method_idnum());
} }
k_new_method->set_method_idnum(num); k_new_method->set_method_idnum(num);
k_new_method->set_orig_method_idnum(num);
if (thread->has_pending_exception()) { if (thread->has_pending_exception()) {
return JVMTI_ERROR_OUT_OF_MEMORY; return JVMTI_ERROR_OUT_OF_MEMORY;
} }
...@@ -3322,6 +3329,7 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) { ...@@ -3322,6 +3329,7 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) {
// This is a very busy routine. We don't want too much tracing // This is a very busy routine. We don't want too much tracing
// printed out. // printed out.
bool trace_name_printed = false; bool trace_name_printed = false;
InstanceKlass *the_class = InstanceKlass::cast(_the_class_oop);
// Very noisy: only enable this call if you are trying to determine // Very noisy: only enable this call if you are trying to determine
// that a specific class gets found by this routine. // that a specific class gets found by this routine.
...@@ -3333,10 +3341,8 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) { ...@@ -3333,10 +3341,8 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) {
// If the class being redefined is java.lang.Object, we need to fix all // If the class being redefined is java.lang.Object, we need to fix all
// array class vtables also // array class vtables also
if (k->oop_is_array() && _the_class_oop == SystemDictionary::Object_klass()) { if (k->oop_is_array() && _the_class_oop == SystemDictionary::Object_klass()) {
k->vtable()->adjust_method_entries(_matching_old_methods, k->vtable()->adjust_method_entries(the_class, &trace_name_printed);
_matching_new_methods,
_matching_methods_length,
&trace_name_printed);
} else if (k->oop_is_instance()) { } else if (k->oop_is_instance()) {
HandleMark hm(_thread); HandleMark hm(_thread);
InstanceKlass *ik = InstanceKlass::cast(k); InstanceKlass *ik = InstanceKlass::cast(k);
...@@ -3376,14 +3382,9 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) { ...@@ -3376,14 +3382,9 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) {
|| ik->is_subtype_of(_the_class_oop))) { || ik->is_subtype_of(_the_class_oop))) {
// ik->vtable() creates a wrapper object; rm cleans it up // ik->vtable() creates a wrapper object; rm cleans it up
ResourceMark rm(_thread); ResourceMark rm(_thread);
ik->vtable()->adjust_method_entries(_matching_old_methods,
_matching_new_methods, ik->vtable()->adjust_method_entries(the_class, &trace_name_printed);
_matching_methods_length, ik->adjust_default_methods(the_class, &trace_name_printed);
&trace_name_printed);
ik->adjust_default_methods(_matching_old_methods,
_matching_new_methods,
_matching_methods_length,
&trace_name_printed);
} }
// If the current class has an itable and we are either redefining an // If the current class has an itable and we are either redefining an
...@@ -3396,10 +3397,8 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) { ...@@ -3396,10 +3397,8 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) {
|| ik->is_subclass_of(_the_class_oop))) { || ik->is_subclass_of(_the_class_oop))) {
// ik->itable() creates a wrapper object; rm cleans it up // ik->itable() creates a wrapper object; rm cleans it up
ResourceMark rm(_thread); ResourceMark rm(_thread);
ik->itable()->adjust_method_entries(_matching_old_methods,
_matching_new_methods, ik->itable()->adjust_method_entries(the_class, &trace_name_printed);
_matching_methods_length,
&trace_name_printed);
} }
// The constant pools in other classes (other_cp) can refer to // The constant pools in other classes (other_cp) can refer to
...@@ -3423,10 +3422,7 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) { ...@@ -3423,10 +3422,7 @@ void VM_RedefineClasses::AdjustCpoolCacheAndVtable::do_klass(Klass* k) {
other_cp = constantPoolHandle(ik->constants()); other_cp = constantPoolHandle(ik->constants());
cp_cache = other_cp->cache(); cp_cache = other_cp->cache();
if (cp_cache != NULL) { if (cp_cache != NULL) {
cp_cache->adjust_method_entries(_matching_old_methods, cp_cache->adjust_method_entries(the_class, &trace_name_printed);
_matching_new_methods,
_matching_methods_length,
&trace_name_printed);
} }
} }
...@@ -3555,6 +3551,7 @@ void VM_RedefineClasses::check_methods_and_mark_as_obsolete( ...@@ -3555,6 +3551,7 @@ void VM_RedefineClasses::check_methods_and_mark_as_obsolete(
// obsolete methods need a unique idnum so they become new entries in // obsolete methods need a unique idnum so they become new entries in
// the jmethodID cache in InstanceKlass // the jmethodID cache in InstanceKlass
assert(old_method->method_idnum() == new_method->method_idnum(), "must match");
u2 num = InstanceKlass::cast(_the_class_oop)->next_method_idnum(); u2 num = InstanceKlass::cast(_the_class_oop)->next_method_idnum();
if (num != ConstMethod::UNSET_IDNUM) { if (num != ConstMethod::UNSET_IDNUM) {
old_method->set_method_idnum(num); old_method->set_method_idnum(num);
...@@ -3575,7 +3572,8 @@ void VM_RedefineClasses::check_methods_and_mark_as_obsolete( ...@@ -3575,7 +3572,8 @@ void VM_RedefineClasses::check_methods_and_mark_as_obsolete(
assert(!old_method->has_vtable_index(), assert(!old_method->has_vtable_index(),
"cannot delete methods with vtable entries");; "cannot delete methods with vtable entries");;
// Mark all deleted methods as old and obsolete // Mark all deleted methods as old, obsolete and deleted
old_method->set_is_deleted();
old_method->set_is_old(); old_method->set_is_old();
old_method->set_is_obsolete(); old_method->set_is_obsolete();
++obsolete_count; ++obsolete_count;
...@@ -4164,7 +4162,7 @@ void VM_RedefineClasses::CheckClass::do_klass(Klass* k) { ...@@ -4164,7 +4162,7 @@ void VM_RedefineClasses::CheckClass::do_klass(Klass* k) {
no_old_methods = false; no_old_methods = false;
} }
// the constant pool cache should never contain old or obsolete methods // the constant pool cache should never contain non-deleted old or obsolete methods
if (ik->constants() != NULL && if (ik->constants() != NULL &&
ik->constants()->cache() != NULL && ik->constants()->cache() != NULL &&
!ik->constants()->cache()->check_no_old_or_obsolete_entries()) { !ik->constants()->cache()->check_no_old_or_obsolete_entries()) {
......
...@@ -2048,9 +2048,6 @@ class CommandLineFlags { ...@@ -2048,9 +2048,6 @@ class CommandLineFlags {
"Provide more detailed and expensive TLAB statistics " \ "Provide more detailed and expensive TLAB statistics " \
"(with PrintTLAB)") \ "(with PrintTLAB)") \
\ \
EMBEDDED_ONLY(product(bool, LowMemoryProtection, true, \
"Enable LowMemoryProtection")) \
\
product_pd(bool, NeverActAsServerClassMachine, \ product_pd(bool, NeverActAsServerClassMachine, \
"Never act like a server-class machine") \ "Never act like a server-class machine") \
\ \
......
...@@ -159,7 +159,6 @@ class os: AllStatic { ...@@ -159,7 +159,6 @@ class os: AllStatic {
static void init_globals(void) { // Called from init_globals() in init.cpp static void init_globals(void) { // Called from init_globals() in init.cpp
init_globals_ext(); init_globals_ext();
} }
static void init_3(void); // Called at the end of vm init
// File names are case-insensitive on windows only // File names are case-insensitive on windows only
// Override me as needed // Override me as needed
......
...@@ -3690,9 +3690,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { ...@@ -3690,9 +3690,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) {
} }
} }
// Give os specific code one last chance to start
os::init_3();
create_vm_timer.end(); create_vm_timer.end();
#ifdef ASSERT #ifdef ASSERT
_vm_complete = true; _vm_complete = true;
......
...@@ -155,11 +155,14 @@ void Management::initialize(TRAPS) { ...@@ -155,11 +155,14 @@ void Management::initialize(TRAPS) {
// Load and initialize the sun.management.Agent class // Load and initialize the sun.management.Agent class
// invoke startAgent method to start the management server // invoke startAgent method to start the management server
Handle loader = Handle(THREAD, SystemDictionary::java_system_loader()); Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::sun_management_Agent(), Klass* k = SystemDictionary::resolve_or_null(vmSymbols::sun_management_Agent(),
loader, loader,
Handle(), Handle(),
true, THREAD);
CHECK); if (k == NULL) {
vm_exit_during_initialization("Management agent initialization failure: "
"class sun.management.Agent not found.");
}
instanceKlassHandle ik (THREAD, k); instanceKlassHandle ik (THREAD, k);
JavaValue result(T_VOID); JavaValue result(T_VOID);
......
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2015, 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
...@@ -54,7 +54,8 @@ enum { ...@@ -54,7 +54,8 @@ enum {
JVM_ACC_IS_OLD = 0x00010000, // RedefineClasses() has replaced this method JVM_ACC_IS_OLD = 0x00010000, // RedefineClasses() has replaced this method
JVM_ACC_IS_OBSOLETE = 0x00020000, // RedefineClasses() has made method obsolete JVM_ACC_IS_OBSOLETE = 0x00020000, // RedefineClasses() has made method obsolete
JVM_ACC_IS_PREFIXED_NATIVE = 0x00040000, // JVMTI has prefixed this native method JVM_ACC_IS_PREFIXED_NATIVE = 0x00040000, // JVMTI has prefixed this native method
JVM_ACC_ON_STACK = 0x00080000, // RedefinedClasses() is used on the stack JVM_ACC_ON_STACK = 0x00080000, // RedefineClasses() was used on the stack
JVM_ACC_IS_DELETED = 0x00008000, // RedefineClasses() has deleted this method
// Klass* flags // Klass* flags
JVM_ACC_HAS_MIRANDA_METHODS = 0x10000000, // True if this class has miranda methods in it's vtable JVM_ACC_HAS_MIRANDA_METHODS = 0x10000000, // True if this class has miranda methods in it's vtable
...@@ -131,6 +132,7 @@ class AccessFlags VALUE_OBJ_CLASS_SPEC { ...@@ -131,6 +132,7 @@ class AccessFlags VALUE_OBJ_CLASS_SPEC {
bool has_jsrs () const { return (_flags & JVM_ACC_HAS_JSRS ) != 0; } bool has_jsrs () const { return (_flags & JVM_ACC_HAS_JSRS ) != 0; }
bool is_old () const { return (_flags & JVM_ACC_IS_OLD ) != 0; } bool is_old () const { return (_flags & JVM_ACC_IS_OLD ) != 0; }
bool is_obsolete () const { return (_flags & JVM_ACC_IS_OBSOLETE ) != 0; } bool is_obsolete () const { return (_flags & JVM_ACC_IS_OBSOLETE ) != 0; }
bool is_deleted () const { return (_flags & JVM_ACC_IS_DELETED ) != 0; }
bool is_prefixed_native () const { return (_flags & JVM_ACC_IS_PREFIXED_NATIVE ) != 0; } bool is_prefixed_native () const { return (_flags & JVM_ACC_IS_PREFIXED_NATIVE ) != 0; }
// Klass* flags // Klass* flags
...@@ -196,6 +198,7 @@ class AccessFlags VALUE_OBJ_CLASS_SPEC { ...@@ -196,6 +198,7 @@ class AccessFlags VALUE_OBJ_CLASS_SPEC {
void set_has_jsrs() { atomic_set_bits(JVM_ACC_HAS_JSRS); } void set_has_jsrs() { atomic_set_bits(JVM_ACC_HAS_JSRS); }
void set_is_old() { atomic_set_bits(JVM_ACC_IS_OLD); } void set_is_old() { atomic_set_bits(JVM_ACC_IS_OLD); }
void set_is_obsolete() { atomic_set_bits(JVM_ACC_IS_OBSOLETE); } void set_is_obsolete() { atomic_set_bits(JVM_ACC_IS_OBSOLETE); }
void set_is_deleted() { atomic_set_bits(JVM_ACC_IS_DELETED); }
void set_is_prefixed_native() { atomic_set_bits(JVM_ACC_IS_PREFIXED_NATIVE); } void set_is_prefixed_native() { atomic_set_bits(JVM_ACC_IS_PREFIXED_NATIVE); }
void clear_not_c1_compilable() { atomic_clear_bits(JVM_ACC_NOT_C1_COMPILABLE); } void clear_not_c1_compilable() { atomic_clear_bits(JVM_ACC_NOT_C1_COMPILABLE); }
......
...@@ -44,14 +44,6 @@ ...@@ -44,14 +44,6 @@
#endif // SOLARIS #endif // SOLARIS
#include <math.h> #include <math.h>
#ifndef FP_PZERO
// Linux doesn't have positive/negative zero
#define FP_PZERO FP_ZERO
#endif
#if (!defined fpclass) && ((!defined SPARC) || (!defined SOLARIS))
#define fpclass fpclassify
#endif
#include <time.h> #include <time.h>
#include <fcntl.h> #include <fcntl.h>
#include <dlfcn.h> #include <dlfcn.h>
......
...@@ -48,15 +48,6 @@ ...@@ -48,15 +48,6 @@
# include <ieeefp.h> # include <ieeefp.h>
#endif #endif
# include <math.h> # include <math.h>
#ifdef LINUX
#ifndef FP_PZERO
// Linux doesn't have positive/negative zero
#define FP_PZERO FP_ZERO
#endif
#ifndef fpclass
#define fpclass fpclassify
#endif
#endif
# include <time.h> # include <time.h>
# include <fcntl.h> # include <fcntl.h>
# include <dlfcn.h> # include <dlfcn.h>
......
...@@ -41,14 +41,6 @@ ...@@ -41,14 +41,6 @@
#include <wchar.h> #include <wchar.h>
#include <math.h> #include <math.h>
#ifndef FP_PZERO
// Linux doesn't have positive/negative zero
#define FP_PZERO FP_ZERO
#endif
#if (!defined fpclass)
#define fpclass fpclassify
#endif
#include <time.h> #include <time.h>
#include <fcntl.h> #include <fcntl.h>
#include <dlfcn.h> #include <dlfcn.h>
......
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/**
* @test
* @bug 8074869
* @summary C2 code generator can replace -0.0f with +0.0f on Linux
* @run main ConstFPVectorization 8
* @author volker.simonis@gmail.com
*
*/
public class ConstFPVectorization {
static float[] f = new float[16];
static double[] d = new double[16];
static void floatLoop(int count) {
for (int i = 0; i < count; i++) {
f[i] = -0.0f;
}
}
static void doubleLoop(int count) {
for (int i = 0; i < count; i++) {
d[i] = -0.0d;
}
}
public static void main(String args[]) {
for (int i = 0; i < 10_000; i++) {
floatLoop(Integer.parseInt(args[0]));
doubleLoop(Integer.parseInt(args[0]));
}
for (int i = 0; i < Integer.parseInt(args[0]); i++) {
if (Float.floatToRawIntBits(f[i]) != Float.floatToRawIntBits(-0.0f))
throw new Error("Float error at index " + i);
if (Double.doubleToRawLongBits(d[i]) != Double.doubleToRawLongBits(-0.0d))
throw new Error("Double error at index " + i);
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册