Mercurial > hg > truffle
comparison src/share/vm/oops/constMethod.hpp @ 7402:fd74228fd5ca
8004076: Move _max_locals and _size_of_parameters to ConstMethod for better sharing.
Summary: Move _max_locals and _size_of_parameters to ConstMethod for better sharing.
Reviewed-by: coleenp, minqi, jrose
author | jiangli |
---|---|
date | Tue, 11 Dec 2012 12:41:31 -0500 |
parents | b2dbd323c668 |
children | ade95d680b42 |
comparison
equal
deleted
inserted
replaced
7396:4a2ed49abd51 | 7402:fd74228fd5ca |
---|---|
44 // | stackmap_data (oop) | | 44 // | stackmap_data (oop) | |
45 // | constMethod_size | | 45 // | constMethod_size | |
46 // | interp_kind | flags | code_size | | 46 // | interp_kind | flags | code_size | |
47 // | name index | signature index | | 47 // | name index | signature index | |
48 // | method_idnum | max_stack | | 48 // | method_idnum | max_stack | |
49 // | max_locals | size_of_parameters | | |
49 // |------------------------------------------------------| | 50 // |------------------------------------------------------| |
50 // | | | 51 // | | |
51 // | byte codes | | 52 // | byte codes | |
52 // | | | 53 // | | |
53 // |------------------------------------------------------| | 54 // |------------------------------------------------------| |
148 u2 _signature_index; // Method signature (index in constant pool) | 149 u2 _signature_index; // Method signature (index in constant pool) |
149 u2 _method_idnum; // unique identification number for the method within the class | 150 u2 _method_idnum; // unique identification number for the method within the class |
150 // initially corresponds to the index into the methods array. | 151 // initially corresponds to the index into the methods array. |
151 // but this may change with redefinition | 152 // but this may change with redefinition |
152 u2 _max_stack; // Maximum number of entries on the expression stack | 153 u2 _max_stack; // Maximum number of entries on the expression stack |
153 | 154 u2 _max_locals; // Number of local variables used by this method |
155 u2 _size_of_parameters; // size of the parameter block (receiver + arguments) in words | |
154 | 156 |
155 // Constructor | 157 // Constructor |
156 ConstMethod(int byte_code_size, | 158 ConstMethod(int byte_code_size, |
157 int compressed_line_number_size, | 159 int compressed_line_number_size, |
158 int localvariable_table_length, | 160 int localvariable_table_length, |
336 static ByteSize constants_offset() | 338 static ByteSize constants_offset() |
337 { return byte_offset_of(ConstMethod, _constants); } | 339 { return byte_offset_of(ConstMethod, _constants); } |
338 | 340 |
339 static ByteSize max_stack_offset() | 341 static ByteSize max_stack_offset() |
340 { return byte_offset_of(ConstMethod, _max_stack); } | 342 { return byte_offset_of(ConstMethod, _max_stack); } |
343 static ByteSize size_of_locals_offset() | |
344 { return byte_offset_of(ConstMethod, _max_locals); } | |
345 static ByteSize size_of_parameters_offset() | |
346 { return byte_offset_of(ConstMethod, _size_of_parameters); } | |
347 | |
341 | 348 |
342 // Unique id for the method | 349 // Unique id for the method |
343 static const u2 MAX_IDNUM; | 350 static const u2 MAX_IDNUM; |
344 static const u2 UNSET_IDNUM; | 351 static const u2 UNSET_IDNUM; |
345 u2 method_idnum() const { return _method_idnum; } | 352 u2 method_idnum() const { return _method_idnum; } |
347 | 354 |
348 // max stack | 355 // max stack |
349 int max_stack() const { return _max_stack; } | 356 int max_stack() const { return _max_stack; } |
350 void set_max_stack(int size) { _max_stack = size; } | 357 void set_max_stack(int size) { _max_stack = size; } |
351 | 358 |
359 // max locals | |
360 int max_locals() const { return _max_locals; } | |
361 void set_max_locals(int size) { _max_locals = size; } | |
362 | |
363 // size of parameters | |
364 int size_of_parameters() const { return _size_of_parameters; } | |
365 void set_size_of_parameters(int size) { _size_of_parameters = size; } | |
366 | |
352 // Deallocation for RedefineClasses | 367 // Deallocation for RedefineClasses |
353 void deallocate_contents(ClassLoaderData* loader_data); | 368 void deallocate_contents(ClassLoaderData* loader_data); |
354 bool is_klass() const { return false; } | 369 bool is_klass() const { return false; } |
355 DEBUG_ONLY(bool on_stack() { return false; }) | 370 DEBUG_ONLY(bool on_stack() { return false; }) |
356 | 371 |