--- old/src/share/vm/oops/method.hpp 2013-03-29 19:14:29.338356358 +0100 +++ new/src/share/vm/oops/method.hpp 2013-03-29 19:14:29.154992820 +0100 @@ -154,6 +154,12 @@ // Constructor Method(ConstMethod* xconst, AccessFlags access_flags, int size); + + // this operates only on invoke methods: + // presize interpreter frames for extra interpreter stack entries, if needed + // Account for the extra appendix argument for invokehandle/invokedynamic + static int extra_stack_entries() { return EnableInvokeDynamic ? 1 : 0; } + public: static Method* allocate(ClassLoaderData* loader_data, @@ -274,9 +280,9 @@ // max stack // return original max stack size for method verification - int verifier_max_stack() const { return constMethod()->max_stack(); } - int max_stack() const { return constMethod()->max_stack() + extra_stack_entries(); } - void set_max_stack(int size) { constMethod()->set_max_stack(size); } + int verifier_max_stack() const { return constMethod()->max_stack() - extra_stack_entries(); } + int max_stack() const { return constMethod()->max_stack(); } + void set_max_stack(int size) { constMethod()->set_max_stack(size + extra_stack_entries()); } // max locals int max_locals() const { return constMethod()->max_locals(); } @@ -630,13 +636,6 @@ Symbol* signature, //anything at all TRAPS); static Klass* check_non_bcp_klass(Klass* klass); - // these operate only on invoke methods: - // presize interpreter frames for extra interpreter stack entries, if needed - // method handles want to be able to push a few extra values (e.g., a bound receiver), and - // invokedynamic sometimes needs to push a bootstrap method, call site, and arglist, - // all without checking for a stack overflow - static int extra_stack_entries() { return EnableInvokeDynamic ? 2 : 0; } - static int extra_stack_words(); // = extra_stack_entries() * Interpreter::stackElementSize() // RedefineClasses() support: bool is_old() const { return access_flags().is_old(); }