# HG changeset patch # User Thomas Wuerthinger # Date 1277302761 -7200 # Node ID 712c7ff1afc1e5a73cbdab6e2c3797e7248616d9 # Parent e1a275dbc8cd868f7d0de67f2ad2f7045015f7bc Added HotSpotVM project. diff -r e1a275dbc8cd -r 712c7ff1afc1 src/share/vm/c1x/c1x_VMEntries.cpp --- a/src/share/vm/c1x/c1x_VMEntries.cpp Tue May 18 21:53:05 2010 +0200 +++ b/src/share/vm/c1x/c1x_VMEntries.cpp Wed Jun 23 16:19:21 2010 +0200 @@ -308,55 +308,55 @@ return o->klass_part()->is_interface(); } -/* -* Class: com_sun_hotspot_c1x_VMEntries -* Method: RiMethod_accessFlags -* Signature: (Ljava/lang/Object;)I -*/ +/* +* Class: com_sun_hotspot_c1x_VMEntries +* Method: RiMethod_accessFlags +* Signature: (Ljava/lang/Object;)I +*/ JNIEXPORT jint JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1accessFlags(JNIEnv *, jclass, jobject method) { - methodOop m = (methodOop)JNIHandles::resolve(method); - return m->access_flags().as_int(); -} - -/* -* Class: com_sun_hotspot_c1x_VMEntries -* Method: installCode -* Signature: (Ljava/lang/Object;[BI)V -*/ + methodOop m = (methodOop)JNIHandles::resolve(method); + return m->access_flags().as_int(); +} + +/* +* Class: com_sun_hotspot_c1x_VMEntries +* Method: installCode +* Signature: (Ljava/lang/Object;[BI)V +*/ JNIEXPORT void JNICALL Java_com_sun_hotspot_c1x_VMEntries_installCode(JNIEnv *jniEnv, jclass, jobject method, jbyteArray code, jint frameSize) { - methodOop m = (methodOop)JNIHandles::resolve(method); - jboolean isCopy = false; - jbyte *codeBytes = jniEnv->GetByteArrayElements(code, &isCopy); - // TODO: Check if we need to disallocate? - int codeSize = jniEnv->GetArrayLength(code); - VM_ENTRY_MARK; + methodOop m = (methodOop)JNIHandles::resolve(method); + jboolean isCopy = false; + jbyte *codeBytes = jniEnv->GetByteArrayElements(code, &isCopy); + // TODO: Check if we need to disallocate? + int codeSize = jniEnv->GetArrayLength(code); + VM_ENTRY_MARK; ciEnv *env = CURRENT_ENV; env->set_oop_recorder(new OopRecorder(env->arena())); env->set_debug_info(new DebugInformationRecorder(env->oop_recorder())); - env->set_dependencies(new Dependencies(env)); - ciMethod *ciMethodObject = (ciMethod *)env->get_object(m); - CodeOffsets offsets; - - // TODO: This is a hack.. Produce correct entries. - offsets.set_value(CodeOffsets::Exceptions, 0); - offsets.set_value(CodeOffsets::Deopt, 0); - + env->set_dependencies(new Dependencies(env)); + ciMethod *ciMethodObject = (ciMethod *)env->get_object(m); + CodeOffsets offsets; + + // TODO: This is a hack.. Produce correct entries. + offsets.set_value(CodeOffsets::Exceptions, 0); + offsets.set_value(CodeOffsets::Deopt, 0); + CodeBuffer buffer((address)codeBytes, codeSize); buffer.print(); CodeSection *inst_section = buffer.insts(); inst_section->set_end(inst_section->start() + codeSize); - buffer.initialize_oop_recorder(env->oop_recorder()); - OopMapSet oop_map_set; - ExceptionHandlerTable handler_table; - ImplicitExceptionTable inc_table; - { - ThreadToNativeFromVM t((JavaThread*)THREAD); - env->register_method(ciMethodObject, -1, &offsets, 0, &buffer, frameSize, &oop_map_set, &handler_table, &inc_table, NULL, env->comp_level(), false, false); - - } -} + buffer.initialize_oop_recorder(env->oop_recorder()); + OopMapSet oop_map_set; + ExceptionHandlerTable handler_table; + ImplicitExceptionTable inc_table; + { + ThreadToNativeFromVM t((JavaThread*)THREAD); + env->register_method(ciMethodObject, -1, &offsets, 0, &buffer, frameSize, &oop_map_set, &handler_table, &inc_table, NULL, env->comp_level(), false, false); + + } +} diff -r e1a275dbc8cd -r 712c7ff1afc1 src/share/vm/c1x/c1x_VMEntries.hpp --- a/src/share/vm/c1x/c1x_VMEntries.hpp Tue May 18 21:53:05 2010 +0200 +++ b/src/share/vm/c1x/c1x_VMEntries.hpp Wed Jun 23 16:19:21 2010 +0200 @@ -190,22 +190,22 @@ JNIEXPORT jboolean JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1isInterface (JNIEnv *, jclass, jobject); -/* -* Class: com_sun_hotspot_c1x_VMEntries -* Method: RiMethod_accessFlags -* Signature: (Ljava/lang/Object;)I -*/ -JNIEXPORT jint JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1accessFlags -(JNIEnv *, jclass, jobject); - -/* -* Class: com_sun_hotspot_c1x_VMEntries -* Method: installCode -* Signature: (Ljava/lang/Object;[BI)V -*/ -JNIEXPORT void JNICALL Java_com_sun_hotspot_c1x_VMEntries_installCode -(JNIEnv *, jclass, jobject, jbyteArray, jint); - +/* +* Class: com_sun_hotspot_c1x_VMEntries +* Method: RiMethod_accessFlags +* Signature: (Ljava/lang/Object;)I +*/ +JNIEXPORT jint JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1accessFlags +(JNIEnv *, jclass, jobject); + +/* +* Class: com_sun_hotspot_c1x_VMEntries +* Method: installCode +* Signature: (Ljava/lang/Object;[BI)V +*/ +JNIEXPORT void JNICALL Java_com_sun_hotspot_c1x_VMEntries_installCode +(JNIEnv *, jclass, jobject, jbyteArray, jint); + extern JNINativeMethod VMEntries_methods[];