Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/g1BiasedArray.cpp @ 17760:5479cb006184
8036860: Pad and cache-align the BiasedMappedArray
Summary: Pad and cache-align BiasedMappedArray instances by default to avoid performance variability problems due to false sharing, as instances of this data structures are typically used for performance sensitive code.
Reviewed-by: brutisso, stefank
author | tschatzl |
---|---|
date | Mon, 24 Mar 2014 15:31:00 +0100 |
parents | a19bea467577 |
children | 78bbf4d43a14 |
comparison
equal
deleted
inserted
replaced
17759:bc22cbb8b45a | 17760:5479cb006184 |
---|---|
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #include "precompiled.hpp" | 25 #include "precompiled.hpp" |
26 #include "gc_implementation/g1/g1BiasedArray.hpp" | 26 #include "gc_implementation/g1/g1BiasedArray.hpp" |
27 #include "memory/padded.inline.hpp" | |
28 | |
29 // Allocate a new array, generic version. | |
30 address G1BiasedMappedArrayBase::create_new_base_array(size_t length, size_t elem_size) { | |
31 assert(length > 0, "just checking"); | |
32 assert(elem_size > 0, "just checking"); | |
33 return PaddedPrimitiveArray<u_char, mtGC>::create_unfreeable(length * elem_size); | |
34 } | |
27 | 35 |
28 #ifndef PRODUCT | 36 #ifndef PRODUCT |
29 void G1BiasedMappedArrayBase::verify_index(idx_t index) const { | 37 void G1BiasedMappedArrayBase::verify_index(idx_t index) const { |
30 guarantee(_base != NULL, "Array not initialized"); | 38 guarantee(_base != NULL, "Array not initialized"); |
31 guarantee(index < length(), err_msg("Index out of bounds index: "SIZE_FORMAT" length: "SIZE_FORMAT, index, length())); | 39 guarantee(index < length(), err_msg("Index out of bounds index: "SIZE_FORMAT" length: "SIZE_FORMAT, index, length())); |