comparison src/share/vm/jvmci/jvmciCompilerToVM.cpp @ 23989:115d4e0d7b87

removed HotSpotResolvedJavaFieldImpl.name field
author Doug Simon <doug.simon@oracle.com>
date Thu, 26 Jan 2017 13:02:37 +0100
parents 6d2c72b822b0
children 1b8892b4ce9c
comparison
equal deleted inserted replaced
23988:09541f94f3e6 23989:115d4e0d7b87
1 /* 1 /*
2 * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
745 C2V_VMENTRY(jint, constantPoolRemapInstructionOperandFromCache, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index)) 745 C2V_VMENTRY(jint, constantPoolRemapInstructionOperandFromCache, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index))
746 constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); 746 constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool);
747 return cp->remap_instruction_operand_from_cache(index); 747 return cp->remap_instruction_operand_from_cache(index);
748 C2V_END 748 C2V_END
749 749
750 C2V_VMENTRY(jobject, resolveFieldInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index, jbyte opcode, jlongArray info_handle)) 750 C2V_VMENTRY(jobject, resolveFieldInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index, jbyte opcode, jintArray info_handle))
751 ResourceMark rm; 751 ResourceMark rm;
752 constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); 752 constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool);
753 Bytecodes::Code code = (Bytecodes::Code)(((int) opcode) & 0xFF); 753 Bytecodes::Code code = (Bytecodes::Code)(((int) opcode) & 0xFF);
754 fieldDescriptor result; 754 fieldDescriptor result;
755 LinkResolver::resolve_field_access(result, cp, index, Bytecodes::java_code(code), true, false, CHECK_0); 755 LinkResolver::resolve_field_access(result, cp, index, Bytecodes::java_code(code), true, false, CHECK_0);
756 typeArrayOop info = (typeArrayOop) JNIHandles::resolve(info_handle); 756 typeArrayOop info = (typeArrayOop) JNIHandles::resolve(info_handle);
757 assert(info != NULL && info->length() == 2, "must be"); 757 assert(info != NULL && info->length() == 2, "must be");
758 info->long_at_put(0, (jlong) result.access_flags().as_int()); 758 info->int_at_put(0, result.access_flags().as_int());
759 info->long_at_put(1, (jlong) result.offset()); 759 info->int_at_put(1, result.offset());
760 info->int_at_put(2, result.index());
760 oop field_holder = CompilerToVM::get_jvmci_type(result.field_holder(), CHECK_NULL); 761 oop field_holder = CompilerToVM::get_jvmci_type(result.field_holder(), CHECK_NULL);
761 return JNIHandles::make_local(THREAD, field_holder); 762 return JNIHandles::make_local(THREAD, field_holder);
762 C2V_END 763 C2V_END
763 764
764 C2V_VMENTRY(jint, getVtableIndexForInterfaceMethod, (JNIEnv *, jobject, jobject jvmci_type, jobject jvmci_method)) 765 C2V_VMENTRY(jint, getVtableIndexForInterfaceMethod, (JNIEnv *, jobject, jobject jvmci_type, jobject jvmci_method))
1110 C2V_VMENTRY(jobject, getSymbol, (JNIEnv*, jobject, jlong symbol)) 1111 C2V_VMENTRY(jobject, getSymbol, (JNIEnv*, jobject, jlong symbol))
1111 Handle sym = java_lang_String::create_from_symbol((Symbol*)(address)symbol, CHECK_NULL); 1112 Handle sym = java_lang_String::create_from_symbol((Symbol*)(address)symbol, CHECK_NULL);
1112 return JNIHandles::make_local(THREAD, sym()); 1113 return JNIHandles::make_local(THREAD, sym());
1113 C2V_END 1114 C2V_END
1114 1115
1116 C2V_VMENTRY(jobject, getFieldName, (JNIEnv*, jobject, jobject jvmci_type, jint index))
1117 InstanceKlass* klass = (InstanceKlass*) CompilerToVM::asKlass(jvmci_type);
1118 if (index < 0 || index >= klass->fields()->length()) {
1119 THROW_NULL(vmSymbols::java_lang_ArrayIndexOutOfBoundsException());
1120 }
1121 Handle name = java_lang_String::create_from_symbol(klass->field_name(index), CHECK_NULL);
1122 return JNIHandles::make_local(THREAD, name());
1123 C2V_END
1124
1115 bool matches(jobjectArray methods, Method* method) { 1125 bool matches(jobjectArray methods, Method* method) {
1116 objArrayOop methods_oop = (objArrayOop) JNIHandles::resolve(methods); 1126 objArrayOop methods_oop = (objArrayOop) JNIHandles::resolve(methods);
1117 1127
1118 for (int i = 0; i < methods_oop->length(); i++) { 1128 for (int i = 0; i < methods_oop->length(); i++) {
1119 oop resolved = methods_oop->obj_at(i); 1129 oop resolved = methods_oop->obj_at(i);
1532 {CC"lookupMethodInPool", CC"("HS_CONSTANT_POOL"IB)"HS_RESOLVED_METHOD, FN_PTR(lookupMethodInPool)}, 1542 {CC"lookupMethodInPool", CC"("HS_CONSTANT_POOL"IB)"HS_RESOLVED_METHOD, FN_PTR(lookupMethodInPool)},
1533 {CC"constantPoolRemapInstructionOperandFromCache", CC"("HS_CONSTANT_POOL"I)I", FN_PTR(constantPoolRemapInstructionOperandFromCache)}, 1543 {CC"constantPoolRemapInstructionOperandFromCache", CC"("HS_CONSTANT_POOL"I)I", FN_PTR(constantPoolRemapInstructionOperandFromCache)},
1534 {CC"resolveConstantInPool", CC"("HS_CONSTANT_POOL"I)"OBJECT, FN_PTR(resolveConstantInPool)}, 1544 {CC"resolveConstantInPool", CC"("HS_CONSTANT_POOL"I)"OBJECT, FN_PTR(resolveConstantInPool)},
1535 {CC"resolvePossiblyCachedConstantInPool", CC"("HS_CONSTANT_POOL"I)"OBJECT, FN_PTR(resolvePossiblyCachedConstantInPool)}, 1545 {CC"resolvePossiblyCachedConstantInPool", CC"("HS_CONSTANT_POOL"I)"OBJECT, FN_PTR(resolvePossiblyCachedConstantInPool)},
1536 {CC"resolveTypeInPool", CC"("HS_CONSTANT_POOL"I)"HS_RESOLVED_KLASS, FN_PTR(resolveTypeInPool)}, 1546 {CC"resolveTypeInPool", CC"("HS_CONSTANT_POOL"I)"HS_RESOLVED_KLASS, FN_PTR(resolveTypeInPool)},
1537 {CC"resolveFieldInPool", CC"("HS_CONSTANT_POOL"IB[J)"HS_RESOLVED_KLASS, FN_PTR(resolveFieldInPool)}, 1547 {CC"resolveFieldInPool", CC"("HS_CONSTANT_POOL"IB[I)"HS_RESOLVED_KLASS, FN_PTR(resolveFieldInPool)},
1538 {CC"resolveInvokeDynamicInPool", CC"("HS_CONSTANT_POOL"I)V", FN_PTR(resolveInvokeDynamicInPool)}, 1548 {CC"resolveInvokeDynamicInPool", CC"("HS_CONSTANT_POOL"I)V", FN_PTR(resolveInvokeDynamicInPool)},
1539 {CC"resolveInvokeHandleInPool", CC"("HS_CONSTANT_POOL"I)V", FN_PTR(resolveInvokeHandleInPool)}, 1549 {CC"resolveInvokeHandleInPool", CC"("HS_CONSTANT_POOL"I)V", FN_PTR(resolveInvokeHandleInPool)},
1540 {CC"resolveMethod", CC"("HS_RESOLVED_KLASS HS_RESOLVED_METHOD HS_RESOLVED_KLASS")"HS_RESOLVED_METHOD, FN_PTR(resolveMethod)}, 1550 {CC"resolveMethod", CC"("HS_RESOLVED_KLASS HS_RESOLVED_METHOD HS_RESOLVED_KLASS")"HS_RESOLVED_METHOD, FN_PTR(resolveMethod)},
1541 {CC "getSignaturePolymorphicHolders", CC "()[" STRING, FN_PTR(getSignaturePolymorphicHolders)}, 1551 {CC "getSignaturePolymorphicHolders", CC "()[" STRING, FN_PTR(getSignaturePolymorphicHolders)},
1542 {CC"getVtableIndexForInterfaceMethod", CC"("HS_RESOLVED_KLASS HS_RESOLVED_METHOD")I", FN_PTR(getVtableIndexForInterfaceMethod)}, 1552 {CC"getVtableIndexForInterfaceMethod", CC"("HS_RESOLVED_KLASS HS_RESOLVED_METHOD")I", FN_PTR(getVtableIndexForInterfaceMethod)},
1561 {CC"collectCounters", CC"()[J", FN_PTR(collectCounters)}, 1571 {CC"collectCounters", CC"()[J", FN_PTR(collectCounters)},
1562 {CC"allocateCompileId", CC"("HS_RESOLVED_METHOD"I)I", FN_PTR(allocateCompileId)}, 1572 {CC"allocateCompileId", CC"("HS_RESOLVED_METHOD"I)I", FN_PTR(allocateCompileId)},
1563 {CC"isMature", CC"("METASPACE_METHOD_DATA")Z", FN_PTR(isMature)}, 1573 {CC"isMature", CC"("METASPACE_METHOD_DATA")Z", FN_PTR(isMature)},
1564 {CC"hasCompiledCodeForOSR", CC"("HS_RESOLVED_METHOD"II)Z", FN_PTR(hasCompiledCodeForOSR)}, 1574 {CC"hasCompiledCodeForOSR", CC"("HS_RESOLVED_METHOD"II)Z", FN_PTR(hasCompiledCodeForOSR)},
1565 {CC"getSymbol", CC"(J)"STRING, FN_PTR(getSymbol)}, 1575 {CC"getSymbol", CC"(J)"STRING, FN_PTR(getSymbol)},
1576 {CC"getFieldName", CC"("HS_RESOLVED_KLASS"I)"STRING, FN_PTR(getFieldName)},
1566 {CC"getNextStackFrame", CC"("HS_STACK_FRAME_REF "["RESOLVED_METHOD"I)"HS_STACK_FRAME_REF, FN_PTR(getNextStackFrame)}, 1577 {CC"getNextStackFrame", CC"("HS_STACK_FRAME_REF "["RESOLVED_METHOD"I)"HS_STACK_FRAME_REF, FN_PTR(getNextStackFrame)},
1567 {CC"materializeVirtualObjects", CC"("HS_STACK_FRAME_REF"Z)V", FN_PTR(materializeVirtualObjects)}, 1578 {CC"materializeVirtualObjects", CC"("HS_STACK_FRAME_REF"Z)V", FN_PTR(materializeVirtualObjects)},
1568 {CC"shouldDebugNonSafepoints", CC"()Z", FN_PTR(shouldDebugNonSafepoints)}, 1579 {CC"shouldDebugNonSafepoints", CC"()Z", FN_PTR(shouldDebugNonSafepoints)},
1569 {CC"writeDebugOutput", CC"([BII)V", FN_PTR(writeDebugOutput)}, 1580 {CC"writeDebugOutput", CC"([BII)V", FN_PTR(writeDebugOutput)},
1570 {CC"flushDebugOutput", CC"()V", FN_PTR(flushDebugOutput)}, 1581 {CC"flushDebugOutput", CC"()V", FN_PTR(flushDebugOutput)},