8058092: Test vm/mlvm/meth/stress/compiler/deoptimize. Assert in src/share/vm/classfile/systemDictionary.cpp: MH intrinsic invariant

Wed, 10 Sep 2014 19:08:17 -0700

author
iveresov
date
Wed, 10 Sep 2014 19:08:17 -0700
changeset 7172
0d78074d2444
parent 7171
631667807de7
child 7173
a98dd542cd25

8058092: Test vm/mlvm/meth/stress/compiler/deoptimize. Assert in src/share/vm/classfile/systemDictionary.cpp: MH intrinsic invariant
Summary: Throw exception if unable to compile an MH intrinsic
Reviewed-by: kvn

src/share/vm/classfile/systemDictionary.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/arguments.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/classfile/systemDictionary.cpp	Thu Sep 11 12:18:26 2014 -0700
     1.2 +++ b/src/share/vm/classfile/systemDictionary.cpp	Wed Sep 10 19:08:17 2014 -0700
     1.3 @@ -51,6 +51,7 @@
     1.4  #include "oops/typeArrayKlass.hpp"
     1.5  #include "prims/jvmtiEnvBase.hpp"
     1.6  #include "prims/methodHandles.hpp"
     1.7 +#include "runtime/arguments.hpp"
     1.8  #include "runtime/biasedLocking.hpp"
     1.9  #include "runtime/fieldType.hpp"
    1.10  #include "runtime/handles.inline.hpp"
    1.11 @@ -2277,7 +2278,11 @@
    1.12      m = Method::make_method_handle_intrinsic(iid, signature, CHECK_(empty));
    1.13      CompileBroker::compile_method(m, InvocationEntryBci, CompLevel_highest_tier,
    1.14                                    methodHandle(), CompileThreshold, "MH", CHECK_(empty));
    1.15 -
    1.16 +    // Check if we need to have compiled code but we don't.
    1.17 +    if (!Arguments::is_interpreter_only() && !m->has_compiled_code()) {
    1.18 +      THROW_MSG_(vmSymbols::java_lang_VirtualMachineError(),
    1.19 +                 "out of space in CodeCache for method handle intrinsic", empty);
    1.20 +    }
    1.21      // Now grab the lock.  We might have to throw away the new method,
    1.22      // if a racing thread has managed to install one at the same time.
    1.23      {
    1.24 @@ -2291,7 +2296,7 @@
    1.25    }
    1.26  
    1.27    assert(spe != NULL && spe->method() != NULL, "");
    1.28 -  assert(!UseCompiler || (spe->method()->has_compiled_code() &&
    1.29 +  assert(Arguments::is_interpreter_only() || (spe->method()->has_compiled_code() &&
    1.30           spe->method()->code()->entry_point() == spe->method()->from_compiled_entry()),
    1.31           "MH intrinsic invariant");
    1.32    return spe->method();
     2.1 --- a/src/share/vm/runtime/arguments.hpp	Thu Sep 11 12:18:26 2014 -0700
     2.2 +++ b/src/share/vm/runtime/arguments.hpp	Wed Sep 10 19:08:17 2014 -0700
     2.3 @@ -601,7 +601,9 @@
     2.4    static void  fix_appclasspath();
     2.5  
     2.6    // Operation modi
     2.7 -  static Mode mode()                        { return _mode; }
     2.8 +  static Mode mode()                { return _mode; }
     2.9 +  static bool is_interpreter_only() { return mode() == _int; }
    2.10 +
    2.11  
    2.12    // Utility: copies src into buf, replacing "%%" with "%" and "%p" with pid.
    2.13    static bool copy_expand_pid(const char* src, size_t srclen, char* buf, size_t buflen);

mercurial