src/share/vm/opto/memnode.hpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 








  25 // Portions of code courtesy of Clifford Click
  26 
  27 class MultiNode;
  28 class PhaseCCP;
  29 class PhaseTransform;
  30 
  31 //------------------------------MemNode----------------------------------------
  32 // Load or Store, possibly throwing a NULL pointer exception
  33 class MemNode : public Node {
  34 protected:
  35 #ifdef ASSERT
  36   const TypePtr* _adr_type;     // What kind of memory is being addressed?
  37 #endif
  38   virtual uint size_of() const; // Size is bigger (ASSERT only)
  39 public:
  40   enum { Control,               // When is it safe to do this load?
  41          Memory,                // Chunk of memory is being loaded from
  42          Address,               // Actually address, derived from base
  43          ValueIn,               // Value to store
  44          OopStore               // Preceeding oop store, only in StoreCM


1233 
1234 // Non-faulting prefetch load.  Prefetch for many reads.
1235 class PrefetchReadNode : public Node {
1236 public:
1237   PrefetchReadNode(Node *abio, Node *adr) : Node(0,abio,adr) {}
1238   virtual int Opcode() const;
1239   virtual uint ideal_reg() const { return NotAMachineReg; }
1240   virtual uint match_edge(uint idx) const { return idx==2; }
1241   virtual const Type *bottom_type() const { return Type::ABIO; }
1242 };
1243 
1244 // Non-faulting prefetch load.  Prefetch for many reads & many writes.
1245 class PrefetchWriteNode : public Node {
1246 public:
1247   PrefetchWriteNode(Node *abio, Node *adr) : Node(0,abio,adr) {}
1248   virtual int Opcode() const;
1249   virtual uint ideal_reg() const { return NotAMachineReg; }
1250   virtual uint match_edge(uint idx) const { return idx==2; }
1251   virtual const Type *bottom_type() const { return ( AllocatePrefetchStyle == 3 ) ? Type::MEMORY : Type::ABIO; }
1252 };


   1 /*
   2  * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_OPTO_MEMNODE_HPP
  26 #define SHARE_VM_OPTO_MEMNODE_HPP
  27 
  28 #include "opto/multnode.hpp"
  29 #include "opto/node.hpp"
  30 #include "opto/opcodes.hpp"
  31 #include "opto/type.hpp"
  32 
  33 // Portions of code courtesy of Clifford Click
  34 
  35 class MultiNode;
  36 class PhaseCCP;
  37 class PhaseTransform;
  38 
  39 //------------------------------MemNode----------------------------------------
  40 // Load or Store, possibly throwing a NULL pointer exception
  41 class MemNode : public Node {
  42 protected:
  43 #ifdef ASSERT
  44   const TypePtr* _adr_type;     // What kind of memory is being addressed?
  45 #endif
  46   virtual uint size_of() const; // Size is bigger (ASSERT only)
  47 public:
  48   enum { Control,               // When is it safe to do this load?
  49          Memory,                // Chunk of memory is being loaded from
  50          Address,               // Actually address, derived from base
  51          ValueIn,               // Value to store
  52          OopStore               // Preceeding oop store, only in StoreCM


1241 
1242 // Non-faulting prefetch load.  Prefetch for many reads.
1243 class PrefetchReadNode : public Node {
1244 public:
1245   PrefetchReadNode(Node *abio, Node *adr) : Node(0,abio,adr) {}
1246   virtual int Opcode() const;
1247   virtual uint ideal_reg() const { return NotAMachineReg; }
1248   virtual uint match_edge(uint idx) const { return idx==2; }
1249   virtual const Type *bottom_type() const { return Type::ABIO; }
1250 };
1251 
1252 // Non-faulting prefetch load.  Prefetch for many reads & many writes.
1253 class PrefetchWriteNode : public Node {
1254 public:
1255   PrefetchWriteNode(Node *abio, Node *adr) : Node(0,abio,adr) {}
1256   virtual int Opcode() const;
1257   virtual uint ideal_reg() const { return NotAMachineReg; }
1258   virtual uint match_edge(uint idx) const { return idx==2; }
1259   virtual const Type *bottom_type() const { return ( AllocatePrefetchStyle == 3 ) ? Type::MEMORY : Type::ABIO; }
1260 };
1261 
1262 #endif // SHARE_VM_OPTO_MEMNODE_HPP