comparison src/share/vm/oops/method.hpp @ 14909:4ca6dc0799b6

Backout jdk9 merge
author Gilles Duboscq <duboscq@ssw.jku.at>
date Tue, 01 Apr 2014 13:57:07 +0200
parents 8b772174c514
children 52b4284cb496
comparison
equal deleted inserted replaced
14908:8db6e76cb658 14909:4ca6dc0799b6
36 #include "oops/oop.hpp" 36 #include "oops/oop.hpp"
37 #include "oops/typeArrayOop.hpp" 37 #include "oops/typeArrayOop.hpp"
38 #include "utilities/accessFlags.hpp" 38 #include "utilities/accessFlags.hpp"
39 #include "utilities/growableArray.hpp" 39 #include "utilities/growableArray.hpp"
40 40
41 // A Method represents a Java method. 41 // A Method* represents a Java method.
42 // 42 //
43 // Memory layout (each line represents a word). Note that most applications load thousands of methods, 43 // Memory layout (each line represents a word). Note that most applications load thousands of methods,
44 // so keeping the size of this structure small has a big impact on footprint. 44 // so keeping the size of this structure small has a big impact on footprint.
45 //
46 // We put all oops and method_size first for better gc cache locality.
45 // 47 //
46 // The actual bytecodes are inlined after the end of the Method struct. 48 // The actual bytecodes are inlined after the end of the Method struct.
47 // 49 //
48 // There are bits in the access_flags telling whether inlined tables are present. 50 // There are bits in the access_flags telling whether inlined tables are present.
49 // Note that accessing the line number and local variable tables is not performance critical at all. 51 // Note that accessing the line number and local variable tables is not performance critical at all.
60 // 62 //
61 // |------------------------------------------------------| 63 // |------------------------------------------------------|
62 // | header | 64 // | header |
63 // | klass | 65 // | klass |
64 // |------------------------------------------------------| 66 // |------------------------------------------------------|
65 // | ConstMethod* (metadata) | 67 // | ConstMethod* (oop) |
66 // |------------------------------------------------------| 68 // |------------------------------------------------------|
67 // | MethodData* (metadata) | 69 // | methodData (oop) |
68 // | MethodCounters | 70 // | methodCounters |
69 // |------------------------------------------------------| 71 // |------------------------------------------------------|
70 // | access_flags | 72 // | access_flags |
71 // | vtable_index | 73 // | vtable_index |
72 // |------------------------------------------------------| 74 // |------------------------------------------------------|
73 // | result_index (C++ interpreter only) | 75 // | result_index (C++ interpreter only) |
74 // |------------------------------------------------------| 76 // |------------------------------------------------------|
75 // | method_size | intrinsic_id | flags | 77 // | method_size | intrinsic_id| flags |
76 // |------------------------------------------------------| 78 // |------------------------------------------------------|
77 // | code (pointer) | 79 // | code (pointer) |
78 // | i2i (pointer) | 80 // | i2i (pointer) |
79 // | adapter (pointer) | 81 // | adapter (pointer) |
80 // | from_compiled_entry (pointer) | 82 // | from_compiled_entry (pointer) |
106 #ifdef CC_INTERP 108 #ifdef CC_INTERP
107 int _result_index; // C++ interpreter needs for converting results to/from stack 109 int _result_index; // C++ interpreter needs for converting results to/from stack
108 #endif 110 #endif
109 u2 _method_size; // size of this object 111 u2 _method_size; // size of this object
110 u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none) 112 u1 _intrinsic_id; // vmSymbols::intrinsic_id (0 == _none)
113
111 // Flags 114 // Flags
112 enum Flags { 115 enum Flags {
113 _jfr_towrite = 1 << 0, 116 _jfr_towrite = 1 << 0,
114 _caller_sensitive = 1 << 1, 117 _caller_sensitive = 1 << 1,
115 _force_inline = 1 << 2, 118 _force_inline = 1 << 2,
349 MethodData* method_data() const { 352 MethodData* method_data() const {
350 return _method_data; 353 return _method_data;
351 } 354 }
352 355
353 void set_method_data(MethodData* data) { 356 void set_method_data(MethodData* data) {
354 // The store into method must be released. On platforms without 357 _method_data = data;
355 // total store order (TSO) the reference may become visible before
356 // the initialization of data otherwise.
357 OrderAccess::release_store_ptr((volatile void *)&_method_data, data);
358 } 358 }
359 359
360 MethodCounters* method_counters() const { 360 MethodCounters* method_counters() const {
361 return _method_counters; 361 return _method_counters;
362 } 362 }
363 363
364
364 void set_method_counters(MethodCounters* counters) { 365 void set_method_counters(MethodCounters* counters) {
365 // The store into method must be released. On platforms without 366 _method_counters = counters;
366 // total store order (TSO) the reference may become visible before
367 // the initialization of data otherwise.
368 OrderAccess::release_store_ptr((volatile void *)&_method_counters, counters);
369 } 367 }
370 368
371 #ifdef TIERED 369 #ifdef TIERED
372 // We are reusing interpreter_invocation_count as a holder for the previous event count! 370 // We are reusing interpreter_invocation_count as a holder for the previous event count!
373 // We can do that since interpreter_invocation_count is not used in tiered. 371 // We can do that since interpreter_invocation_count is not used in tiered.