aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorcjplummer <none@none>2012-11-29 13:55:49 -0800
committercjplummer <none@none>2012-11-29 13:55:49 -0800
commitf74683998cac2b1804a1253cc6429cedbd44b59e (patch)
tree12b5bdcf63f8288a47859d095aeabbe31001707d /src
parent200436783a76a6a44afd28890e4620f8e616c252 (diff)
parenta9e821db671095b199526458b598bc44446d9fb6 (diff)
Merge
Diffstat (limited to 'src')
-rw-r--r--src/cpu/sparc/vm/cppInterpreter_sparc.cpp10
-rw-r--r--src/cpu/sparc/vm/interp_masm_sparc.cpp3
-rw-r--r--src/cpu/sparc/vm/templateInterpreter_sparc.cpp5
-rw-r--r--src/cpu/x86/vm/cppInterpreter_x86.cpp16
-rw-r--r--src/share/vm/classfile/classFileParser.cpp3
-rw-r--r--src/share/vm/classfile/defaultMethods.cpp3
-rw-r--r--src/share/vm/oops/constMethod.cpp55
-rw-r--r--src/share/vm/oops/constMethod.hpp51
-rw-r--r--src/share/vm/oops/method.cpp6
-rw-r--r--src/share/vm/oops/method.hpp17
-rw-r--r--src/share/vm/runtime/vmStructs.cpp4
11 files changed, 114 insertions, 59 deletions
diff --git a/src/cpu/sparc/vm/cppInterpreter_sparc.cpp b/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
index c62d6a536..eacb4d3fd 100644
--- a/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
+++ b/src/cpu/sparc/vm/cppInterpreter_sparc.cpp
@@ -1048,7 +1048,6 @@ void CppInterpreterGenerator::generate_compute_interpreter_state(const Register
const Address constMethod (G5_method, 0, in_bytes(Method::const_offset()));
const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
- const Address max_stack (G5_method, 0, in_bytes(Method::max_stack_offset()));
const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
// slop factor is two extra slots on the expression stack so that
@@ -1070,7 +1069,9 @@ void CppInterpreterGenerator::generate_compute_interpreter_state(const Register
__ lduh( size_of_parameters, Gtmp );
__ calc_mem_param_words(Gtmp, Gtmp); // space for native call parameters passed on the stack in words
} else {
- __ lduh(max_stack, Gtmp); // Full size expression stack
+ // Full size expression stack
+ __ ld_ptr(constMethod, Gtmp);
+ __ lduh(Gtmp, in_bytes(ConstMethod::max_stack_offset()), Gtmp);
}
__ add(Gtmp, fixed_size, Gtmp); // plus the fixed portion
@@ -1206,7 +1207,9 @@ void CppInterpreterGenerator::generate_compute_interpreter_state(const Register
__ sub(O2, wordSize, O2); // prepush
__ st_ptr(O2, XXX_STATE(_stack)); // PREPUSH
- __ lduh(max_stack, O3); // Full size expression stack
+ // Full size expression stack
+ __ ld_ptr(constMethod, O3);
+ __ lduh(O3, in_bytes(ConstMethod::max_stack_offset()), O3);
guarantee(!EnableInvokeDynamic, "no support yet for java.lang.invoke.MethodHandle"); //6815692
//6815692//if (EnableInvokeDynamic)
//6815692// __ inc(O3, Method::extra_stack_entries());
@@ -1539,7 +1542,6 @@ address InterpreterGenerator::generate_normal_entry(bool synchronized) {
const Address constMethod (G5_method, 0, in_bytes(Method::const_offset()));
const Address access_flags (G5_method, 0, in_bytes(Method::access_flags_offset()));
const Address size_of_parameters(G5_method, 0, in_bytes(Method::size_of_parameters_offset()));
- const Address max_stack (G5_method, 0, in_bytes(Method::max_stack_offset()));
const Address size_of_locals (G5_method, 0, in_bytes(Method::size_of_locals_offset()));
address entry_point = __ pc();
diff --git a/src/cpu/sparc/vm/interp_masm_sparc.cpp b/src/cpu/sparc/vm/interp_masm_sparc.cpp
index 1ce8ae638..6060f003b 100644
--- a/src/cpu/sparc/vm/interp_masm_sparc.cpp
+++ b/src/cpu/sparc/vm/interp_masm_sparc.cpp
@@ -518,7 +518,8 @@ void InterpreterMacroAssembler::empty_expression_stack() {
delayed()->nop();
// Compute max expression stack+register save area
- lduh(Lmethod, in_bytes(Method::max_stack_offset()), Gframe_size); // Load max stack.
+ ld_ptr(Lmethod, in_bytes(Method::const_offset()), Gframe_size);
+ lduh(Gframe_size, in_bytes(ConstMethod::max_stack_offset()), Gframe_size); // Load max stack.
add( Gframe_size, frame::memory_parameter_word_sp_offset, Gframe_size );
//
diff --git a/src/cpu/sparc/vm/templateInterpreter_sparc.cpp b/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
index a6df245d2..d51b9e5bb 100644
--- a/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
+++ b/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
@@ -496,7 +496,7 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
const Address size_of_parameters(G5_method, Method::size_of_parameters_offset());
const Address size_of_locals (G5_method, Method::size_of_locals_offset());
- const Address max_stack (G5_method, Method::max_stack_offset());
+ const Address constMethod (G5_method, Method::const_offset());
int rounded_vm_local_words = round_to( frame::interpreter_frame_vm_local_words, WordsPerLong );
const int extra_space =
@@ -538,7 +538,8 @@ void TemplateInterpreterGenerator::generate_fixed_frame(bool native_call) {
// see if the frame is greater than one page in size. If so,
// then we need to verify there is enough stack space remaining
// Frame_size = (max_stack + extra_space) * BytesPerWord;
- __ lduh( max_stack, Gframe_size );
+ __ ld_ptr( constMethod, Gframe_size );
+ __ lduh( Gframe_size, in_bytes(ConstMethod::max_stack_offset()), Gframe_size );
__ add( Gframe_size, extra_space, Gframe_size );
__ round_to( Gframe_size, WordsPerLong );
__ sll( Gframe_size, Interpreter::logStackElementSize, Gframe_size);
diff --git a/src/cpu/x86/vm/cppInterpreter_x86.cpp b/src/cpu/x86/vm/cppInterpreter_x86.cpp
index 7161b2bc8..64a9463f8 100644
--- a/src/cpu/x86/vm/cppInterpreter_x86.cpp
+++ b/src/cpu/x86/vm/cppInterpreter_x86.cpp
@@ -538,9 +538,9 @@ void CppInterpreterGenerator::generate_compute_interpreter_state(const Register
// compute full expression stack limit
- const Address size_of_stack (rbx, Method::max_stack_offset());
const int extra_stack = 0; //6815692//Method::extra_stack_words();
- __ load_unsigned_short(rdx, size_of_stack); // get size of expression stack in words
+ __ movptr(rdx, Address(rbx, Method::const_offset()));
+ __ load_unsigned_short(rdx, Address(rdx, ConstMethod::max_stack_offset())); // get size of expression stack in words
__ negptr(rdx); // so we can subtract in next step
// Allocate expression stack
__ lea(rsp, Address(rsp, rdx, Address::times_ptr, -extra_stack));
@@ -682,12 +682,12 @@ void InterpreterGenerator::generate_stack_overflow_check(void) {
const Address stack_size(thread, Thread::stack_size_offset());
// locals + overhead, in bytes
- const Address size_of_stack (rbx, Method::max_stack_offset());
- // Always give one monitor to allow us to start interp if sync method.
- // Any additional monitors need a check when moving the expression stack
- const int one_monitor = frame::interpreter_frame_monitor_size() * wordSize;
- const int extra_stack = 0; //6815692//Method::extra_stack_entries();
- __ load_unsigned_short(rax, size_of_stack); // get size of expression stack in words
+ // Always give one monitor to allow us to start interp if sync method.
+ // Any additional monitors need a check when moving the expression stack
+ const int one_monitor = frame::interpreter_frame_monitor_size() * wordSize;
+ const int extra_stack = 0; //6815692//Method::extra_stack_entries();
+ __ movptr(rax, Address(rbx, Method::const_offset()));
+ __ load_unsigned_short(rax, Address(rax, ConstMethod::max_stack_offset())); // get size of expression stack in words
__ lea(rax, Address(noreg, rax, Interpreter::stackElementScale(), extra_stack + one_monitor));
__ lea(rax, Address(rax, rdx, Interpreter::stackElementScale(), overhead_size));
diff --git a/src/share/vm/classfile/classFileParser.cpp b/src/share/vm/classfile/classFileParser.cpp
index f53fff63d..8cffefd55 100644
--- a/src/share/vm/classfile/classFileParser.cpp
+++ b/src/share/vm/classfile/classFileParser.cpp
@@ -2184,7 +2184,7 @@ methodHandle ClassFileParser::parse_method(ClassLoaderData* loader_data,
Method* m = Method::allocate(
loader_data, code_length, access_flags, linenumber_table_length,
total_lvt_length, exception_table_length, checked_exceptions_length,
- ConstMethod::NORMAL, CHECK_(nullHandle));
+ generic_signature_index, ConstMethod::NORMAL, CHECK_(nullHandle));
ClassLoadingService::add_class_method_size(m->size()*HeapWordSize);
@@ -2192,7 +2192,6 @@ methodHandle ClassFileParser::parse_method(ClassLoaderData* loader_data,
m->set_constants(cp());
m->set_name_index(name_index);
m->set_signature_index(signature_index);
- m->set_generic_signature_index(generic_signature_index);
#ifdef CC_INTERP
// hmm is there a gc issue here??
ResultTypeFinder rtf(cp->symbol_at(signature_index));
diff --git a/src/share/vm/classfile/defaultMethods.cpp b/src/share/vm/classfile/defaultMethods.cpp
index 9ac1bef7a..1f4eefa79 100644
--- a/src/share/vm/classfile/defaultMethods.cpp
+++ b/src/share/vm/classfile/defaultMethods.cpp
@@ -1148,12 +1148,11 @@ static Method* new_method(
int code_length = bytecodes->length();
Method* m = Method::allocate(cp->pool_holder()->class_loader_data(),
- code_length, flags, 0, 0, 0, 0, mt, CHECK_NULL);
+ code_length, flags, 0, 0, 0, 0, 0, mt, CHECK_NULL);
m->set_constants(NULL); // This will get filled in later
m->set_name_index(cp->utf8(name));
m->set_signature_index(cp->utf8(sig));
- m->set_generic_signature_index(0);
#ifdef CC_INTERP
ResultTypeFinder rtf(sig);
m->set_result_index(rtf.type());
diff --git a/src/share/vm/oops/constMethod.cpp b/src/share/vm/oops/constMethod.cpp
index 7f89d61ee..10b057b4f 100644
--- a/src/share/vm/oops/constMethod.cpp
+++ b/src/share/vm/oops/constMethod.cpp
@@ -39,16 +39,19 @@ ConstMethod* ConstMethod::allocate(ClassLoaderData* loader_data,
int localvariable_table_length,
int exception_table_length,
int checked_exceptions_length,
+ u2 generic_signature_index,
MethodType method_type,
TRAPS) {
int size = ConstMethod::size(byte_code_size,
compressed_line_number_size,
localvariable_table_length,
exception_table_length,
- checked_exceptions_length);
+ checked_exceptions_length,
+ generic_signature_index);
return new (loader_data, size, true, THREAD) ConstMethod(
byte_code_size, compressed_line_number_size, localvariable_table_length,
- exception_table_length, checked_exceptions_length, method_type, size);
+ exception_table_length, checked_exceptions_length, generic_signature_index,
+ method_type, size);
}
ConstMethod::ConstMethod(int byte_code_size,
@@ -56,6 +59,7 @@ ConstMethod::ConstMethod(int byte_code_size,
int localvariable_table_length,
int exception_table_length,
int checked_exceptions_length,
+ u2 generic_signature_index,
MethodType method_type,
int size) {
@@ -66,7 +70,8 @@ ConstMethod::ConstMethod(int byte_code_size,
set_stackmap_data(NULL);
set_code_size(byte_code_size);
set_constMethod_size(size);
- set_inlined_tables_length(checked_exceptions_length,
+ set_inlined_tables_length(generic_signature_index,
+ checked_exceptions_length,
compressed_line_number_size,
localvariable_table_length,
exception_table_length);
@@ -90,7 +95,8 @@ int ConstMethod::size(int code_size,
int compressed_line_number_size,
int local_variable_table_length,
int exception_table_length,
- int checked_exceptions_length) {
+ int checked_exceptions_length,
+ u2 generic_signature_index) {
int extra_bytes = code_size;
if (compressed_line_number_size > 0) {
extra_bytes += compressed_line_number_size;
@@ -108,6 +114,9 @@ int ConstMethod::size(int code_size,
extra_bytes += sizeof(u2);
extra_bytes += exception_table_length * sizeof(ExceptionTableElement);
}
+ if (generic_signature_index != 0) {
+ extra_bytes += sizeof(u2);
+ }
int extra_words = align_size_up(extra_bytes, BytesPerWord) / BytesPerWord;
return align_object_size(header_size() + extra_words);
}
@@ -125,20 +134,29 @@ u_char* ConstMethod::compressed_linenumber_table() const {
return code_end();
}
-u2* ConstMethod::checked_exceptions_length_addr() const {
+u2* ConstMethod::generic_signature_index_addr() const {
// Located at the end of the constMethod.
- assert(has_checked_exceptions(), "called only if table is present");
+ assert(has_generic_signature(), "called only if generic signature exists");
return last_u2_element();
}
+u2* ConstMethod::checked_exceptions_length_addr() const {
+ // Located immediately before the generic signature index.
+ assert(has_checked_exceptions(), "called only if table is present");
+ return has_generic_signature() ? (last_u2_element() - 1) :
+ last_u2_element();
+}
+
u2* ConstMethod::exception_table_length_addr() const {
assert(has_exception_handler(), "called only if table is present");
if (has_checked_exceptions()) {
// If checked_exception present, locate immediately before them.
return (u2*) checked_exceptions_start() - 1;
} else {
- // Else, the exception table is at the end of the constMethod.
- return last_u2_element();
+ // Else, the exception table is at the end of the constMethod or
+ // immediately before the generic signature index.
+ return has_generic_signature() ? (last_u2_element() - 1) :
+ last_u2_element();
}
}
@@ -152,25 +170,30 @@ u2* ConstMethod::localvariable_table_length_addr() const {
// If checked_exception present, locate immediately before them.
return (u2*) checked_exceptions_start() - 1;
} else {
- // Else, the linenumber table is at the end of the constMethod.
- return last_u2_element();
+ // Else, the linenumber table is at the end of the constMethod or
+ // immediately before the generic signature index.
+ return has_generic_signature() ? (last_u2_element() - 1) :
+ last_u2_element();
}
}
}
-
// Update the flags to indicate the presence of these optional fields.
-void ConstMethod::set_inlined_tables_length(
- int checked_exceptions_len,
- int compressed_line_number_size,
- int localvariable_table_len,
- int exception_table_len) {
+void ConstMethod::set_inlined_tables_length(u2 generic_signature_index,
+ int checked_exceptions_len,
+ int compressed_line_number_size,
+ int localvariable_table_len,
+ int exception_table_len) {
// Must be done in the order below, otherwise length_addr accessors
// will not work. Only set bit in header if length is positive.
assert(_flags == 0, "Error");
if (compressed_line_number_size > 0) {
_flags |= _has_linenumber_table;
}
+ if (generic_signature_index != 0) {
+ _flags |= _has_generic_signature;
+ *(generic_signature_index_addr()) = generic_signature_index;
+ }
if (checked_exceptions_len > 0) {
_flags |= _has_checked_exceptions;
*(checked_exceptions_length_addr()) = checked_exceptions_len;
diff --git a/src/share/vm/oops/constMethod.hpp b/src/share/vm/oops/constMethod.hpp
index 9712eee57..771bf7b16 100644
--- a/src/share/vm/oops/constMethod.hpp
+++ b/src/share/vm/oops/constMethod.hpp
@@ -45,7 +45,7 @@
// | constMethod_size |
// | interp_kind | flags | code_size |
// | name index | signature index |
-// | method_idnum | generic_signature_index |
+// | method_idnum | max_stack |
// |------------------------------------------------------|
// | |
// | byte codes |
@@ -55,26 +55,29 @@
// | (see class CompressedLineNumberReadStream) |
// | (note that length is unknown until decompressed) |
// | (access flags bit tells whether table is present) |
-// | (indexed from start of ConstMethod*) |
+// | (indexed from start of ConstMethod*) |
// | (elements not necessarily sorted!) |
// |------------------------------------------------------|
// | localvariable table elements + length (length last) |
// | (length is u2, elements are 6-tuples of u2) |
// | (see class LocalVariableTableElement) |
// | (access flags bit tells whether table is present) |
-// | (indexed from end of ConstMethod*) |
+// | (indexed from end of ConstMethod*) |
// |------------------------------------------------------|
// | exception table + length (length last) |
// | (length is u2, elements are 4-tuples of u2) |
// | (see class ExceptionTableElement) |
// | (access flags bit tells whether table is present) |
-// | (indexed from end of ConstMethod*) |
+// | (indexed from end of ConstMethod*) |
// |------------------------------------------------------|
// | checked exceptions elements + length (length last) |
// | (length is u2, elements are u2) |
// | (see class CheckedExceptionElement) |
// | (access flags bit tells whether table is present) |
-// | (indexed from end of ConstMethod*) |
+// | (indexed from end of ConstMethod*) |
+// |------------------------------------------------------|
+// | generic signature index (u2) |
+// | (indexed from start of constMethodOop) |
// |------------------------------------------------------|
@@ -118,7 +121,8 @@ private:
_has_checked_exceptions = 2,
_has_localvariable_table = 4,
_has_exception_table = 8,
- _is_overpass = 16
+ _has_generic_signature = 16,
+ _is_overpass = 32
};
// Bit vector of signature
@@ -145,7 +149,7 @@ private:
u2 _method_idnum; // unique identification number for the method within the class
// initially corresponds to the index into the methods array.
// but this may change with redefinition
- u2 _generic_signature_index; // Generic signature (index in constant pool, 0 if absent)
+ u2 _max_stack; // Maximum number of entries on the expression stack
// Constructor
@@ -154,6 +158,7 @@ private:
int localvariable_table_length,
int exception_table_length,
int checked_exceptions_length,
+ u2 generic_signature_index,
MethodType is_overpass,
int size);
public:
@@ -164,17 +169,22 @@ public:
int localvariable_table_length,
int exception_table_length,
int checked_exceptions_length,
+ u2 generic_signature_index,
MethodType mt,
TRAPS);
bool is_constMethod() const { return true; }
// Inlined tables
- void set_inlined_tables_length(int checked_exceptions_len,
+ void set_inlined_tables_length(u2 generic_signature_index,
+ int checked_exceptions_len,
int compressed_line_number_size,
int localvariable_table_len,
int exception_table_len);
+ bool has_generic_signature() const
+ { return (_flags & _has_generic_signature) != 0; }
+
bool has_linenumber_table() const
{ return (_flags & _has_linenumber_table) != 0; }
@@ -252,8 +262,18 @@ public:
void set_signature_index(int index) { _signature_index = index; }
// generics support
- int generic_signature_index() const { return _generic_signature_index; }
- void set_generic_signature_index(int index) { _generic_signature_index = index; }
+ int generic_signature_index() const {
+ if (has_generic_signature()) {
+ return *generic_signature_index_addr();
+ } else {
+ return 0;
+ }
+ }
+ void set_generic_signature_index(u2 index) {
+ assert(has_generic_signature(), "");
+ u2* addr = generic_signature_index_addr();
+ *addr = index;
+ }
// Sizing
static int header_size() {
@@ -264,7 +284,8 @@ public:
static int size(int code_size, int compressed_line_number_size,
int local_variable_table_length,
int exception_table_length,
- int checked_exceptions_length);
+ int checked_exceptions_length,
+ u2 generic_signature_index);
int size() const { return _constMethod_size;}
void set_constMethod_size(int size) { _constMethod_size = size; }
@@ -281,6 +302,7 @@ public:
// linenumber table - note that length is unknown until decompression,
// see class CompressedLineNumberReadStream.
u_char* compressed_linenumber_table() const; // not preserved by gc
+ u2* generic_signature_index_addr() const;
u2* checked_exceptions_length_addr() const;
u2* localvariable_table_length_addr() const;
u2* exception_table_length_addr() const;
@@ -314,12 +336,19 @@ public:
static ByteSize constants_offset()
{ return byte_offset_of(ConstMethod, _constants); }
+ static ByteSize max_stack_offset()
+ { return byte_offset_of(ConstMethod, _max_stack); }
+
// Unique id for the method
static const u2 MAX_IDNUM;
static const u2 UNSET_IDNUM;
u2 method_idnum() const { return _method_idnum; }
void set_method_idnum(u2 idnum) { _method_idnum = idnum; }
+ // max stack
+ int max_stack() const { return _max_stack; }
+ void set_max_stack(int size) { _max_stack = size; }
+
// Deallocation for RedefineClasses
void deallocate_contents(ClassLoaderData* loader_data);
bool is_klass() const { return false; }
diff --git a/src/share/vm/oops/method.cpp b/src/share/vm/oops/method.cpp
index 413efedce..5818d58c2 100644
--- a/src/share/vm/oops/method.cpp
+++ b/src/share/vm/oops/method.cpp
@@ -64,6 +64,7 @@ Method* Method::allocate(ClassLoaderData* loader_data,
int localvariable_table_length,
int exception_table_length,
int checked_exceptions_length,
+ u2 generic_signature_index,
ConstMethod::MethodType method_type,
TRAPS) {
assert(!access_flags.is_native() || byte_code_size == 0,
@@ -74,6 +75,7 @@ Method* Method::allocate(ClassLoaderData* loader_data,
localvariable_table_length,
exception_table_length,
checked_exceptions_length,
+ generic_signature_index,
method_type,
CHECK_NULL);
@@ -1034,7 +1036,7 @@ methodHandle Method::make_method_handle_intrinsic(vmIntrinsics::ID iid,
methodHandle m;
{
Method* m_oop = Method::allocate(loader_data, 0, accessFlags_from(flags_bits),
- 0, 0, 0, 0, ConstMethod::NORMAL, CHECK_(empty));
+ 0, 0, 0, 0, 0, ConstMethod::NORMAL, CHECK_(empty));
m = methodHandle(THREAD, m_oop);
}
m->set_constants(cp());
@@ -1082,6 +1084,7 @@ methodHandle Method::clone_with_new_data(methodHandle m, u_char* new_code, int n
assert(!m->is_native(), "cannot rewrite native methods");
// Allocate new Method*
AccessFlags flags = m->access_flags();
+ u2 generic_signature_index = m->generic_signature_index();
int checked_exceptions_len = m->checked_exceptions_length();
int localvariable_len = m->localvariable_table_length();
int exception_table_len = m->exception_table_length();
@@ -1094,6 +1097,7 @@ methodHandle Method::clone_with_new_data(methodHandle m, u_char* new_code, int n
localvariable_len,
exception_table_len,
checked_exceptions_len,
+ generic_signature_index,
m->method_type(),
CHECK_(methodHandle()));
methodHandle newm (THREAD, newm_oop);
diff --git a/src/share/vm/oops/method.hpp b/src/share/vm/oops/method.hpp
index 6ebf8c66f..ff7bc0ee5 100644
--- a/src/share/vm/oops/method.hpp
+++ b/src/share/vm/oops/method.hpp
@@ -73,12 +73,10 @@
// |------------------------------------------------------|
// | result_index (C++ interpreter only) |
// |------------------------------------------------------|
-// | method_size | max_stack |
-// | max_locals | size_of_parameters |
+// | method_size | max_locals |
+// | size_of_parameters | intrinsic_id| flags |
// |------------------------------------------------------|
-// |intrinsic_id| flags | throwout_count |
-// |------------------------------------------------------|
-// | num_breakpoints | (unused) |
+// | throwout_count | num_breakpoints |
// |------------------------------------------------------|
// | invocation_counter |
// | backedge_counter |
@@ -118,7 +116,6 @@ class Method : public Metadata {
int _result_index; // C++ interpreter needs for converting results to/from stack
#endif
u2 _method_size; // size of this object
- u2 _max_stack; // Maximum number of entries on the expression stack
u2 _max_locals; // Number of local variables used by this method
u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words
u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
@@ -166,6 +163,7 @@ class Method : public Metadata {
int localvariable_table_length,
int exception_table_length,
int checked_exceptions_length,
+ u2 generic_signature_index,
ConstMethod::MethodType method_type,
TRAPS);
@@ -289,9 +287,9 @@ class Method : public Metadata {
// max stack
// return original max stack size for method verification
- int verifier_max_stack() const { return _max_stack; }
- int max_stack() const { return _max_stack + extra_stack_entries(); }
- void set_max_stack(int size) { _max_stack = size; }
+ 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); }
// max locals
int max_locals() const { return _max_locals; }
@@ -607,7 +605,6 @@ class Method : public Metadata {
static ByteSize from_interpreted_offset() { return byte_offset_of(Method, _from_interpreted_entry ); }
static ByteSize interpreter_entry_offset() { return byte_offset_of(Method, _i2i_entry ); }
static ByteSize signature_handler_offset() { return in_ByteSize(sizeof(Method) + wordSize); }
- static ByteSize max_stack_offset() { return byte_offset_of(Method, _max_stack ); }
// for code generation
static int method_data_offset_in_bytes() { return offset_of(Method, _method_data); }
diff --git a/src/share/vm/runtime/vmStructs.cpp b/src/share/vm/runtime/vmStructs.cpp
index ffb35a04c..9346d6c72 100644
--- a/src/share/vm/runtime/vmStructs.cpp
+++ b/src/share/vm/runtime/vmStructs.cpp
@@ -355,7 +355,6 @@ typedef BinaryTreeDictionary<Metablock, FreeList> MetablockTreeDictionary;
nonstatic_field(Method, _access_flags, AccessFlags) \
nonstatic_field(Method, _vtable_index, int) \
nonstatic_field(Method, _method_size, u2) \
- nonstatic_field(Method, _max_stack, u2) \
nonstatic_field(Method, _max_locals, u2) \
nonstatic_field(Method, _size_of_parameters, u2) \
nonstatic_field(Method, _interpreter_throwout_count, u2) \
@@ -378,7 +377,7 @@ typedef BinaryTreeDictionary<Metablock, FreeList> MetablockTreeDictionary;
nonstatic_field(ConstMethod, _name_index, u2) \
nonstatic_field(ConstMethod, _signature_index, u2) \
nonstatic_field(ConstMethod, _method_idnum, u2) \
- nonstatic_field(ConstMethod, _generic_signature_index, u2) \
+ nonstatic_field(ConstMethod, _max_stack, u2) \
nonstatic_field(ObjArrayKlass, _element_klass, Klass*) \
nonstatic_field(ObjArrayKlass, _bottom_klass, Klass*) \
volatile_nonstatic_field(Symbol, _refcount, int) \
@@ -2280,6 +2279,7 @@ typedef BinaryTreeDictionary<Metablock, FreeList> MetablockTreeDictionary;
declare_constant(ConstMethod::_has_checked_exceptions) \
declare_constant(ConstMethod::_has_localvariable_table) \
declare_constant(ConstMethod::_has_exception_table) \
+ declare_constant(ConstMethod::_has_generic_signature) \
\
/*************************************/ \
/* InstanceKlass enum */ \