< prev index next >

test/hotspot/gtest/code/test_dependencyContext.cpp

Print this page

        

*** 48,58 **** dependencies().add_dependent_nmethod(_nmethods[1]); dependencies().add_dependent_nmethod(_nmethods[0]); } ~TestDependencyContext() { ! dependencies().wipe(); CodeCache_lock->unlock(); } static bool has_stale_entries(DependencyContext ctx) { return ctx.has_stale_entries(); --- 48,58 ---- dependencies().add_dependent_nmethod(_nmethods[1]); dependencies().add_dependent_nmethod(_nmethods[0]); } ~TestDependencyContext() { ! wipe(); CodeCache_lock->unlock(); } static bool has_stale_entries(DependencyContext ctx) { return ctx.has_stale_entries();
*** 61,70 **** --- 61,82 ---- #ifndef PRODUCT static bool find_stale_entries(DependencyContext ctx) { return ctx.find_stale_entries(); } #endif + + void wipe() { + DependencyContext ctx(&_dependency_context); + nmethodBucket* b = ctx.dependencies(); + ctx.set_dependencies(NULL); + ctx.set_has_stale_entries(false); + while (b != NULL) { + nmethodBucket* next = b->next(); + delete b; + b = next; + } + } }; static void test_remove_dependent_nmethod(int id, bool delete_immediately) { TestDependencyContext c; DependencyContext depContext = c.dependencies();
< prev index next >