Mercurial > hg > truffle
diff 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 |
line wrap: on
line diff
--- a/src/share/vm/oops/method.hpp Tue Mar 11 15:34:06 2014 +0100 +++ b/src/share/vm/oops/method.hpp Wed Mar 12 13:30:08 2014 +0100 @@ -38,13 +38,11 @@ #include "utilities/accessFlags.hpp" #include "utilities/growableArray.hpp" -// A Method* represents a Java method. +// A Method represents a Java method. // // Memory layout (each line represents a word). Note that most applications load thousands of methods, // so keeping the size of this structure small has a big impact on footprint. // -// We put all oops and method_size first for better gc cache locality. -// // The actual bytecodes are inlined after the end of the Method struct. // // There are bits in the access_flags telling whether inlined tables are present. @@ -64,17 +62,17 @@ // | header | // | klass | // |------------------------------------------------------| -// | ConstMethod* (oop) | +// | ConstMethod* (metadata) | // |------------------------------------------------------| -// | methodData (oop) | -// | methodCounters | +// | MethodData* (metadata) | +// | MethodCounters | // |------------------------------------------------------| // | access_flags | // | vtable_index | // |------------------------------------------------------| // | result_index (C++ interpreter only) | // |------------------------------------------------------| -// | method_size | intrinsic_id| flags | +// | method_size | intrinsic_id | flags | // |------------------------------------------------------| // | code (pointer) | // | i2i (pointer) | @@ -350,16 +348,21 @@ } void set_method_data(MethodData* data) { - _method_data = data; + // The store into method must be released. On platforms without + // total store order (TSO) the reference may become visible before + // the initialization of data otherwise. + OrderAccess::release_store_ptr((volatile void *)&_method_data, data); } MethodCounters* method_counters() const { return _method_counters; } - void set_method_counters(MethodCounters* counters) { - _method_counters = counters; + // The store into method must be released. On platforms without + // total store order (TSO) the reference may become visible before + // the initialization of data otherwise. + OrderAccess::release_store_ptr((volatile void *)&_method_counters, counters); } #ifdef TIERED