hotspot/src/share/vm/opto/narrowptrnode.hpp
author goetz
Mon, 02 Nov 2015 15:52:37 +0100
changeset 34194 213af0859e7e
parent 30300 4b12a5b40064
child 35551 36ef3841fb34
permissions -rw-r--r--
8141137: C2 fails rematerializing nodes using flag registers. Summary: Don't rem. if input stretches several live ranges. If rem., don't add SpillCopy on RegFlags edge. Reviewed-by: kvn, vlivanov
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23528
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     1
/*
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     4
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     8
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    13
 * accompanied this code).
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    14
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    18
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    21
 * questions.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    22
 *
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    23
 */
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    24
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    25
#ifndef SHARE_VM_OPTO_NARROWPTRNODE_HPP
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    26
#define SHARE_VM_OPTO_NARROWPTRNODE_HPP
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    27
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    28
#include "opto/node.hpp"
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    29
#include "opto/opcodes.hpp"
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    30
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    31
//------------------------------EncodeNarrowPtr--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    32
class EncodeNarrowPtrNode : public TypeNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    33
  protected:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    34
  EncodeNarrowPtrNode(Node* value, const Type* type):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    35
  TypeNode(type, 2) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    36
    init_class_id(Class_EncodeNarrowPtr);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    37
    init_req(0, NULL);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    38
    init_req(1, value);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    39
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    40
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    41
  virtual uint  ideal_reg() const { return Op_RegN; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    42
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    43
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    44
//------------------------------EncodeP--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    45
// Encodes an oop pointers into its compressed form
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    46
// Takes an extra argument which is the real heap base as a long which
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    47
// may be useful for code generation in the backend.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    48
class EncodePNode : public EncodeNarrowPtrNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    49
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    50
  EncodePNode(Node* value, const Type* type):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    51
  EncodeNarrowPtrNode(value, type) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    52
    init_class_id(Class_EncodeP);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    53
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    54
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    55
  virtual Node *Identity( PhaseTransform *phase );
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    56
  virtual const Type *Value( PhaseTransform *phase ) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    57
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    58
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    59
//------------------------------EncodePKlass--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    60
// Encodes a klass pointer into its compressed form
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    61
// Takes an extra argument which is the real heap base as a long which
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    62
// may be useful for code generation in the backend.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    63
class EncodePKlassNode : public EncodeNarrowPtrNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    64
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    65
  EncodePKlassNode(Node* value, const Type* type):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    66
  EncodeNarrowPtrNode(value, type) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    67
    init_class_id(Class_EncodePKlass);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    68
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    69
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    70
  virtual Node *Identity( PhaseTransform *phase );
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    71
  virtual const Type *Value( PhaseTransform *phase ) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    72
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    73
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    74
//------------------------------DecodeNarrowPtr--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    75
class DecodeNarrowPtrNode : public TypeNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    76
  protected:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    77
  DecodeNarrowPtrNode(Node* value, const Type* type):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    78
  TypeNode(type, 2) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    79
    init_class_id(Class_DecodeNarrowPtr);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    80
    init_req(0, NULL);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    81
    init_req(1, value);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    82
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    83
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    84
  virtual uint  ideal_reg() const { return Op_RegP; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    85
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    86
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    87
//------------------------------DecodeN--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    88
// Converts a narrow oop into a real oop ptr.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    89
// Takes an extra argument which is the real heap base as a long which
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    90
// may be useful for code generation in the backend.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    91
class DecodeNNode : public DecodeNarrowPtrNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    92
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    93
  DecodeNNode(Node* value, const Type* type):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    94
  DecodeNarrowPtrNode(value, type) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    95
    init_class_id(Class_DecodeN);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    96
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    97
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    98
  virtual const Type *Value( PhaseTransform *phase ) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    99
  virtual Node *Identity( PhaseTransform *phase );
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   100
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   101
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   102
//------------------------------DecodeNKlass--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   103
// Converts a narrow klass pointer into a real klass ptr.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   104
// Takes an extra argument which is the real heap base as a long which
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   105
// may be useful for code generation in the backend.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   106
class DecodeNKlassNode : public DecodeNarrowPtrNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   107
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   108
  DecodeNKlassNode(Node* value, const Type* type):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   109
  DecodeNarrowPtrNode(value, type) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   110
    init_class_id(Class_DecodeNKlass);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   111
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   112
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   113
  virtual const Type *Value( PhaseTransform *phase ) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   114
  virtual Node *Identity( PhaseTransform *phase );
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   115
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   116
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   117
#endif // SHARE_VM_OPTO_NARROWPTRNODE_HPP
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   118