hotspot/src/share/vm/opto/optoreg.hpp
author iveresov
Thu, 22 Jan 2015 11:25:23 -0800
changeset 28723 0a36120cb225
parent 25715 d5a8dbdc5150
child 29180 50369728b00e
permissions -rw-r--r--
8071302: assert(!_reg_node[reg_lo] || edge_from_to(_reg_node[reg_lo], def)) failed: after block local Summary: Add merge nodes to node to block mapping Reviewed-by: kvn, vlivanov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
25715
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
     2
 * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_OPTO_OPTOREG_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_OPTO_OPTOREG_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
25715
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    28
// AdGlobals contains c2 specific register handling code as specified
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    29
// in the .ad files.
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    30
#ifdef TARGET_ARCH_MODEL_x86_32
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    31
# include "adfiles/adGlobals_x86_32.hpp"
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    32
#endif
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    33
#ifdef TARGET_ARCH_MODEL_x86_64
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    34
# include "adfiles/adGlobals_x86_64.hpp"
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    35
#endif
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    36
#ifdef TARGET_ARCH_MODEL_sparc
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    37
# include "adfiles/adGlobals_sparc.hpp"
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    38
#endif
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    39
#ifdef TARGET_ARCH_MODEL_zero
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    40
# include "adfiles/adGlobals_zero.hpp"
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    41
#endif
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    42
#ifdef TARGET_ARCH_MODEL_arm
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    43
# include "adfiles/adGlobals_arm.hpp"
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    44
#endif
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    45
#ifdef TARGET_ARCH_MODEL_ppc_32
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    46
# include "adfiles/adGlobals_ppc_32.hpp"
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    47
#endif
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    48
#ifdef TARGET_ARCH_MODEL_ppc_64
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    49
# include "adfiles/adGlobals_ppc_64.hpp"
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    50
#endif
d5a8dbdc5150 8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents: 22234
diff changeset
    51
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
//------------------------------OptoReg----------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
// We eventually need Registers for the Real World.  Registers are essentially
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
// non-SSA names.  A Register is represented as a number.  Non-regular values
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
// (e.g., Control, Memory, I/O) use the Special register.  The actual machine
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
// registers (as described in the ADL file for a machine) start at zero.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
// Stack-slots (spill locations) start at the nest Chunk past the last machine
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
// register.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
// Note that stack spill-slots are treated as a very large register set.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
// They have all the correct properties for a Register: not aliased (unique
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
// named).  There is some simple mapping from a stack-slot register number
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
// to the actual location on the stack; this mapping depends on the calling
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
// conventions and is described in the ADL.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
// Note that Name is not enum. C++ standard defines that the range of enum
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
// is the range of smallest bit-field that can represent all enumerators
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
// declared in the enum. The result of assigning a value to enum is undefined
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
// if the value is outside the enumeration's valid range. OptoReg::Name is
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
// typedef'ed as int, because it needs to be able to represent spill-slots.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
class OptoReg VALUE_OBJ_CLASS_SPEC {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
 friend class C2Compiler;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  typedef int Name;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  enum {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
    // Chunk 0
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
    Physical = AdlcVMDeps::Physical, // Start of physical regs
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
    // A few oddballs at the edge of the world
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
    Special = -2,               // All special (not allocated) values
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
    Bad = -1                    // Not a register
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
 static const VMReg opto2vm[REG_COUNT];
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
 static Name vm2opto[ConcreteRegisterImpl::number_of_registers];
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  // Stack pointer register
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  static OptoReg::Name c_frame_pointer;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  // Increment a register number.  As in:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
  //    "for ( OptoReg::Name i; i=Control; i = add(i,1) ) ..."
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  static Name add( Name x, int y ) { return Name(x+y); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  // (We would like to have an operator+ for RegName, but it is not
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  // a class, so this would be illegal in C++.)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
15241
87d217c2d183 8005055: pass outputStream to more opto debug routines
kvn
parents: 10547
diff changeset
   104
  static void dump(int, outputStream *st = tty);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  // Get the stack slot number of an OptoReg::Name
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  static unsigned int reg2stack( OptoReg::Name r) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
    assert( r >= stack0(), " must be");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
    return r - stack0();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
  // convert a stack slot number into an OptoReg::Name
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  static OptoReg::Name stack2reg( int idx) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    return Name(stack0() + idx);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  static bool is_stack(Name n) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
    return n >= stack0();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  static bool is_valid(Name n) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
    return (n != Bad);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  static bool is_reg(Name n) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
    return  is_valid(n) && !is_stack(n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  static VMReg as_VMReg(OptoReg::Name n) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
    if (is_reg(n)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
      // Must use table, it'd be nice if Bad was indexable...
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
      return opto2vm[n];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
      assert(!is_stack(n), "must un warp");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
      return VMRegImpl::Bad();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  // Can un-warp a stack slot or convert a register or Bad
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  static VMReg as_VMReg(OptoReg::Name n, int frame_size, int arg_count) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
    if (is_reg(n)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
      // Must use table, it'd be nice if Bad was indexable...
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
      return opto2vm[n];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
    } else if (is_stack(n)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
      int stack_slot = reg2stack(n);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
      if (stack_slot < arg_count) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
        return VMRegImpl::stack2reg(stack_slot + frame_size);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
      return VMRegImpl::stack2reg(stack_slot - arg_count);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
      // return return VMRegImpl::stack2reg(reg2stack(OptoReg::add(n, -arg_count)));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
      return VMRegImpl::Bad();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  static OptoReg::Name as_OptoReg(VMReg r) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
    if (r->is_stack()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
      assert(false, "must warp");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
      return stack2reg(r->reg2stack());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
    } else if (r->is_valid()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
      // Must use table, it'd be nice if Bad was indexable...
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
      return vm2opto[r->value()];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
      return Bad;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  static OptoReg::Name stack0() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
    return VMRegImpl::stack0->value();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
  static const char* regname(OptoReg::Name n) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
    return as_VMReg(n)->name();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
//---------------------------OptoRegPair-------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
// Pairs of 32-bit registers for the allocator.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
// This is a very similar class to VMRegPair. C2 only interfaces with VMRegPair
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
// via the calling convention code which is shared between the compilers.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
// Since C2 uses OptoRegs for register allocation it is more efficient to use
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
// VMRegPair internally for nodes that can contain a pair of OptoRegs rather
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
// than use VMRegPair and continually be converting back and forth. So normally
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
// C2 will take in a VMRegPair from the calling convention code and immediately
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
// convert them to an OptoRegPair and stay in the OptoReg world. The only over
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
// conversion between OptoRegs and VMRegs is for debug info and oopMaps. This
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
// is not a high bandwidth spot and so it is not an issue.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
// Note that onde other consequence of staying in the OptoReg world with OptoRegPairs
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
// is that there are "physical" OptoRegs that are not representable in the VMReg
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
// world, notably flags. [ But by design there is "space" in the VMReg world
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
// for such registers they just may not be concrete ]. So if we were to use VMRegPair
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
// then the VMReg world would have to have a representation for these registers
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
// so that a OptoReg->VMReg->OptoReg would reproduce ther original OptoReg. As it
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
// stands if you convert a flag (condition code) to a VMReg you will get VMRegImpl::Bad
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
// and converting that will return OptoReg::Bad losing the identity of the OptoReg.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
class OptoRegPair {
10547
ea4a2ec31ae2 7088955: add C2 IR support to the SA
never
parents: 7397
diff changeset
   199
  friend class VMStructs;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  short _second;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  short _first;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  void set_bad (                   ) { _second = OptoReg::Bad; _first = OptoReg::Bad; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  void set1    ( OptoReg::Name n  ) { _second = OptoReg::Bad; _first = n; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
  void set2    ( OptoReg::Name n  ) { _second = n + 1;       _first = n; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  void set_pair( OptoReg::Name second, OptoReg::Name first    ) { _second= second;    _first= first; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  void set_ptr ( OptoReg::Name ptr ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
#ifdef _LP64
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
    _second = ptr+1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
#else
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
    _second = OptoReg::Bad;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
    _first = ptr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
  OptoReg::Name second() const { return _second; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  OptoReg::Name first() const { return _first; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
  OptoRegPair(OptoReg::Name second, OptoReg::Name first) {  _second = second; _first = first; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  OptoRegPair(OptoReg::Name f) { _second = OptoReg::Bad; _first = f; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
  OptoRegPair() { _second = OptoReg::Bad; _first = OptoReg::Bad; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   223
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   224
#endif // SHARE_VM_OPTO_OPTOREG_HPP