Mercurial > hg > truffle
comparison src/share/vm/oops/method.hpp @ 14521:29ccc4cbabca
Merge
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 12 Mar 2014 13:30:08 +0100 |
parents | d8041d695d19 |
children | b51e29501f30 |
comparison
equal
deleted
inserted
replaced
14520:f84115370178 | 14521:29ccc4cbabca |
---|---|
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. | |
47 // | 45 // |
48 // The actual bytecodes are inlined after the end of the Method struct. | 46 // The actual bytecodes are inlined after the end of the Method struct. |
49 // | 47 // |
50 // There are bits in the access_flags telling whether inlined tables are present. | 48 // There are bits in the access_flags telling whether inlined tables are present. |
51 // Note that accessing the line number and local variable tables is not performance critical at all. | 49 // Note that accessing the line number and local variable tables is not performance critical at all. |
62 // | 60 // |
63 // |------------------------------------------------------| | 61 // |------------------------------------------------------| |
64 // | header | | 62 // | header | |
65 // | klass | | 63 // | klass | |
66 // |------------------------------------------------------| | 64 // |------------------------------------------------------| |
67 // | ConstMethod* (oop) | | 65 // | ConstMethod* (metadata) | |
68 // |------------------------------------------------------| | 66 // |------------------------------------------------------| |
69 // | methodData (oop) | | 67 // | MethodData* (metadata) | |
70 // | methodCounters | | 68 // | MethodCounters | |
71 // |------------------------------------------------------| | 69 // |------------------------------------------------------| |
72 // | access_flags | | 70 // | access_flags | |
73 // | vtable_index | | 71 // | vtable_index | |
74 // |------------------------------------------------------| | 72 // |------------------------------------------------------| |
75 // | result_index (C++ interpreter only) | | 73 // | result_index (C++ interpreter only) | |
76 // |------------------------------------------------------| | 74 // |------------------------------------------------------| |
77 // | method_size | intrinsic_id| flags | | 75 // | method_size | intrinsic_id | flags | |
78 // |------------------------------------------------------| | 76 // |------------------------------------------------------| |
79 // | code (pointer) | | 77 // | code (pointer) | |
80 // | i2i (pointer) | | 78 // | i2i (pointer) | |
81 // | adapter (pointer) | | 79 // | adapter (pointer) | |
82 // | from_compiled_entry (pointer) | | 80 // | from_compiled_entry (pointer) | |
348 MethodData* method_data() const { | 346 MethodData* method_data() const { |
349 return _method_data; | 347 return _method_data; |
350 } | 348 } |
351 | 349 |
352 void set_method_data(MethodData* data) { | 350 void set_method_data(MethodData* data) { |
353 _method_data = data; | 351 // The store into method must be released. On platforms without |
352 // total store order (TSO) the reference may become visible before | |
353 // the initialization of data otherwise. | |
354 OrderAccess::release_store_ptr((volatile void *)&_method_data, data); | |
354 } | 355 } |
355 | 356 |
356 MethodCounters* method_counters() const { | 357 MethodCounters* method_counters() const { |
357 return _method_counters; | 358 return _method_counters; |
358 } | 359 } |
359 | 360 |
360 | |
361 void set_method_counters(MethodCounters* counters) { | 361 void set_method_counters(MethodCounters* counters) { |
362 _method_counters = counters; | 362 // The store into method must be released. On platforms without |
363 // total store order (TSO) the reference may become visible before | |
364 // the initialization of data otherwise. | |
365 OrderAccess::release_store_ptr((volatile void *)&_method_counters, counters); | |
363 } | 366 } |
364 | 367 |
365 #ifdef TIERED | 368 #ifdef TIERED |
366 // We are reusing interpreter_invocation_count as a holder for the previous event count! | 369 // We are reusing interpreter_invocation_count as a holder for the previous event count! |
367 // We can do that since interpreter_invocation_count is not used in tiered. | 370 // We can do that since interpreter_invocation_count is not used in tiered. |