src/cpu/x86/vm/c1_FpuStackSim_x86.hpp

Thu, 07 Oct 2010 08:06:06 -0700

author
coleenp
date
Thu, 07 Oct 2010 08:06:06 -0700
changeset 2222
b6aedd1acdc0
parent 1907
c18cbe5936b8
child 2314
f95d63e2154a
permissions
-rw-r--r--

6983240: guarantee((Solaris::min_stack_allowed >= (StackYellowPages+StackRedPages...) wrong
Summary: min_stack_allowed is a compile time constant and Stack*Pages are settable
Reviewed-by: dholmes, kvn

     1 /*
     2  * Copyright (c) 2005, 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  *
    23  */
    25 //  Simulates the FPU stack and maintains mapping [fpu-register -> stack offset]
    26 //  FPU registers are described as numbers from 0..nof_fpu_regs-1
    28 class Compilation;
    30 class FpuStackSim VALUE_OBJ_CLASS_SPEC {
    31  private:
    32   Compilation* _compilation;
    33   int          _stack_size;
    34   int          _regs[FrameMap::nof_fpu_regs];
    36   int tos_index() const                        { return _stack_size - 1; }
    38   int regs_at(int i) const;
    39   void set_regs_at(int i, int val);
    40   void dec_stack_size();
    41   void inc_stack_size();
    43   // unified bailout support
    44   Compilation*  compilation() const              { return _compilation; }
    45   void          bailout(const char* msg) const   { compilation()->bailout(msg); }
    46   bool          bailed_out() const               { return compilation()->bailed_out(); }
    48  public:
    49   FpuStackSim(Compilation* compilation);
    50   void pop ();
    51   void pop (int rnr);                          // rnr must be on tos
    52   void push(int rnr);
    53   void swap(int offset);                       // exchange tos with tos + offset
    54   int offset_from_tos(int rnr) const;          // return the offset of the topmost instance of rnr from TOS
    55   int  get_slot(int tos_offset) const;         // return the entry at the given offset from TOS
    56   void set_slot(int tos_offset, int rnr);      // set the entry at the given offset from TOS
    57   void rename(int old_rnr, int new_rnr);       // rename all instances of old_rnr to new_rnr
    58   bool contains(int rnr);                      // debugging support only
    59   bool is_empty();
    60   bool slot_is_empty(int tos_offset);
    61   int stack_size() const                       { return _stack_size; }
    62   void clear();
    63   intArray* write_state();
    64   void read_state(intArray* fpu_stack_state);
    66   void print() PRODUCT_RETURN;
    67 };

mercurial