hotspot/src/share/vm/opto/intrinsicnode.hpp
author iveresov
Thu, 22 Jan 2015 11:25:23 -0800
changeset 28723 0a36120cb225
parent 23528 8f1a7f5e8066
child 33628 09241459a8b8
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:
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_INTRINSICNODE_HPP
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    26
#define SHARE_VM_OPTO_INTRINSICNODE_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
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    32
//----------------------PartialSubtypeCheckNode--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    33
// The 2nd slow-half of a subtype check.  Scan the subklass's 2ndary superklass
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    34
// array for an instance of the superklass.  Set a hidden internal cache on a
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    35
// hit (cache is checked with exposed code in gen_subtype_check()).  Return
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    36
// not zero for a miss or zero for a hit.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    37
class PartialSubtypeCheckNode : public Node {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    38
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    39
  PartialSubtypeCheckNode(Node* c, Node* sub, Node* super) : Node(c,sub,super) {}
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    40
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    41
  virtual const Type *bottom_type() const { return TypeRawPtr::BOTTOM; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    42
  virtual uint ideal_reg() const { return Op_RegP; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    43
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    44
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    45
//------------------------------StrIntrinsic-------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    46
// Base class for Ideal nodes used in String instrinsic code.
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    47
class StrIntrinsicNode: public Node {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    48
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    49
  StrIntrinsicNode(Node* control, Node* char_array_mem,
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    50
                   Node* s1, Node* c1, Node* s2, Node* c2):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    51
  Node(control, char_array_mem, s1, c1, s2, c2) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    52
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    53
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    54
  StrIntrinsicNode(Node* control, Node* char_array_mem,
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    55
                   Node* s1, Node* s2, Node* c):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    56
  Node(control, char_array_mem, s1, s2, c) {
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
  StrIntrinsicNode(Node* control, Node* char_array_mem,
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    60
                   Node* s1, Node* s2):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    61
  Node(control, char_array_mem, s1, s2) {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    62
  }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    63
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    64
  virtual bool depends_only_on_test() const { return false; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    65
  virtual const TypePtr* adr_type() const { return TypeAryPtr::CHARS; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    66
  virtual uint match_edge(uint idx) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    67
  virtual uint ideal_reg() const { return Op_RegI; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    68
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    69
  virtual const Type *Value(PhaseTransform *phase) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    70
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    71
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    72
//------------------------------StrComp-------------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    73
class StrCompNode: public StrIntrinsicNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    74
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    75
  StrCompNode(Node* control, Node* char_array_mem,
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    76
              Node* s1, Node* c1, Node* s2, Node* c2):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    77
  StrIntrinsicNode(control, char_array_mem, s1, c1, s2, c2) {};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    78
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    79
  virtual const Type* bottom_type() const { return TypeInt::INT; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    80
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    81
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    82
//------------------------------StrEquals-------------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    83
class StrEqualsNode: public StrIntrinsicNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    84
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    85
  StrEqualsNode(Node* control, Node* char_array_mem,
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    86
                Node* s1, Node* s2, Node* c):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    87
  StrIntrinsicNode(control, char_array_mem, s1, s2, c) {};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    88
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    89
  virtual const Type* bottom_type() const { return TypeInt::BOOL; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    90
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    91
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    92
//------------------------------StrIndexOf-------------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    93
class StrIndexOfNode: public StrIntrinsicNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    94
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    95
  StrIndexOfNode(Node* control, Node* char_array_mem,
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    96
                 Node* s1, Node* c1, Node* s2, Node* c2):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    97
  StrIntrinsicNode(control, char_array_mem, s1, c1, s2, c2) {};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    98
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
    99
  virtual const Type* bottom_type() const { return TypeInt::INT; }
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
//------------------------------AryEq---------------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   103
class AryEqNode: public StrIntrinsicNode {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   104
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   105
  AryEqNode(Node* control, Node* char_array_mem, Node* s1, Node* s2):
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   106
  StrIntrinsicNode(control, char_array_mem, s1, s2) {};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   107
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   108
  virtual const Type* bottom_type() const { return TypeInt::BOOL; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   109
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   110
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   111
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   112
//------------------------------EncodeISOArray--------------------------------
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   113
// encode char[] to byte[] in ISO_8859_1
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   114
class EncodeISOArrayNode: public Node {
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   115
  public:
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   116
  EncodeISOArrayNode(Node *control, Node* arymem, Node* s1, Node* s2, Node* c): Node(control, arymem, s1, s2, c) {};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   117
  virtual int Opcode() const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   118
  virtual bool depends_only_on_test() const { return false; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   119
  virtual const Type* bottom_type() const { return TypeInt::INT; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   120
  virtual const TypePtr* adr_type() const { return TypePtr::BOTTOM; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   121
  virtual uint match_edge(uint idx) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   122
  virtual uint ideal_reg() const { return Op_RegI; }
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   123
  virtual Node *Ideal(PhaseGVN *phase, bool can_reshape);
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   124
  virtual const Type *Value(PhaseTransform *phase) const;
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   125
};
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   126
8f1a7f5e8066 8001532: C2 node files refactoring
morris
parents:
diff changeset
   127
#endif // SHARE_VM_OPTO_INTRINSICNODE_HPP