src/cpu/x86/vm/stubGenerator_x86_32.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/cpu/x86/vm

src/cpu/x86/vm/stubGenerator_x86_32.cpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 689     __ pop(rdx);                                 // get saved rdx back
 690     __ popf();                                   // get saved EFLAGS off stack -- will be ignored
 691     __ pusha();                                  // push registers (eip = return address & msg are already pushed)
 692     BLOCK_COMMENT("call MacroAssembler::debug");
 693     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, MacroAssembler::debug32)));
 694     __ popa();
 695     __ ret(3 * wordSize);                        // pop arguments
 696     return start;
 697   }
 698 
 699   //
 700   //  Generate pre-barrier for array stores
 701   //
 702   //  Input:
 703   //     start   -  starting address
 704   //     count   -  element count
 705   void  gen_write_ref_array_pre_barrier(Register start, Register count, bool uninitialized_target) {
 706     assert_different_registers(start, count);
 707     BarrierSet* bs = Universe::heap()->barrier_set();
 708     switch (bs->kind()) {
 709       case BarrierSet::G1SATBCT:
 710       case BarrierSet::G1SATBCTLogging:
 711         // With G1, don't generate the call if we statically know that the target in uninitialized
 712         if (!uninitialized_target) {
 713            __ pusha();                      // push registers
 714            __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre),
 715                            start, count);
 716            __ popa();
 717          }
 718         break;
 719       case BarrierSet::CardTableModRef:
 720       case BarrierSet::CardTableExtension:
 721       case BarrierSet::ModRef:
 722         break;
 723       default      :
 724         ShouldNotReachHere();
 725 
 726     }
 727   }
 728 
 729 
 730   //
 731   // Generate a post-barrier for an array store
 732   //
 733   //     start    -  starting address
 734   //     count    -  element count
 735   //
 736   //  The two input registers are overwritten.
 737   //
 738   void  gen_write_ref_array_post_barrier(Register start, Register count) {
 739     BarrierSet* bs = Universe::heap()->barrier_set();
 740     assert_different_registers(start, count);
 741     switch (bs->kind()) {
 742       case BarrierSet::G1SATBCT:
 743       case BarrierSet::G1SATBCTLogging:
 744         {
 745           __ pusha();                      // push registers
 746           __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post),
 747                           start, count);
 748           __ popa();
 749         }
 750         break;
 751 
 752       case BarrierSet::CardTableModRef:
 753       case BarrierSet::CardTableExtension:
 754         {
 755           CardTableModRefBS* ct = (CardTableModRefBS*)bs;
 756           assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
 757 
 758           Label L_loop;
 759           const Register end = count;  // elements count; end == start+count-1
 760           assert_different_registers(start, end);
 761 
 762           __ lea(end,  Address(start, count, Address::times_ptr, -wordSize));


   1 /*
   2  * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 689     __ pop(rdx);                                 // get saved rdx back
 690     __ popf();                                   // get saved EFLAGS off stack -- will be ignored
 691     __ pusha();                                  // push registers (eip = return address & msg are already pushed)
 692     BLOCK_COMMENT("call MacroAssembler::debug");
 693     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, MacroAssembler::debug32)));
 694     __ popa();
 695     __ ret(3 * wordSize);                        // pop arguments
 696     return start;
 697   }
 698 
 699   //
 700   //  Generate pre-barrier for array stores
 701   //
 702   //  Input:
 703   //     start   -  starting address
 704   //     count   -  element count
 705   void  gen_write_ref_array_pre_barrier(Register start, Register count, bool uninitialized_target) {
 706     assert_different_registers(start, count);
 707     BarrierSet* bs = Universe::heap()->barrier_set();
 708     switch (bs->kind()) {

 709       case BarrierSet::G1SATBCTLogging:
 710         // With G1, don't generate the call if we statically know that the target in uninitialized
 711         if (!uninitialized_target) {
 712            __ pusha();                      // push registers
 713            __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_pre),
 714                            start, count);
 715            __ popa();
 716          }
 717         break;
 718       case BarrierSet::CardTableModRef:
 719       case BarrierSet::CardTableExtension:
 720       case BarrierSet::ModRef:
 721         break;
 722       default      :
 723         ShouldNotReachHere();
 724 
 725     }
 726   }
 727 
 728 
 729   //
 730   // Generate a post-barrier for an array store
 731   //
 732   //     start    -  starting address
 733   //     count    -  element count
 734   //
 735   //  The two input registers are overwritten.
 736   //
 737   void  gen_write_ref_array_post_barrier(Register start, Register count) {
 738     BarrierSet* bs = Universe::heap()->barrier_set();
 739     assert_different_registers(start, count);
 740     switch (bs->kind()) {

 741       case BarrierSet::G1SATBCTLogging:
 742         {
 743           __ pusha();                      // push registers
 744           __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post),
 745                           start, count);
 746           __ popa();
 747         }
 748         break;
 749 
 750       case BarrierSet::CardTableModRef:
 751       case BarrierSet::CardTableExtension:
 752         {
 753           CardTableModRefBS* ct = (CardTableModRefBS*)bs;
 754           assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
 755 
 756           Label L_loop;
 757           const Register end = count;  // elements count; end == start+count-1
 758           assert_different_registers(start, end);
 759 
 760           __ lea(end,  Address(start, count, Address::times_ptr, -wordSize));


src/cpu/x86/vm/stubGenerator_x86_32.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File