< prev index next >

src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp

Print this page
rev 50922 : Don't generate arraycopy pre-barrier calls for traversal GC


  10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  11  * version 2 for more details (a copy is included in the LICENSE file that
  12  * accompanied this code).
  13  *
  14  * You should have received a copy of the GNU General Public License version
  15  * 2 along with this work; if not, write to the Free Software Foundation,
  16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17  *
  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #include "precompiled.hpp"
  25 #include "gc/shenandoah/brooksPointer.hpp"
  26 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
  27 #include "gc/shenandoah/shenandoahConnectionMatrix.hpp"
  28 #include "gc/shenandoah/shenandoahHeap.hpp"
  29 #include "gc/shenandoah/shenandoahHeapRegion.hpp"

  30 #include "gc/shenandoah/shenandoahRuntime.hpp"
  31 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
  32 #include "interpreter/interpreter.hpp"
  33 #include "interpreter/interp_masm.hpp"
  34 #include "runtime/sharedRuntime.hpp"
  35 #include "runtime/thread.hpp"
  36 #include "utilities/macros.hpp"
  37 #ifdef COMPILER1
  38 #include "c1/c1_LIRAssembler.hpp"
  39 #include "c1/c1_MacroAssembler.hpp"
  40 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
  41 #endif
  42 
  43 #define __ masm->
  44 
  45 address ShenandoahBarrierSetAssembler::_shenandoah_wb = NULL;
  46 address ShenandoahBarrierSetAssembler::_shenandoah_wb_C = NULL;
  47 
  48 void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
  49                                                        Register src, Register dst, Register count) {
  50 





  51   bool checkcast = (decorators & ARRAYCOPY_CHECKCAST) != 0;
  52   bool disjoint = (decorators & ARRAYCOPY_DISJOINT) != 0;
  53   bool obj_int = type == T_OBJECT LP64_ONLY(&& UseCompressedOops);
  54   bool dest_uninitialized = (decorators & AS_DEST_NOT_INITIALIZED) != 0;
  55 
  56   if (type == T_OBJECT || type == T_ARRAY) {
  57 #ifdef _LP64
  58     if (!checkcast && !obj_int) {
  59       // Save count for barrier
  60       __ movptr(r11, count);
  61     } else if (disjoint && obj_int) {
  62       // Save dst in r11 in the disjoint case
  63       __ movq(r11, dst);
  64     }
  65 #else
  66     if (disjoint) {
  67       __ mov(rdx, dst);          // save 'to'
  68     }
  69 #endif
  70 




  10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  11  * version 2 for more details (a copy is included in the LICENSE file that
  12  * accompanied this code).
  13  *
  14  * You should have received a copy of the GNU General Public License version
  15  * 2 along with this work; if not, write to the Free Software Foundation,
  16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17  *
  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #include "precompiled.hpp"
  25 #include "gc/shenandoah/brooksPointer.hpp"
  26 #include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
  27 #include "gc/shenandoah/shenandoahConnectionMatrix.hpp"
  28 #include "gc/shenandoah/shenandoahHeap.hpp"
  29 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
  30 #include "gc/shenandoah/shenandoahHeuristics.hpp"
  31 #include "gc/shenandoah/shenandoahRuntime.hpp"
  32 #include "gc/shenandoah/shenandoahThreadLocalData.hpp"
  33 #include "interpreter/interpreter.hpp"
  34 #include "interpreter/interp_masm.hpp"
  35 #include "runtime/sharedRuntime.hpp"
  36 #include "runtime/thread.hpp"
  37 #include "utilities/macros.hpp"
  38 #ifdef COMPILER1
  39 #include "c1/c1_LIRAssembler.hpp"
  40 #include "c1/c1_MacroAssembler.hpp"
  41 #include "gc/shenandoah/c1/shenandoahBarrierSetC1.hpp"
  42 #endif
  43 
  44 #define __ masm->
  45 
  46 address ShenandoahBarrierSetAssembler::_shenandoah_wb = NULL;
  47 address ShenandoahBarrierSetAssembler::_shenandoah_wb_C = NULL;
  48 
  49 void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
  50                                                        Register src, Register dst, Register count) {
  51 
  52   if (ShenandoahHeap::heap()->heuristics()->can_do_traversal_gc()) {
  53     // Don't need arraycopy-pre-barrier for traversal. No need to pointlessly
  54     // call out to runtime.
  55     return;
  56   }
  57   bool checkcast = (decorators & ARRAYCOPY_CHECKCAST) != 0;
  58   bool disjoint = (decorators & ARRAYCOPY_DISJOINT) != 0;
  59   bool obj_int = type == T_OBJECT LP64_ONLY(&& UseCompressedOops);
  60   bool dest_uninitialized = (decorators & AS_DEST_NOT_INITIALIZED) != 0;
  61 
  62   if (type == T_OBJECT || type == T_ARRAY) {
  63 #ifdef _LP64
  64     if (!checkcast && !obj_int) {
  65       // Save count for barrier
  66       __ movptr(r11, count);
  67     } else if (disjoint && obj_int) {
  68       // Save dst in r11 in the disjoint case
  69       __ movq(r11, dst);
  70     }
  71 #else
  72     if (disjoint) {
  73       __ mov(rdx, dst);          // save 'to'
  74     }
  75 #endif
  76 


< prev index next >