Mercurial > hg > truffle
comparison src/share/vm/graal/graalCompilerToVM.cpp @ 14105:f62c770c22be
make HotSpotResolvedJavaMethod leaner
author | twisti |
---|---|
date | Thu, 06 Mar 2014 22:40:48 -0800 |
parents | a38a54030ea2 |
children | ca37cb080dad |
comparison
equal
deleted
inserted
replaced
14104:a38a54030ea2 | 14105:f62c770c22be |
---|---|
127 env->SetByteArrayRegion(result, 0, code_size, reconstituted_code); | 127 env->SetByteArrayRegion(result, 0, code_size, reconstituted_code); |
128 | 128 |
129 return result; | 129 return result; |
130 C2V_END | 130 C2V_END |
131 | 131 |
132 C2V_VMENTRY(jint, exceptionTableLength, (JNIEnv *, jobject, jlong metaspace_method)) | |
133 ResourceMark rm; | |
134 methodHandle method = asMethod(metaspace_method); | |
135 return method->exception_table_length(); | |
136 C2V_END | |
137 | |
132 C2V_VMENTRY(jlong, exceptionTableStart, (JNIEnv *, jobject, jlong metaspace_method)) | 138 C2V_VMENTRY(jlong, exceptionTableStart, (JNIEnv *, jobject, jlong metaspace_method)) |
133 ResourceMark rm; | 139 ResourceMark rm; |
134 methodHandle method = asMethod(metaspace_method); | 140 methodHandle method = asMethod(metaspace_method); |
135 assert(method->exception_table_length() != 0, "should be handled in Java code"); | 141 assert(method->exception_table_length() != 0, "should be handled in Java code"); |
136 return (jlong) (address) method->exception_table_start(); | 142 return (jlong) (address) method->exception_table_start(); |
137 C2V_END | 143 C2V_END |
138 | 144 |
139 C2V_VMENTRY(jint, hasBalancedMonitors, (JNIEnv *, jobject, jlong metaspace_method)) | 145 C2V_VMENTRY(jint, hasBalancedMonitors, (JNIEnv *, jobject, jlong metaspace_method)) |
140 | |
141 // Analyze the method to see if monitors are used properly. | 146 // Analyze the method to see if monitors are used properly. |
142 methodHandle method(THREAD, asMethod(metaspace_method)); | 147 methodHandle method(THREAD, asMethod(metaspace_method)); |
143 assert(method->has_monitor_bytecodes(), "should have checked this"); | |
144 | |
145 // Check to see if a previous compilation computed the monitor-matching analysis. | |
146 if (method->guaranteed_monitor_matching()) { | |
147 return true; | |
148 } | |
149 | |
150 { | 148 { |
151 EXCEPTION_MARK; | 149 EXCEPTION_MARK; |
152 ResourceMark rm(THREAD); | 150 ResourceMark rm(THREAD); |
153 GeneratePairingInfo gpi(method); | 151 GeneratePairingInfo gpi(method); |
154 gpi.compute_map(CATCH); | 152 gpi.compute_map(CATCH); |
183 C2V_END | 181 C2V_END |
184 | 182 |
185 C2V_VMENTRY(void, initializeMethod,(JNIEnv *, jobject, jlong metaspace_method, jobject hotspot_method)) | 183 C2V_VMENTRY(void, initializeMethod,(JNIEnv *, jobject, jlong metaspace_method, jobject hotspot_method)) |
186 methodHandle method = asMethod(metaspace_method); | 184 methodHandle method = asMethod(metaspace_method); |
187 InstanceKlass::cast(HotSpotResolvedJavaMethod::klass())->initialize(CHECK); | 185 InstanceKlass::cast(HotSpotResolvedJavaMethod::klass())->initialize(CHECK); |
188 HotSpotResolvedJavaMethod::set_exceptionHandlerCount(hotspot_method, method->exception_table_length()); | |
189 HotSpotResolvedJavaMethod::set_callerSensitive(hotspot_method, method->caller_sensitive()); | 186 HotSpotResolvedJavaMethod::set_callerSensitive(hotspot_method, method->caller_sensitive()); |
190 HotSpotResolvedJavaMethod::set_forceInline(hotspot_method, method->force_inline()); | 187 HotSpotResolvedJavaMethod::set_forceInline(hotspot_method, method->force_inline()); |
191 HotSpotResolvedJavaMethod::set_dontInline(hotspot_method, method->dont_inline()); | 188 HotSpotResolvedJavaMethod::set_dontInline(hotspot_method, method->dont_inline()); |
192 HotSpotResolvedJavaMethod::set_ignoredBySecurityStackWalk(hotspot_method, method->is_ignored_by_security_stack_walk()); | 189 HotSpotResolvedJavaMethod::set_ignoredBySecurityStackWalk(hotspot_method, method->is_ignored_by_security_stack_walk()); |
193 C2V_END | 190 C2V_END |
840 #define METASPACE_SYMBOL "J" | 837 #define METASPACE_SYMBOL "J" |
841 | 838 |
842 JNINativeMethod CompilerToVM_methods[] = { | 839 JNINativeMethod CompilerToVM_methods[] = { |
843 {CC"initializeBytecode", CC"("METASPACE_METHOD"[B)[B", FN_PTR(initializeBytecode)}, | 840 {CC"initializeBytecode", CC"("METASPACE_METHOD"[B)[B", FN_PTR(initializeBytecode)}, |
844 {CC"exceptionTableStart", CC"("METASPACE_METHOD")J", FN_PTR(exceptionTableStart)}, | 841 {CC"exceptionTableStart", CC"("METASPACE_METHOD")J", FN_PTR(exceptionTableStart)}, |
842 {CC"exceptionTableLength", CC"("METASPACE_METHOD")I", FN_PTR(exceptionTableLength)}, | |
845 {CC"hasBalancedMonitors", CC"("METASPACE_METHOD")Z", FN_PTR(hasBalancedMonitors)}, | 843 {CC"hasBalancedMonitors", CC"("METASPACE_METHOD")Z", FN_PTR(hasBalancedMonitors)}, |
846 {CC"findUniqueConcreteMethod", CC"("METASPACE_METHOD")"METASPACE_METHOD, FN_PTR(findUniqueConcreteMethod)}, | 844 {CC"findUniqueConcreteMethod", CC"("METASPACE_METHOD")"METASPACE_METHOD, FN_PTR(findUniqueConcreteMethod)}, |
847 {CC"getKlassImplementor", CC"("METASPACE_KLASS")"METASPACE_KLASS, FN_PTR(getKlassImplementor)}, | 845 {CC"getKlassImplementor", CC"("METASPACE_KLASS")"METASPACE_KLASS, FN_PTR(getKlassImplementor)}, |
848 {CC"getStackTraceElement", CC"("METASPACE_METHOD"I)"STACK_TRACE_ELEMENT, FN_PTR(getStackTraceElement)}, | 846 {CC"getStackTraceElement", CC"("METASPACE_METHOD"I)"STACK_TRACE_ELEMENT, FN_PTR(getStackTraceElement)}, |
849 {CC"initializeMethod", CC"("METASPACE_METHOD HS_RESOLVED_METHOD")V", FN_PTR(initializeMethod)}, | 847 {CC"initializeMethod", CC"("METASPACE_METHOD HS_RESOLVED_METHOD")V", FN_PTR(initializeMethod)}, |