1 #ifdef USE_PRAGMA_IDENT_HDR
   2 #pragma ident "@(#)stubRoutines_x86_32.hpp      1.71 07/05/05 17:04:20 JVM"
   3 #endif
   4 /*
   5  * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.
  11  *
  12  * This code is distributed in the hope that it will be useful, but WITHOUT
  13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15  * version 2 for more details (a copy is included in the LICENSE file that
  16  * accompanied this code).
  17  *
  18  * You should have received a copy of the GNU General Public License version
  19  * 2 along with this work; if not, write to the Free Software Foundation,
  20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  21  *
  22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  23  * CA 95054 USA or visit www.sun.com if you need additional information or
  24  * have any questions.
  25  *  
  26  */
  27 
  28 // This file holds the platform specific parts of the StubRoutines
  29 // definition. See stubRoutines.hpp for a description on how to
  30 // extend it.
  31 
  32 enum platform_dependent_constants {
  33   code_size1 =  9000,           // simply increase if too small (assembler will crash if too small)
  34   code_size2 = 22000            // simply increase if too small (assembler will crash if too small)
  35 };
  36 
  37 class i486 {
  38  friend class StubGenerator;
  39  friend class VMStructs;
  40 
  41  private:
  42   // If we call compiled code directly from the call stub we will
  43   // need to adjust the return back to the call stub to a specialized
  44   // piece of code that can handle compiled results and cleaning the fpu
  45   // stack. The variable holds that location.
  46   static address _call_stub_compiled_return;  
  47   static address _verify_mxcsr_entry;
  48   static address _verify_fpu_cntrl_wrd_entry;
  49   static jint    _mxcsr_std;
  50 
  51  public:
  52   static address verify_mxcsr_entry()                        { return _verify_mxcsr_entry; }
  53   static address verify_fpu_cntrl_wrd_entry()                { return _verify_fpu_cntrl_wrd_entry; }
  54 
  55   static address get_call_stub_compiled_return()             { return _call_stub_compiled_return; }
  56   static void set_call_stub_compiled_return(address ret)     { _call_stub_compiled_return = ret; }
  57 };
  58 
  59   static bool    returns_to_call_stub(address return_pc)     { return (return_pc == _call_stub_return_address) || 
  60                                                                        return_pc == i486::get_call_stub_compiled_return(); }