aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/prims/whitebox.cpp
diff options
context:
space:
mode:
authormgerdin <none@none>2013-04-02 11:28:33 +0200
committermgerdin <none@none>2013-04-02 11:28:33 +0200
commit71e1e567a0a80d09348705af73957036a5a23a43 (patch)
tree8b71deb6560b4f7854cfc99437162500811b57bd /src/share/vm/prims/whitebox.cpp
parent481c355b3bd7d0ab2a9fdc4bf610d27f1df264aa (diff)
downloadjdk8u_hotspot-71e1e567a0a80d09348705af73957036a5a23a43.tar.gz
8009763: Add WB test for String.intern()
Summary: Add convenience method in StringTable, add WhiteBox method and simple sanity test Reviewed-by: mgerdin, zgu Contributed-by: leonid.mesnik@oracle.com
Diffstat (limited to 'src/share/vm/prims/whitebox.cpp')
-rw-r--r--src/share/vm/prims/whitebox.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/share/vm/prims/whitebox.cpp b/src/share/vm/prims/whitebox.cpp
index 4758210ee..9b3cd297f 100644
--- a/src/share/vm/prims/whitebox.cpp
+++ b/src/share/vm/prims/whitebox.cpp
@@ -254,6 +254,24 @@ WB_ENTRY(jint, WB_GetCompileQueuesSize(JNIEnv* env, jobject o))
CompileBroker::queue_size(CompLevel_full_profile) /* C1 */;
WB_END
+WB_ENTRY(jboolean, WB_IsInStringTable(JNIEnv* env, jobject o, jstring javaString))
+ ResourceMark rm(THREAD);
+ int len;
+ jchar* name = java_lang_String::as_unicode_string(JNIHandles::resolve(javaString), len);
+ oop found_string = StringTable::the_table()->lookup(name, len);
+ if (found_string == NULL) {
+ return false;
+ }
+ return true;
+WB_END
+
+
+WB_ENTRY(void, WB_FullGC(JNIEnv* env, jobject o))
+ Universe::heap()->collector_policy()->set_should_clear_all_soft_refs(true);
+ Universe::heap()->collect(GCCause::_last_ditch_collection);
+WB_END
+
+
//Some convenience methods to deal with objects from java
int WhiteBox::offset_for_field(const char* field_name, oop object,
Symbol* signature_symbol) {
@@ -343,6 +361,8 @@ static JNINativeMethod methods[] = {
CC"(Ljava/lang/reflect/Method;)I", (void*)&WB_GetMethodCompilationLevel},
{CC"getCompileQueuesSize",
CC"()I", (void*)&WB_GetCompileQueuesSize},
+ {CC"isInStringTable", CC"(Ljava/lang/String;)Z", (void*)&WB_IsInStringTable },
+ {CC"fullGC", CC"()V", (void*)&WB_FullGC },
};
#undef CC