hotspot/src/share/vm/opto/machnode.cpp
author kvn
Fri, 29 Feb 2008 19:57:41 -0800
changeset 209 2a924148a40a
parent 1 489c9b5090e2
child 360 21d113ecbf6a
permissions -rw-r--r--
6667618: disable LoadL->ConvL2I ==> LoadI optimization Summary: this optimization causes problems (sizes of Load and Store nodes do not match) for objects initialization code and Escape Analysis Reviewed-by: jrose, never
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
 * Copyright 1997-2007 Sun Microsystems, Inc.  All Rights Reserved.
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
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
#include "incls/_precompiled.incl"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
#include "incls/_machnode.cpp.incl"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
// Return the value requested
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
// result register lookup, corresponding to int_format
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
int MachOper::reg(PhaseRegAlloc *ra_, const Node *node) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
  return (int)ra_->get_encode(node);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
// input register lookup, corresponding to ext_format
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
int MachOper::reg(PhaseRegAlloc *ra_, const Node *node, int idx) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
  return (int)(ra_->get_encode(node->in(idx)));
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
intptr_t  MachOper::constant() const { return 0x00; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
bool MachOper::constant_is_oop() const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
jdouble MachOper::constantD() const { ShouldNotReachHere(); return 0.0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
jfloat  MachOper::constantF() const { ShouldNotReachHere(); return 0.0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
jlong   MachOper::constantL() const { ShouldNotReachHere(); return CONST64(0) ; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
TypeOopPtr *MachOper::oop() const { return NULL; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
int MachOper::ccode() const { return 0x00; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
// A zero, default, indicates this value is not needed.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
// May need to lookup the base register, as done in int_ and ext_format
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
int MachOper::base (PhaseRegAlloc *ra_, const Node *node, int idx)  const { return 0x00; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
int MachOper::index(PhaseRegAlloc *ra_, const Node *node, int idx)  const { return 0x00; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
int MachOper::scale()  const { return 0x00; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
int MachOper::disp (PhaseRegAlloc *ra_, const Node *node, int idx)  const { return 0x00; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
int MachOper::constant_disp()  const { return 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
int MachOper::base_position()  const { return -1; }  // no base input
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
int MachOper::index_position() const { return -1; }  // no index input
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
// Check for PC-Relative displacement
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
bool MachOper::disp_is_oop() const { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
// Return the label
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
Label*   MachOper::label()  const { ShouldNotReachHere(); return 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
intptr_t MachOper::method() const { ShouldNotReachHere(); return 0; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
//------------------------------negate-----------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
// Negate conditional branches.  Error for non-branch operands
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
void MachOper::negate() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  ShouldNotCallThis();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
//-----------------------------type--------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
const Type *MachOper::type() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  return Type::BOTTOM;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
//------------------------------in_RegMask-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
const RegMask *MachOper::in_RegMask(int index) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
//------------------------------dump_spec--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
// Print any per-operand special info
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
void MachOper::dump_spec(outputStream *st) const { }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
//------------------------------hash-------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
// Print any per-operand special info
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
uint MachOper::hash() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  ShouldNotCallThis();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
  return 5;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
//------------------------------cmp--------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
// Print any per-operand special info
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
uint MachOper::cmp( const MachOper &oper ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  ShouldNotCallThis();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  return opcode() == oper.opcode();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
//------------------------------hash-------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
// Print any per-operand special info
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
uint labelOper::hash() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  return _block_num;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
//------------------------------cmp--------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
// Print any per-operand special info
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
uint labelOper::cmp( const MachOper &oper ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  return (opcode() == oper.opcode()) && (_label == oper.label());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
//------------------------------hash-------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
// Print any per-operand special info
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
uint methodOper::hash() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  return (uint)_method;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
//------------------------------cmp--------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
// Print any per-operand special info
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
uint methodOper::cmp( const MachOper &oper ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  return (opcode() == oper.opcode()) && (_method == oper.method());
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
//------------------------------MachNode---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
//------------------------------emit-------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
void MachNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  #ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  tty->print("missing MachNode emit function: ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  dump();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  #endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  ShouldNotCallThis();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
//------------------------------size-------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
// Size of instruction in bytes
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
uint MachNode::size(PhaseRegAlloc *ra_) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  // If a virtual was not defined for this specific instruction,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  // Call the helper which finds the size by emiting the bits.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
  return MachNode::emit_size(ra_);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
//------------------------------size-------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
// Helper function that computes size by emitting code
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
uint MachNode::emit_size(PhaseRegAlloc *ra_) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  // Emit into a trash buffer and count bytes emitted.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  assert(ra_ == ra_->C->regalloc(), "sanity");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
  return ra_->C->scratch_emit_size(this);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
//------------------------------hash-------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
uint MachNode::hash() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
  uint no = num_opnds();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
  uint sum = rule();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  for( uint i=0; i<no; i++ )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
    sum += _opnds[i]->hash();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  return sum+Node::hash();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
//-----------------------------cmp---------------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
uint MachNode::cmp( const Node &node ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  MachNode& n = *((Node&)node).as_Mach();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  uint no = num_opnds();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
  if( no != n.num_opnds() ) return 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
  if( rule() != n.rule() ) return 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  for( uint i=0; i<no; i++ )    // All operands must match
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
    if( !_opnds[i]->cmp( *n._opnds[i] ) )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
      return 0;                 // mis-matched operands
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  return 1;                     // match
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
// Return an equivalent instruction using memory for cisc_operand position
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
MachNode *MachNode::cisc_version(int offset, Compile* C) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
  ShouldNotCallThis();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
void MachNode::use_cisc_RegMask() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
  ShouldNotReachHere();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
//-----------------------------in_RegMask--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
const RegMask &MachNode::in_RegMask( uint idx ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  uint numopnds = num_opnds();        // Virtual call for number of operands
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  uint skipped   = oper_input_base(); // Sum of leaves skipped so far
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  if( idx < skipped ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
    assert( ideal_Opcode() == Op_AddP, "expected base ptr here" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
    assert( idx == 1, "expected base ptr here" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
    // debug info can be anywhere
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
    return *Compile::current()->matcher()->idealreg2spillmask[Op_RegP];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
  uint opcnt     = 1;                 // First operand
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
  uint num_edges = _opnds[1]->num_edges(); // leaves for first operand
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
  while( idx >= skipped+num_edges ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
    skipped += num_edges;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
    opcnt++;                          // Bump operand count
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
    assert( opcnt < numopnds, "Accessing non-existent operand" );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
    num_edges = _opnds[opcnt]->num_edges(); // leaves for next operand
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  const RegMask *rm = cisc_RegMask();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
  if( rm == NULL || (int)opcnt != cisc_operand() ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
    rm = _opnds[opcnt]->in_RegMask(idx-skipped);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
  return *rm;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
//-----------------------------memory_inputs--------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
const MachOper*  MachNode::memory_inputs(Node* &base, Node* &index) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  const MachOper* oper = memory_operand();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
  if (oper == (MachOper*)-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
    base = NodeSentinel;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
    index = NodeSentinel;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
    base = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
    index = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
    if (oper != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
      // It has a unique memory operand.  Find its index.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
      int oper_idx = num_opnds();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
      while (--oper_idx >= 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
        if (_opnds[oper_idx] == oper)  break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
      int oper_pos = operand_index(oper_idx);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
      int base_pos = oper->base_position();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
      if (base_pos >= 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
        base = _in[oper_pos+base_pos];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
      int index_pos = oper->index_position();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
      if (index_pos >= 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
        index = _in[oper_pos+index_pos];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
  return oper;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
//-----------------------------get_base_and_disp----------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
const Node* MachNode::get_base_and_disp(intptr_t &offset, const TypePtr* &adr_type) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
  // Find the memory inputs using our helper function
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
  Node* base;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
  Node* index;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
  const MachOper* oper = memory_inputs(base, index);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
  if (oper == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
    // Base has been set to NULL
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
    offset = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
  } else if (oper == (MachOper*)-1) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
    // Base has been set to NodeSentinel
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
    // There is not a unique memory use here.  We will fall to AliasIdxBot.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
    offset = Type::OffsetBot;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
    // Base may be NULL, even if offset turns out to be != 0
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
    intptr_t disp = oper->constant_disp();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
    int scale = oper->scale();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
    // Now we have collected every part of the ADLC MEMORY_INTER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
    // See if it adds up to a base + offset.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
    if (index != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
      if (!index->is_Con()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
        disp = Type::OffsetBot;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
      } else if (disp != Type::OffsetBot) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
        const TypeX* ti = index->bottom_type()->isa_intptr_t();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
        if (ti == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
          disp = Type::OffsetBot;  // a random constant??
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
        } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
          disp += ti->get_con() << scale;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
    offset = disp;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
    // In i486.ad, indOffset32X uses base==RegI and disp==RegP,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
    // this will prevent alias analysis without the following support:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
    // Lookup the TypePtr used by indOffset32X, a compile-time constant oop,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
    // Add the offset determined by the "base", or use Type::OffsetBot.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
    if( adr_type == TYPE_PTR_SENTINAL ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
      const TypePtr *t_disp = oper->disp_as_type();  // only !NULL for indOffset32X
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
      if (t_disp != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
        offset = Type::OffsetBot;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
        const Type* t_base = base->bottom_type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
        if (t_base->isa_intptr_t()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
          const TypeX *t_offset = t_base->is_intptr_t();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
          if( t_offset->is_con() ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
            offset = t_offset->get_con();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
          }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
        }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
        adr_type = t_disp->add_offset(offset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
      }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
  return base;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
//---------------------------------adr_type---------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
const class TypePtr *MachNode::adr_type() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
  intptr_t offset = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
  const TypePtr *adr_type = TYPE_PTR_SENTINAL;  // attempt computing adr_type
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
  const Node *base = get_base_and_disp(offset, adr_type);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
  if( adr_type != TYPE_PTR_SENTINAL ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
    return adr_type;      // get_base_and_disp has the answer
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
  // Direct addressing modes have no base node, simply an indirect
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
  // offset, which is always to raw memory.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
  // %%%%% Someday we'd like to allow constant oop offsets which
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
  // would let Intel load from static globals in 1 instruction.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
  // Currently Intel requires 2 instructions and a register temp.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
  if (base == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
    // NULL base, zero offset means no memory at all (a null pointer!)
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
    if (offset == 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
      return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
    // NULL base, any offset means any pointer whatever
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
    if (offset == Type::OffsetBot) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
      return TypePtr::BOTTOM;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
    // %%% make offset be intptr_t
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
    assert(!Universe::heap()->is_in_reserved((oop)offset), "must be a raw ptr");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
    return TypeRawPtr::BOTTOM;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
  // base of -1 with no particular offset means all of memory
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
  if (base == NodeSentinel)  return TypePtr::BOTTOM;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
  const Type* t = base->bottom_type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
  if (t->isa_intptr_t() && offset != 0 && offset != Type::OffsetBot) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
    // We cannot assert that the offset does not look oop-ish here.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
    // Depending on the heap layout the cardmark base could land
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
    // inside some oopish region.  It definitely does for Win2K.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
    // The sum of cardmark-base plus shift-by-9-oop lands outside
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
    // the oop-ish area but we can't assert for that statically.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
    return TypeRawPtr::BOTTOM;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
  const TypePtr *tp = t->isa_ptr();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
  // be conservative if we do not recognize the type
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
  if (tp == NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
    return TypePtr::BOTTOM;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
  assert(tp->base() != Type::AnyPtr, "not a bare pointer");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
  return tp->add_offset(offset);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
//-----------------------------operand_index---------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
int MachNode::operand_index( uint operand ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
  if( operand < 1 )  return -1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
  assert(operand < num_opnds(), "oob");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
  if( _opnds[operand]->num_edges() == 0 )  return -1;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
  uint skipped   = oper_input_base(); // Sum of leaves skipped so far
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
  for (uint opcnt = 1; opcnt < operand; opcnt++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
    uint num_edges = _opnds[opcnt]->num_edges(); // leaves for operand
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
    skipped += num_edges;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
  return skipped;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
//------------------------------negate-----------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
// Negate conditional branches.  Error for non-branch Nodes
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
void MachNode::negate() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
  ShouldNotCallThis();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
//------------------------------peephole---------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
// Apply peephole rule(s) to this instruction
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
MachNode *MachNode::peephole( Block *block, int block_index, PhaseRegAlloc *ra_, int &deleted, Compile* C ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
  return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
//------------------------------add_case_label---------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
// Adds the label for the case
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
void MachNode::add_case_label( int index_num, Label* blockLabel) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
  ShouldNotCallThis();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
//------------------------------label_set--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
// Set the Label for a LabelOper, if an operand for this instruction
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
void MachNode::label_set( Label& label, uint block_num ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
  ShouldNotCallThis();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
//------------------------------method_set-------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
// Set the absolute address of a method
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
void MachNode::method_set( intptr_t addr ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
  ShouldNotCallThis();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
489c9b5090e2 Initial load
duke
parents:
diff changeset
   400
//------------------------------rematerialize----------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   401
bool MachNode::rematerialize() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   402
  // Temps are always rematerializable
489c9b5090e2 Initial load
duke
parents:
diff changeset
   403
  if (is_MachTemp()) return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   404
489c9b5090e2 Initial load
duke
parents:
diff changeset
   405
  uint r = rule();              // Match rule
489c9b5090e2 Initial load
duke
parents:
diff changeset
   406
  if( r <  Matcher::_begin_rematerialize ||
489c9b5090e2 Initial load
duke
parents:
diff changeset
   407
      r >= Matcher::_end_rematerialize )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   408
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   409
489c9b5090e2 Initial load
duke
parents:
diff changeset
   410
  // For 2-address instructions, the input live range is also the output
489c9b5090e2 Initial load
duke
parents:
diff changeset
   411
  // live range.  Remateralizing does not make progress on the that live range.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   412
  if( two_adr() )  return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   413
489c9b5090e2 Initial load
duke
parents:
diff changeset
   414
  // Check for rematerializing float constants, or not
489c9b5090e2 Initial load
duke
parents:
diff changeset
   415
  if( !Matcher::rematerialize_float_constants ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   416
    int op = ideal_Opcode();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   417
    if( op == Op_ConF || op == Op_ConD )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   418
      return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   419
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   420
489c9b5090e2 Initial load
duke
parents:
diff changeset
   421
  // Defining flags - can't spill these!  Must remateralize.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   422
  if( ideal_reg() == Op_RegFlags )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   423
    return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   424
489c9b5090e2 Initial load
duke
parents:
diff changeset
   425
  // Stretching lots of inputs - don't do it.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   426
  if( req() > 2 )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   427
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   428
489c9b5090e2 Initial load
duke
parents:
diff changeset
   429
  // Don't remateralize somebody with bound inputs - it stretches a
489c9b5090e2 Initial load
duke
parents:
diff changeset
   430
  // fixed register lifetime.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   431
  uint idx = oper_input_base();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   432
  if( req() > idx ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   433
    const RegMask &rm = in_RegMask(idx);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   434
    if( rm.is_bound1() || rm.is_bound2() )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   435
      return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   436
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   437
489c9b5090e2 Initial load
duke
parents:
diff changeset
   438
  return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   439
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   440
489c9b5090e2 Initial load
duke
parents:
diff changeset
   441
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   442
//------------------------------dump_spec--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   443
// Print any per-operand special info
489c9b5090e2 Initial load
duke
parents:
diff changeset
   444
void MachNode::dump_spec(outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   445
  uint cnt = num_opnds();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   446
  for( uint i=0; i<cnt; i++ )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   447
    _opnds[i]->dump_spec(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   448
  const TypePtr *t = adr_type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   449
  if( t ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   450
    Compile* C = Compile::current();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   451
    if( C->alias_type(t)->is_volatile() )
489c9b5090e2 Initial load
duke
parents:
diff changeset
   452
      st->print(" Volatile!");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   453
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   454
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   455
489c9b5090e2 Initial load
duke
parents:
diff changeset
   456
//------------------------------dump_format------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   457
// access to virtual
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
void MachNode::dump_format(PhaseRegAlloc *ra, outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
  format(ra, st); // access to virtual
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
void MachTypeNode::dump_spec(outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
  _bottom_type->dump_on(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
void MachNullCheckNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
  int reg = ra_->get_reg_first(in(1)->in(_vidx));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
  tty->print("%s %s", Name(), Matcher::regName[reg]);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
void MachNullCheckNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
  // only emits entries in the null-pointer exception handler table
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
489c9b5090e2 Initial load
duke
parents:
diff changeset
   482
const RegMask &MachNullCheckNode::in_RegMask( uint idx ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
  if( idx == 0 ) return RegMask::Empty;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
  else return in(1)->as_Mach()->out_RegMask();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
489c9b5090e2 Initial load
duke
parents:
diff changeset
   487
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
const Type *MachProjNode::bottom_type() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
  if( _ideal_reg == fat_proj ) return Type::BOTTOM;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
  // Try the normal mechanism first
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
  const Type *t = in(0)->bottom_type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
  if( t->base() == Type::Tuple ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
    const TypeTuple *tt = t->is_tuple();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
    if (_con < tt->cnt())
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
      return tt->field_at(_con);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
  // Else use generic type from ideal register set
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
  assert((uint)_ideal_reg < (uint)_last_machine_leaf && Type::mreg2type[_ideal_reg], "in bounds");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
  return Type::mreg2type[_ideal_reg];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
const TypePtr *MachProjNode::adr_type() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
  if (bottom_type() == Type::MEMORY) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   504
    // in(0) might be a narrow MemBar; otherwise we will report TypePtr::BOTTOM
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
    const TypePtr* adr_type = in(0)->adr_type();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
    #ifdef ASSERT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
    if (!is_error_reported() && !Node::in_dump())
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
      assert(adr_type != NULL, "source must have adr_type");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
    #endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
    return adr_type;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
  assert(bottom_type()->base() != Type::Memory, "no other memories?");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
  return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
489c9b5090e2 Initial load
duke
parents:
diff changeset
   516
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
void MachProjNode::dump_spec(outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
  ProjNode::dump_spec(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   519
  switch (_ideal_reg) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   520
  case unmatched_proj:  st->print("/unmatched");                         break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   521
  case fat_proj:        st->print("/fat"); if (WizardMode) _rout.dump(); break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
void MachIfNode::dump_spec(outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
  st->print("P=%f, C=%f",_prob, _fcnt);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
489c9b5090e2 Initial load
duke
parents:
diff changeset
   533
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   534
uint MachReturnNode::size_of() const { return sizeof(*this); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   535
489c9b5090e2 Initial load
duke
parents:
diff changeset
   536
//------------------------------Registers--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   537
const RegMask &MachReturnNode::in_RegMask( uint idx ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   538
  return _in_rms[idx];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   539
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   540
489c9b5090e2 Initial load
duke
parents:
diff changeset
   541
const TypePtr *MachReturnNode::adr_type() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   542
  // most returns and calls are assumed to consume & modify all of memory
489c9b5090e2 Initial load
duke
parents:
diff changeset
   543
  // the matcher will copy non-wide adr_types from ideal originals
489c9b5090e2 Initial load
duke
parents:
diff changeset
   544
  return _adr_type;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   545
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   546
489c9b5090e2 Initial load
duke
parents:
diff changeset
   547
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   548
const Type *MachSafePointNode::bottom_type() const {  return TypeTuple::MEMBAR; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   549
489c9b5090e2 Initial load
duke
parents:
diff changeset
   550
//------------------------------Registers--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   551
const RegMask &MachSafePointNode::in_RegMask( uint idx ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   552
  // Values in the domain use the users calling convention, embodied in the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   553
  // _in_rms array of RegMasks.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   554
  if( idx < TypeFunc::Parms ) return _in_rms[idx];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   555
489c9b5090e2 Initial load
duke
parents:
diff changeset
   556
  if (SafePointNode::needs_polling_address_input() &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   557
      idx == TypeFunc::Parms &&
489c9b5090e2 Initial load
duke
parents:
diff changeset
   558
      ideal_Opcode() == Op_SafePoint) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   559
    return MachNode::in_RegMask(idx);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   560
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   561
489c9b5090e2 Initial load
duke
parents:
diff changeset
   562
  // Values outside the domain represent debug info
489c9b5090e2 Initial load
duke
parents:
diff changeset
   563
  return *Compile::current()->matcher()->idealreg2spillmask[in(idx)->ideal_reg()];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   564
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   565
489c9b5090e2 Initial load
duke
parents:
diff changeset
   566
489c9b5090e2 Initial load
duke
parents:
diff changeset
   567
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   568
489c9b5090e2 Initial load
duke
parents:
diff changeset
   569
uint MachCallNode::cmp( const Node &n ) const
489c9b5090e2 Initial load
duke
parents:
diff changeset
   570
{ return _tf == ((MachCallNode&)n)._tf; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   571
const Type *MachCallNode::bottom_type() const { return tf()->range(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   572
const Type *MachCallNode::Value(PhaseTransform *phase) const { return tf()->range(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   573
489c9b5090e2 Initial load
duke
parents:
diff changeset
   574
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   575
void MachCallNode::dump_spec(outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   576
  st->print("# ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   577
  tf()->dump_on(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   578
  if (_cnt != COUNT_UNKNOWN)  st->print(" C=%f",_cnt);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   579
  if (jvms() != NULL)  jvms()->dump_spec(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   580
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   581
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   582
489c9b5090e2 Initial load
duke
parents:
diff changeset
   583
489c9b5090e2 Initial load
duke
parents:
diff changeset
   584
bool MachCallNode::return_value_is_used() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   585
  if (tf()->range()->cnt() == TypeFunc::Parms) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   586
    // void return
489c9b5090e2 Initial load
duke
parents:
diff changeset
   587
    return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   588
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   589
489c9b5090e2 Initial load
duke
parents:
diff changeset
   590
  // find the projection corresponding to the return value
489c9b5090e2 Initial load
duke
parents:
diff changeset
   591
  for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   592
    Node *use = fast_out(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   593
    if (!use->is_Proj()) continue;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   594
    if (use->as_Proj()->_con == TypeFunc::Parms) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   595
      return true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   596
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   597
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   598
  return false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   599
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   600
489c9b5090e2 Initial load
duke
parents:
diff changeset
   601
489c9b5090e2 Initial load
duke
parents:
diff changeset
   602
//------------------------------Registers--------------------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   603
const RegMask &MachCallNode::in_RegMask( uint idx ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   604
  // Values in the domain use the users calling convention, embodied in the
489c9b5090e2 Initial load
duke
parents:
diff changeset
   605
  // _in_rms array of RegMasks.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   606
  if (idx < tf()->domain()->cnt())  return _in_rms[idx];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   607
  // Values outside the domain represent debug info
489c9b5090e2 Initial load
duke
parents:
diff changeset
   608
  return *Compile::current()->matcher()->idealreg2debugmask[in(idx)->ideal_reg()];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   609
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   610
489c9b5090e2 Initial load
duke
parents:
diff changeset
   611
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   612
uint MachCallJavaNode::size_of() const { return sizeof(*this); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   613
uint MachCallJavaNode::cmp( const Node &n ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   614
  MachCallJavaNode &call = (MachCallJavaNode&)n;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   615
  return MachCallNode::cmp(call) && _method->equals(call._method);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   616
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   617
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   618
void MachCallJavaNode::dump_spec(outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   619
  if( _method ) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   620
    _method->print_short_name(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   621
    st->print(" ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   622
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   623
  MachCallNode::dump_spec(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   624
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   625
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   626
489c9b5090e2 Initial load
duke
parents:
diff changeset
   627
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   628
uint MachCallStaticJavaNode::size_of() const { return sizeof(*this); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   629
uint MachCallStaticJavaNode::cmp( const Node &n ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   630
  MachCallStaticJavaNode &call = (MachCallStaticJavaNode&)n;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   631
  return MachCallJavaNode::cmp(call) && _name == call._name;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   632
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   633
489c9b5090e2 Initial load
duke
parents:
diff changeset
   634
//----------------------------uncommon_trap_request----------------------------
489c9b5090e2 Initial load
duke
parents:
diff changeset
   635
// If this is an uncommon trap, return the request code, else zero.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   636
int MachCallStaticJavaNode::uncommon_trap_request() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   637
  if (_name != NULL && !strcmp(_name, "uncommon_trap")) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   638
    return CallStaticJavaNode::extract_uncommon_trap_request(this);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   639
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   640
  return 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   641
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   642
489c9b5090e2 Initial load
duke
parents:
diff changeset
   643
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   644
// Helper for summarizing uncommon_trap arguments.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   645
void MachCallStaticJavaNode::dump_trap_args(outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   646
  int trap_req = uncommon_trap_request();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   647
  if (trap_req != 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   648
    char buf[100];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   649
    st->print("(%s)",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   650
               Deoptimization::format_trap_request(buf, sizeof(buf),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   651
                                                   trap_req));
489c9b5090e2 Initial load
duke
parents:
diff changeset
   652
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   653
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   654
489c9b5090e2 Initial load
duke
parents:
diff changeset
   655
void MachCallStaticJavaNode::dump_spec(outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   656
  st->print("Static ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   657
  if (_name != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   658
    st->print("wrapper for: %s", _name );
489c9b5090e2 Initial load
duke
parents:
diff changeset
   659
    dump_trap_args(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   660
    st->print(" ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   661
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   662
  MachCallJavaNode::dump_spec(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   663
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   664
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   665
489c9b5090e2 Initial load
duke
parents:
diff changeset
   666
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   667
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   668
void MachCallDynamicJavaNode::dump_spec(outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   669
  st->print("Dynamic ");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   670
  MachCallJavaNode::dump_spec(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   671
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   672
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   673
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   674
uint MachCallRuntimeNode::size_of() const { return sizeof(*this); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   675
uint MachCallRuntimeNode::cmp( const Node &n ) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   676
  MachCallRuntimeNode &call = (MachCallRuntimeNode&)n;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   677
  return MachCallNode::cmp(call) && !strcmp(_name,call._name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   678
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   679
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   680
void MachCallRuntimeNode::dump_spec(outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   681
  st->print("%s ",_name);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   682
  MachCallNode::dump_spec(st);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   683
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   684
#endif
489c9b5090e2 Initial load
duke
parents:
diff changeset
   685
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   686
// A shared JVMState for all HaltNodes.  Indicates the start of debug info
489c9b5090e2 Initial load
duke
parents:
diff changeset
   687
// is at TypeFunc::Parms.  Only required for SOE register spill handling -
489c9b5090e2 Initial load
duke
parents:
diff changeset
   688
// to indicate where the stack-slot-only debug info inputs begin.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   689
// There is no other JVM state needed here.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   690
JVMState jvms_for_throw(0);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   691
JVMState *MachHaltNode::jvms() const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   692
  return &jvms_for_throw;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   693
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   694
489c9b5090e2 Initial load
duke
parents:
diff changeset
   695
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   696
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   697
void labelOper::int_format(PhaseRegAlloc *ra, const MachNode *node, outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   698
  st->print("B%d", _block_num);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   699
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   700
#endif // PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   701
489c9b5090e2 Initial load
duke
parents:
diff changeset
   702
//=============================================================================
489c9b5090e2 Initial load
duke
parents:
diff changeset
   703
#ifndef PRODUCT
489c9b5090e2 Initial load
duke
parents:
diff changeset
   704
void methodOper::int_format(PhaseRegAlloc *ra, const MachNode *node, outputStream *st) const {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   705
  st->print(INTPTR_FORMAT, _method);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   706
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   707
#endif // PRODUCT