hotspot/src/share/vm/memory/modRefBarrierSet.hpp
changeset 28830 a252e278c3d9
parent 27687 3a6367d7110b
child 29325 0e86e64c66e5
equal deleted inserted replaced
28718:6bb984acf342 28830:a252e278c3d9
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    35 class Generation;
    35 class Generation;
    36 
    36 
    37 class ModRefBarrierSet: public BarrierSet {
    37 class ModRefBarrierSet: public BarrierSet {
    38 public:
    38 public:
    39 
    39 
    40   ModRefBarrierSet() { _kind = BarrierSet::ModRef; }
       
    41 
       
    42   bool is_a(BarrierSet::Name bsn) {
    40   bool is_a(BarrierSet::Name bsn) {
    43     return bsn == BarrierSet::ModRef;
    41     return bsn == BarrierSet::ModRef;
    44   }
    42   }
    45 
    43 
    46   // Barriers only on ref writes.
    44   // Barriers only on ref writes.
    57   void write_prim_field(oop obj, size_t offset, size_t bytes,
    55   void write_prim_field(oop obj, size_t offset, size_t bytes,
    58                         juint val1, juint val2) {}
    56                         juint val1, juint val2) {}
    59 
    57 
    60   void read_ref_field(void* field) {}
    58   void read_ref_field(void* field) {}
    61   void read_prim_field(HeapWord* field, size_t bytes) {}
    59   void read_prim_field(HeapWord* field, size_t bytes) {}
       
    60 
    62 protected:
    61 protected:
       
    62 
       
    63   ModRefBarrierSet(BarrierSet::Name kind) : BarrierSet(kind) { }
       
    64   ~ModRefBarrierSet() { }
       
    65 
    63   virtual void write_ref_field_work(void* field, oop new_val, bool release = false) = 0;
    66   virtual void write_ref_field_work(void* field, oop new_val, bool release = false) = 0;
    64 public:
    67 public:
    65   void write_prim_field(HeapWord* field, size_t bytes,
    68   void write_prim_field(HeapWord* field, size_t bytes,
    66                         juint val1, juint val2) {}
    69                         juint val1, juint val2) {}
    67 
    70