Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/cpu/aarch64/vm/c1_FpuStackSim_aarch64.hpp
32285 views
/*1* Copyright (c) 2013, Red Hat Inc.2* Copyright (c) 2005, 2010, Oracle and/or its affiliates.3* All rights reserved.4* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.5*6* This code is free software; you can redistribute it and/or modify it7* under the terms of the GNU General Public License version 2 only, as8* published by the Free Software Foundation.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*24*/2526#ifndef CPU_X86_VM_C1_FPUSTACKSIM_X86_HPP27#define CPU_X86_VM_C1_FPUSTACKSIM_X86_HPP2829// Simulates the FPU stack and maintains mapping [fpu-register -> stack offset]30// FPU registers are described as numbers from 0..nof_fpu_regs-13132class Compilation;3334class FpuStackSim VALUE_OBJ_CLASS_SPEC {35private:36Compilation* _compilation;37int _stack_size;38int _regs[FrameMap::nof_fpu_regs];3940int tos_index() const { return _stack_size - 1; }4142int regs_at(int i) const;43void set_regs_at(int i, int val);44void dec_stack_size();45void inc_stack_size();4647// unified bailout support48Compilation* compilation() const { return _compilation; }49void bailout(const char* msg) const { compilation()->bailout(msg); }50bool bailed_out() const { return compilation()->bailed_out(); }5152public:53FpuStackSim(Compilation* compilation);54void pop ();55void pop (int rnr); // rnr must be on tos56void push(int rnr);57void swap(int offset); // exchange tos with tos + offset58int offset_from_tos(int rnr) const; // return the offset of the topmost instance of rnr from TOS59int get_slot(int tos_offset) const; // return the entry at the given offset from TOS60void set_slot(int tos_offset, int rnr); // set the entry at the given offset from TOS61void rename(int old_rnr, int new_rnr); // rename all instances of old_rnr to new_rnr62bool contains(int rnr); // debugging support only63bool is_empty();64bool slot_is_empty(int tos_offset);65int stack_size() const { return _stack_size; }66void clear();67intArray* write_state();68void read_state(intArray* fpu_stack_state);6970void print() PRODUCT_RETURN;71};7273#endif // CPU_X86_VM_C1_FPUSTACKSIM_X86_HPP747576