src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot-comp Sdiff src/cpu/sparc/vm

src/cpu/sparc/vm/c1_Runtime1_sparc.cpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2010, 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  *


  40 // Implementation of StubAssembler
  41 
  42 int StubAssembler::call_RT(Register oop_result1, Register oop_result2, address entry_point, int number_of_arguments) {
  43   // for sparc changing the number of arguments doesn't change
  44   // anything about the frame size so we'll always lie and claim that
  45   // we are only passing 1 argument.
  46   set_num_rt_args(1);
  47 
  48   assert_not_delayed();
  49   // bang stack before going to runtime
  50   set(-os::vm_page_size() + STACK_BIAS, G3_scratch);
  51   st(G0, SP, G3_scratch);
  52 
  53   // debugging support
  54   assert(number_of_arguments >= 0   , "cannot have negative number of arguments");
  55 
  56   set_last_Java_frame(SP, noreg);
  57   if (VerifyThread)  mov(G2_thread, O0); // about to be smashed; pass early
  58   save_thread(L7_thread_cache);
  59   // do the call

  60   call(entry_point, relocInfo::runtime_call_type);






  61   if (!VerifyThread) {
  62     delayed()->mov(G2_thread, O0);  // pass thread as first argument
  63   } else {
  64     delayed()->nop();             // (thread already passed)
  65   }
  66   int call_offset = offset();  // offset of return address
  67   restore_thread(L7_thread_cache);
  68   reset_last_Java_frame();
  69 
  70   // check for pending exceptions
  71   { Label L;
  72     Address exception_addr(G2_thread, Thread::pending_exception_offset());
  73     ld_ptr(exception_addr, Gtemp);
  74     br_null(Gtemp, false, pt, L);
  75     delayed()->nop();
  76     Address vm_result_addr(G2_thread, JavaThread::vm_result_offset());
  77     st_ptr(G0, vm_result_addr);
  78     Address vm_result_addr_2(G2_thread, JavaThread::vm_result_2_offset());
  79     st_ptr(G0, vm_result_addr_2);
  80 


   1 /*
   2  * Copyright (c) 1999, 2011, 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  *


  40 // Implementation of StubAssembler
  41 
  42 int StubAssembler::call_RT(Register oop_result1, Register oop_result2, address entry_point, int number_of_arguments) {
  43   // for sparc changing the number of arguments doesn't change
  44   // anything about the frame size so we'll always lie and claim that
  45   // we are only passing 1 argument.
  46   set_num_rt_args(1);
  47 
  48   assert_not_delayed();
  49   // bang stack before going to runtime
  50   set(-os::vm_page_size() + STACK_BIAS, G3_scratch);
  51   st(G0, SP, G3_scratch);
  52 
  53   // debugging support
  54   assert(number_of_arguments >= 0   , "cannot have negative number of arguments");
  55 
  56   set_last_Java_frame(SP, noreg);
  57   if (VerifyThread)  mov(G2_thread, O0); // about to be smashed; pass early
  58   save_thread(L7_thread_cache);
  59   // do the call
  60   if (is_in_wdisp30_range(entry_point)) {
  61     call(entry_point, relocInfo::runtime_call_type);
  62   } else {
  63     relocate(relocInfo::runtime_call_type);
  64     AddressLiteral dest(entry_point);
  65     jumpl_to(dest, O7, O7);
  66   }
  67 
  68   if (!VerifyThread) {
  69     delayed()->mov(G2_thread, O0);  // pass thread as first argument
  70   } else {
  71     delayed()->nop();             // (thread already passed)
  72   }
  73   int call_offset = offset();  // offset of return address
  74   restore_thread(L7_thread_cache);
  75   reset_last_Java_frame();
  76 
  77   // check for pending exceptions
  78   { Label L;
  79     Address exception_addr(G2_thread, Thread::pending_exception_offset());
  80     ld_ptr(exception_addr, Gtemp);
  81     br_null(Gtemp, false, pt, L);
  82     delayed()->nop();
  83     Address vm_result_addr(G2_thread, JavaThread::vm_result_offset());
  84     st_ptr(G0, vm_result_addr);
  85     Address vm_result_addr_2(G2_thread, JavaThread::vm_result_2_offset());
  86     st_ptr(G0, vm_result_addr_2);
  87 


src/cpu/sparc/vm/c1_Runtime1_sparc.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File