Mercurial > hg > graal-compiler
diff src/share/vm/code/nmethod.cpp @ 8215:b89a97928e72
Implement weak reference semantics for HotSpotInstalledCode in the default method installation case. Add new boolean[] array as parameter to the code installation.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Mon, 11 Mar 2013 20:55:05 +0100 |
parents | a357b7a3de5e |
children | 985a97ba083c |
line wrap: on
line diff
--- a/src/share/vm/code/nmethod.cpp Mon Mar 11 17:30:21 2013 +0100 +++ b/src/share/vm/code/nmethod.cpp Mon Mar 11 20:55:05 2013 +0100 @@ -490,6 +490,7 @@ _compiler = NULL; #ifdef GRAAL _graal_installed_code = NULL; + _triggered_deoptimizations = NULL; #endif #ifdef HAVE_DTRACE_H _trap_offset = 0; @@ -585,7 +586,8 @@ int comp_level, GrowableArray<jlong>* leaf_graph_ids #ifdef GRAAL - , Handle installed_code + , Handle installed_code, + Handle triggered_deoptimizations #endif ) { @@ -613,7 +615,8 @@ comp_level, leaf_graph_ids #ifdef GRAAL - , installed_code + , installed_code, + triggered_deoptimizations #endif ); if (nm != NULL) { @@ -839,7 +842,8 @@ int comp_level, GrowableArray<jlong>* leaf_graph_ids #ifdef GRAAL - , Handle installed_code + , Handle installed_code, + Handle triggered_deoptimizations #endif ) : CodeBlob("nmethod", code_buffer, sizeof(nmethod), @@ -866,6 +870,7 @@ #ifdef GRAAL _graal_installed_code = installed_code(); + _triggered_deoptimizations = (typeArrayOop)triggered_deoptimizations(); #endif if (compiler->is_graal()) { // Graal might not produce any stub sections @@ -1685,8 +1690,16 @@ #ifdef GRAAL // Follow Graal method - if (_graal_installed_code != NULL && can_unload(is_alive, (oop*)&_graal_installed_code, unloading_occurred)) { - return; + if (_graal_installed_code != NULL) { + if (HotSpotInstalledCode::isDefault(_graal_installed_code)) { + if (!is_alive->do_object_b(_graal_installed_code)) { + _graal_installed_code = NULL; + } + } else { + if (can_unload(is_alive, (oop*)&_graal_installed_code, unloading_occurred)) { + return; + } + } } #endif @@ -1910,9 +1923,12 @@ } #ifdef GRAAL - if (_graal_installed_code != NULL) { + if(_graal_installed_code != NULL) { f->do_oop((oop*) &_graal_installed_code); } + if (_triggered_deoptimizations != NULL) { + f->do_oop((oop*) &_triggered_deoptimizations); + } #endif RelocIterator iter(this, low_boundary);