Mercurial > hg > truffle
diff src/share/vm/graal/graalCompilerToVM.cpp @ 9027:e0e85d78843b
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 12 Apr 2013 04:51:28 +0200 |
parents | ff5a32117e02 80aee92588cd |
children | b78686983a75 |
line wrap: on
line diff
--- a/src/share/vm/graal/graalCompilerToVM.cpp Fri Apr 12 04:49:07 2013 +0200 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Fri Apr 12 04:51:28 2013 +0200 @@ -416,10 +416,11 @@ return JNIHandles::make_local(THREAD, result); C2V_END -C2V_VMENTRY(jobject, lookupAppendixInPool, (JNIEnv *env, jobject, jobject type, jint index)) - assert(GraalCompiler::to_index_u4(index) < 0, "not an invokedynamic constant pool index"); +C2V_VMENTRY(jobject, lookupAppendixInPool, (JNIEnv *env, jobject, jobject type, jint index, jbyte opcode)) + Bytecodes::Code bc = (Bytecodes::Code) (((int) opcode) & 0xFF); + index = GraalCompiler::to_cp_index(index, bc); constantPoolHandle cpool(InstanceKlass::cast(java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(type)))->constants()); - oop appendix_oop = ConstantPool::appendix_at_if_loaded(cpool, GraalCompiler::to_index_u4(index)); + oop appendix_oop = ConstantPool::appendix_at_if_loaded(cpool, index); return JNIHandles::make_local(THREAD, appendix_oop); C2V_END @@ -429,7 +430,7 @@ instanceKlassHandle pool_holder(cp->pool_holder()); Bytecodes::Code bc = (Bytecodes::Code) (((int) opcode) & 0xFF); - index = (bc == Bytecodes::_invokedynamic) ? GraalCompiler::to_index_u4(index) : GraalCompiler::to_cp_index_u2(index); + index = GraalCompiler::to_cp_index(index, bc); methodHandle method = GraalEnv::get_method_by_index(cp, index, bc, pool_holder); if (!method.is_null()) { @@ -459,11 +460,11 @@ C2V_VMENTRY(void, lookupReferencedTypeInPool, (JNIEnv *env, jobject, jobject type, jint index, jbyte op)) ConstantPool* cp = InstanceKlass::cast(java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(type)))->constants(); - int opcode = (op & 0xFF); - if (opcode != Bytecodes::_checkcast && opcode != Bytecodes::_instanceof && opcode != Bytecodes::_new && opcode != Bytecodes::_anewarray - && opcode != Bytecodes::_multianewarray && opcode != Bytecodes::_ldc && opcode != Bytecodes::_ldc_w && opcode != Bytecodes::_ldc2_w) + Bytecodes::Code bc = (Bytecodes::Code) (((int) op) & 0xFF); + if (bc != Bytecodes::_checkcast && bc != Bytecodes::_instanceof && bc != Bytecodes::_new && bc != Bytecodes::_anewarray + && bc != Bytecodes::_multianewarray && bc != Bytecodes::_ldc && bc != Bytecodes::_ldc_w && bc != Bytecodes::_ldc2_w) { - index = cp->remap_instruction_operand_from_cache((opcode == Bytecodes::_invokedynamic) ? GraalCompiler::to_index_u4(index) : GraalCompiler::to_cp_index_u2(index)); + index = cp->remap_instruction_operand_from_cache(GraalCompiler::to_cp_index(index, bc)); } constantTag tag = cp->tag_at(index); if (tag.is_field_or_method()) { @@ -656,6 +657,7 @@ set_int("constMethodMaxStackOffset", in_bytes(ConstMethod::max_stack_offset())); set_int("extraStackEntries", Method::extra_stack_entries()); set_int("methodAccessFlagsOffset", in_bytes(Method::access_flags_offset())); + set_int("methodIntrinsicIdOffset", Method::intrinsic_id_offset_in_bytes()); set_int("klassHasFinalizerFlag", JVM_ACC_HAS_FINALIZER); set_int("threadExceptionOopOffset", in_bytes(JavaThread::exception_oop_offset())); set_int("threadExceptionPcOffset", in_bytes(JavaThread::exception_pc_offset())); @@ -779,6 +781,13 @@ set_int("deoptActionReinterpret", Deoptimization::Action_reinterpret); set_int("deoptActionMakeNotEntrant", Deoptimization::Action_make_not_entrant); set_int("deoptActionMakeNotCompilable", Deoptimization::Action_make_not_compilable); + + set_int("vmIntrinsicInvokeBasic", vmIntrinsics::_invokeBasic); + set_int("vmIntrinsicLinkToVirtual", vmIntrinsics::_linkToVirtual); + set_int("vmIntrinsicLinkToStatic", vmIntrinsics::_linkToStatic); + set_int("vmIntrinsicLinkToSpecial", vmIntrinsics::_linkToSpecial); + set_int("vmIntrinsicLinkToInterface", vmIntrinsics::_linkToInterface); + set_int("g1CardQueueIndexOffset", in_bytes(JavaThread::dirty_card_queue_offset() + PtrQueue::byte_offset_of_index())); set_int("g1CardQueueBufferOffset", in_bytes(JavaThread::dirty_card_queue_offset() + PtrQueue::byte_offset_of_buf())); set_int("logOfHRGrainBytes", HeapRegion::LogOfHRGrainBytes); @@ -992,10 +1001,10 @@ u2 typeCPIdx = table[i].descriptor_cp_index; u2 slot = table[i].slot; - char* name = method->constants()->string_at_noresolve(nameCPIdx); + char* name = method->constants()->symbol_at(nameCPIdx)->as_C_string(); Handle nameHandle = java_lang_String::create_from_str(name, CHECK_NULL); - char* typeInfo = method->constants()->string_at_noresolve(typeCPIdx); + char* typeInfo = method->constants()->symbol_at(typeCPIdx)->as_C_string(); Handle typeHandle = java_lang_String::create_from_str(typeInfo, CHECK_NULL); Handle holderHandle = GraalCompiler::createHotSpotResolvedObjectType(method, CHECK_0); @@ -1105,7 +1114,7 @@ {CC"getVtableEntryOffset", CC"("METASPACE_METHOD")I", FN_PTR(getVtableEntryOffset)}, {CC"lookupType", CC"("STRING HS_RESOLVED_TYPE"Z)"TYPE, FN_PTR(lookupType)}, {CC"lookupConstantInPool", CC"("HS_RESOLVED_TYPE"I)"OBJECT, FN_PTR(lookupConstantInPool)}, - {CC"lookupAppendixInPool", CC"("HS_RESOLVED_TYPE"I)"OBJECT, FN_PTR(lookupAppendixInPool)}, + {CC"lookupAppendixInPool", CC"("HS_RESOLVED_TYPE"IB)"OBJECT, FN_PTR(lookupAppendixInPool)}, {CC"lookupMethodInPool", CC"("HS_RESOLVED_TYPE"IB)"METHOD, FN_PTR(lookupMethodInPool)}, {CC"lookupTypeInPool", CC"("HS_RESOLVED_TYPE"I)"TYPE, FN_PTR(lookupTypeInPool)}, {CC"lookupReferencedTypeInPool", CC"("HS_RESOLVED_TYPE"IB)V", FN_PTR(lookupReferencedTypeInPool)},