diff --git a/src/share/javavm/export/jvm.h b/src/share/javavm/export/jvm.h index 1f785f1a108010b3ba61e83e70ab600b6e3274f6..44b0be576d49a4fd26bf1a0b18b711f3c6dab285 100644 --- a/src/share/javavm/export/jvm.h +++ b/src/share/javavm/export/jvm.h @@ -821,6 +821,13 @@ JVM_GetMethodIxMaxStack(JNIEnv *env, jclass cb, int index); JNIEXPORT jboolean JNICALL JVM_IsConstructorIx(JNIEnv *env, jclass cb, int index); +/* + * Is the given method generated by the VM. + * The method is identified by method_index. + */ +JNIEXPORT jboolean JNICALL +JVM_IsVMGeneratedMethodIx(JNIEnv *env, jclass cb, int index); + /* * Returns the name of a given method in UTF format. * The result remains valid until JVM_ReleaseUTF is called. diff --git a/src/share/native/common/check_code.c b/src/share/native/common/check_code.c index c5e8855ee68a80a4745da57db7382be6d456f18e..c761a3d9158957d8c23d4591cc0b8a51a824c47a 100644 --- a/src/share/native/common/check_code.c +++ b/src/share/native/common/check_code.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -983,6 +983,12 @@ verify_method(context_type *context, jclass cb, int method_index, CCerror(context, "Inconsistent access bits."); } + // If this method is an overpass method, which is generated by the VM, + // we trust the code and no check needs to be done. + if (JVM_IsVMGeneratedMethodIx(env, cb, method_index)) { + return; + } + /* Run through the code. Mark the start of each instruction, and give * the instruction a number */ for (i = 0, offset = 0; offset < code_length; i++) {