Mercurial > hg > graal-jvmci-8
comparison src/share/vm/code/nmethod.cpp @ 3683:345c3bbf9c3c
store RiCompiledMethod in nmethod and:
* invalidate RiCompiledMethod when the nmethod is invalidated
* invalidate the nmethod when the RiCompiledMethod object is GC'ed
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Fri, 18 Nov 2011 11:54:07 +0100 |
parents | be4ca325525a |
children | 04b9a2566eec |
comparison
equal
deleted
inserted
replaced
3682:6c04a4f268e5 | 3683:345c3bbf9c3c |
---|---|
42 #include "utilities/events.hpp" | 42 #include "utilities/events.hpp" |
43 #include "utilities/xmlstream.hpp" | 43 #include "utilities/xmlstream.hpp" |
44 #ifdef SHARK | 44 #ifdef SHARK |
45 #include "shark/sharkCompiler.hpp" | 45 #include "shark/sharkCompiler.hpp" |
46 #endif | 46 #endif |
47 #ifdef GRAAL | |
48 #include "graal/graalJavaAccess.hpp" | |
49 #endif | |
47 | 50 |
48 #ifdef DTRACE_ENABLED | 51 #ifdef DTRACE_ENABLED |
49 | 52 |
50 // Only bother with this argument setup if dtrace is available | 53 // Only bother with this argument setup if dtrace is available |
51 | 54 |
460 _osr_link = NULL; | 463 _osr_link = NULL; |
461 _scavenge_root_link = NULL; | 464 _scavenge_root_link = NULL; |
462 _scavenge_root_state = 0; | 465 _scavenge_root_state = 0; |
463 _saved_nmethod_link = NULL; | 466 _saved_nmethod_link = NULL; |
464 _compiler = NULL; | 467 _compiler = NULL; |
468 | |
469 _graal_compiled_method = NULL; | |
465 | 470 |
466 #ifdef HAVE_DTRACE_H | 471 #ifdef HAVE_DTRACE_H |
467 _trap_offset = 0; | 472 _trap_offset = 0; |
468 #endif // def HAVE_DTRACE_H | 473 #endif // def HAVE_DTRACE_H |
469 } | 474 } |
1293 // another thread already performed this transition so nothing | 1298 // another thread already performed this transition so nothing |
1294 // to do, but return false to indicate this. | 1299 // to do, but return false to indicate this. |
1295 return false; | 1300 return false; |
1296 } | 1301 } |
1297 | 1302 |
1303 #ifdef GRAAL | |
1304 if (_graal_compiled_method != NULL) { | |
1305 HotSpotCompiledMethod::set_nmethod(_graal_compiled_method, 0); | |
1306 _graal_compiled_method = NULL; | |
1307 } | |
1308 #endif | |
1309 | |
1298 // The caller can be calling the method statically or through an inline | 1310 // The caller can be calling the method statically or through an inline |
1299 // cache call. | 1311 // cache call. |
1300 if (!is_osr_method() && !is_not_entrant()) { | 1312 if (!is_osr_method() && !is_not_entrant()) { |
1301 NativeJump::patch_verified_entry(entry_point(), verified_entry_point(), | 1313 NativeJump::patch_verified_entry(entry_point(), verified_entry_point(), |
1302 SharedRuntime::get_handle_wrong_method_stub()); | 1314 SharedRuntime::get_handle_wrong_method_stub()); |
1588 unloading_occurred = true; | 1600 unloading_occurred = true; |
1589 } | 1601 } |
1590 | 1602 |
1591 // Follow methodOop | 1603 // Follow methodOop |
1592 if (can_unload(is_alive, keep_alive, (oop*)&_method, unloading_occurred)) { | 1604 if (can_unload(is_alive, keep_alive, (oop*)&_method, unloading_occurred)) { |
1605 return; | |
1606 } | |
1607 | |
1608 if (_graal_compiled_method != NULL && can_unload(is_alive, keep_alive, (oop*)&_graal_compiled_method, unloading_occurred)) { | |
1593 return; | 1609 return; |
1594 } | 1610 } |
1595 | 1611 |
1596 // Exception cache | 1612 // Exception cache |
1597 ExceptionCache* ec = exception_cache(); | 1613 ExceptionCache* ec = exception_cache(); |
1705 // (See comment above.) | 1721 // (See comment above.) |
1706 } | 1722 } |
1707 | 1723 |
1708 // Compiled code | 1724 // Compiled code |
1709 f->do_oop((oop*) &_method); | 1725 f->do_oop((oop*) &_method); |
1726 f->do_oop((oop*) &_graal_compiled_method); | |
1710 if (!do_strong_roots_only) { | 1727 if (!do_strong_roots_only) { |
1711 // weak roots processing phase -- update ExceptionCache oops | 1728 // weak roots processing phase -- update ExceptionCache oops |
1712 ExceptionCache* ec = exception_cache(); | 1729 ExceptionCache* ec = exception_cache(); |
1713 while(ec != NULL) { | 1730 while(ec != NULL) { |
1714 f->do_oop((oop*)ec->exception_type_addr()); | 1731 f->do_oop((oop*)ec->exception_type_addr()); |