aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/opto
diff options
context:
space:
mode:
authornever <none@none>2011-09-11 14:48:24 -0700
committernever <none@none>2011-09-11 14:48:24 -0700
commit1ba80eadade14052eb5f6048c6c66214c4742ceb (patch)
treebf3cbf417a7ff50cde7c76ecf32b03708b6b9c48 /src/share/vm/opto
parent0cb0b6357f69f9e8015d0aee4cf10a123e5e3fdf (diff)
7088955: add C2 IR support to the SA
Reviewed-by: kvn
Diffstat (limited to 'src/share/vm/opto')
-rw-r--r--src/share/vm/opto/block.hpp10
-rw-r--r--src/share/vm/opto/bytecodeInfo.cpp19
-rw-r--r--src/share/vm/opto/callnode.hpp5
-rw-r--r--src/share/vm/opto/chaitin.hpp6
-rw-r--r--src/share/vm/opto/compile.hpp2
-rw-r--r--src/share/vm/opto/node.hpp9
-rw-r--r--src/share/vm/opto/optoreg.hpp3
-rw-r--r--src/share/vm/opto/parse.hpp7
-rw-r--r--src/share/vm/opto/regalloc.hpp3
-rw-r--r--src/share/vm/opto/type.hpp2
10 files changed, 59 insertions, 7 deletions
diff --git a/src/share/vm/opto/block.hpp b/src/share/vm/opto/block.hpp
index 7a3c224ef..51869c8da 100644
--- a/src/share/vm/opto/block.hpp
+++ b/src/share/vm/opto/block.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,6 +45,7 @@ struct Tarjan;
// Note that the constructor just zeros things, and since I use Arena
// allocation I do not need a destructor to reclaim storage.
class Block_Array : public ResourceObj {
+ friend class VMStructs;
uint _size; // allocated size, as opposed to formal limit
debug_only(uint _limit;) // limit to formal domain
protected:
@@ -72,6 +73,7 @@ public:
class Block_List : public Block_Array {
+ friend class VMStructs;
public:
uint _cnt;
Block_List() : Block_Array(Thread::current()->resource_area()), _cnt(0) {}
@@ -87,6 +89,7 @@ public:
class CFGElement : public ResourceObj {
+ friend class VMStructs;
public:
float _freq; // Execution frequency (estimate)
@@ -102,6 +105,7 @@ class CFGElement : public ResourceObj {
// Basic blocks are used during the output routines, and are not used during
// any optimization pass. They are created late in the game.
class Block : public CFGElement {
+ friend class VMStructs;
public:
// Nodes in this block, in order
Node_List _nodes;
@@ -341,6 +345,7 @@ class Block : public CFGElement {
//------------------------------PhaseCFG---------------------------------------
// Build an array of Basic Block pointers, one per Node.
class PhaseCFG : public Phase {
+ friend class VMStructs;
private:
// Build a proper looking cfg. Return count of basic blocks
uint build_cfg();
@@ -515,6 +520,7 @@ public:
//------------------------------CFGLoop-------------------------------------------
class CFGLoop : public CFGElement {
+ friend class VMStructs;
int _id;
int _depth;
CFGLoop *_parent; // root of loop tree is the method level "pseudo" loop, it's parent is null
@@ -566,6 +572,7 @@ class CFGLoop : public CFGElement {
// A edge between two basic blocks that will be embodied by a branch or a
// fall-through.
class CFGEdge : public ResourceObj {
+ friend class VMStructs;
private:
Block * _from; // Source basic block
Block * _to; // Destination basic block
@@ -702,6 +709,7 @@ class Trace : public ResourceObj {
//------------------------------PhaseBlockLayout-------------------------------
// Rearrange blocks into some canonical order, based on edges and their frequencies
class PhaseBlockLayout : public Phase {
+ friend class VMStructs;
PhaseCFG &_cfg; // Control flow graph
GrowableArray<CFGEdge *> *edges;
diff --git a/src/share/vm/opto/bytecodeInfo.cpp b/src/share/vm/opto/bytecodeInfo.cpp
index a29159686..71754274b 100644
--- a/src/share/vm/opto/bytecodeInfo.cpp
+++ b/src/share/vm/opto/bytecodeInfo.cpp
@@ -610,3 +610,22 @@ InlineTree* InlineTree::find_subtree_from_root(InlineTree* root, JVMState* jvms,
}
return iltp;
}
+
+
+
+#ifndef PRODUCT
+void InlineTree::print_impl(outputStream* st, int indent) const {
+ for (int i = 0; i < indent; i++) st->print(" ");
+ st->print(" @ %d ", caller_bci());
+ method()->print_short_name(st);
+ st->cr();
+
+ for (int i = 0 ; i < _subtrees.length(); i++) {
+ _subtrees.at(i)->print_impl(st, indent + 2);
+ }
+}
+
+void InlineTree::print_value_on(outputStream* st) const {
+ print_impl(st, 2);
+}
+#endif
diff --git a/src/share/vm/opto/callnode.hpp b/src/share/vm/opto/callnode.hpp
index ee72a6e3a..6e81a7e8d 100644
--- a/src/share/vm/opto/callnode.hpp
+++ b/src/share/vm/opto/callnode.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -187,6 +187,7 @@ public:
// This provides a way to map the optimized program back into the interpreter,
// or to let the GC mark the stack.
class JVMState : public ResourceObj {
+ friend class VMStructs;
public:
typedef enum {
Reexecute_Undefined = -1, // not defined -- will be translated into false later
@@ -500,6 +501,7 @@ public:
// Call nodes now subsume the function of debug nodes at callsites, so they
// contain the functionality of a full scope chain of debug nodes.
class CallNode : public SafePointNode {
+ friend class VMStructs;
public:
const TypeFunc *_tf; // Function type
address _entry_point; // Address of method being called
@@ -565,6 +567,7 @@ public:
// convention. (The "Java" calling convention is the compiler's calling
// convention, as opposed to the interpreter's or that of native C.)
class CallJavaNode : public CallNode {
+ friend class VMStructs;
protected:
virtual uint cmp( const Node &n ) const;
virtual uint size_of() const; // Size is bigger
diff --git a/src/share/vm/opto/chaitin.hpp b/src/share/vm/opto/chaitin.hpp
index af116050c..999a79227 100644
--- a/src/share/vm/opto/chaitin.hpp
+++ b/src/share/vm/opto/chaitin.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -50,6 +50,7 @@ class PhaseChaitin;
//------------------------------LRG--------------------------------------------
// Live-RanGe structure.
class LRG : public ResourceObj {
+ friend class VMStructs;
public:
enum { SPILL_REG=29999 }; // Register number of a spilled LRG
@@ -181,6 +182,7 @@ public:
// Map Node indices to Live RanGe indices.
// Array lookup in the optimized case.
class LRG_List : public ResourceObj {
+ friend class VMStructs;
uint _cnt, _max;
uint* _lidxs;
ReallocMark _nesting; // assertion check for reallocations
@@ -211,6 +213,7 @@ public:
// abstract! It needs abstraction so I can fiddle with the implementation to
// get even more speed.
class PhaseIFG : public Phase {
+ friend class VMStructs;
// Current implementation: a triangular adjacency list.
// Array of adjacency-lists, indexed by live-range number
@@ -294,6 +297,7 @@ public:
//------------------------------Chaitin----------------------------------------
// Briggs-Chaitin style allocation, mostly.
class PhaseChaitin : public PhaseRegAlloc {
+ friend class VMStructs;
int _trip_cnt;
int _alternate;
diff --git a/src/share/vm/opto/compile.hpp b/src/share/vm/opto/compile.hpp
index 3a883188d..82e33a93a 100644
--- a/src/share/vm/opto/compile.hpp
+++ b/src/share/vm/opto/compile.hpp
@@ -80,6 +80,8 @@ class WarmCallInfo;
// This class defines a top-level Compiler invocation.
class Compile : public Phase {
+ friend class VMStructs;
+
public:
// Fixed alias indexes. (See also MergeMemNode.)
enum {
diff --git a/src/share/vm/opto/node.hpp b/src/share/vm/opto/node.hpp
index e88c4b96f..8564a7775 100644
--- a/src/share/vm/opto/node.hpp
+++ b/src/share/vm/opto/node.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -184,6 +184,8 @@ typedef Node** DUIterator_Last;
// whenever I have phase-specific information.
class Node {
+ friend class VMStructs;
+
// Lots of restrictions on cloning Nodes
Node(const Node&); // not defined; linker error to use these
Node &operator=(const Node &rhs);
@@ -1286,6 +1288,7 @@ class SimpleDUIterator : public StackObj {
// Note that the constructor just zeros things, and since I use Arena
// allocation I do not need a destructor to reclaim storage.
class Node_Array : public ResourceObj {
+ friend class VMStructs;
protected:
Arena *_a; // Arena to allocate in
uint _max;
@@ -1316,6 +1319,7 @@ public:
};
class Node_List : public Node_Array {
+ friend class VMStructs;
uint _cnt;
public:
Node_List() : Node_Array(Thread::current()->resource_area()), _cnt(0) {}
@@ -1339,6 +1343,7 @@ public:
//------------------------------Unique_Node_List-------------------------------
class Unique_Node_List : public Node_List {
+ friend class VMStructs;
VectorSet _in_worklist;
uint _clock_index; // Index in list where to pop from next
public:
@@ -1389,6 +1394,7 @@ inline void Compile::record_for_igvn(Node* n) {
//------------------------------Node_Stack-------------------------------------
class Node_Stack {
+ friend class VMStructs;
protected:
struct INode {
Node *node; // Processed node
@@ -1461,6 +1467,7 @@ public:
// Debugging or profiling annotations loosely and sparsely associated
// with some nodes. See Compile::node_notes_at for the accessor.
class Node_Notes VALUE_OBJ_CLASS_SPEC {
+ friend class VMStructs;
JVMState* _jvms;
public:
diff --git a/src/share/vm/opto/optoreg.hpp b/src/share/vm/opto/optoreg.hpp
index 58c9f1c69..e6427ea45 100644
--- a/src/share/vm/opto/optoreg.hpp
+++ b/src/share/vm/opto/optoreg.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -172,6 +172,7 @@ class OptoReg VALUE_OBJ_CLASS_SPEC {
// and converting that will return OptoReg::Bad losing the identity of the OptoReg.
class OptoRegPair {
+ friend class VMStructs;
private:
short _second;
short _first;
diff --git a/src/share/vm/opto/parse.hpp b/src/share/vm/opto/parse.hpp
index ea793f029..ec9a08358 100644
--- a/src/share/vm/opto/parse.hpp
+++ b/src/share/vm/opto/parse.hpp
@@ -41,6 +41,8 @@ class SwitchRange;
//------------------------------InlineTree-------------------------------------
class InlineTree : public ResourceObj {
+ friend class VMStructs;
+
Compile* C; // cache
JVMState* _caller_jvms; // state of caller
ciMethod* _method; // method being called by the caller_jvms
@@ -54,7 +56,8 @@ class InlineTree : public ResourceObj {
float compute_callee_frequency( int caller_bci ) const;
GrowableArray<InlineTree*> _subtrees;
- friend class Compile;
+
+ void print_impl(outputStream* stj, int indent) const PRODUCT_RETURN;
protected:
InlineTree(Compile* C,
@@ -121,6 +124,8 @@ public:
uint count_inlines() const { return _count_inlines; };
#endif
GrowableArray<InlineTree*> subtrees() { return _subtrees; }
+
+ void print_value_on(outputStream* st) const PRODUCT_RETURN;
};
diff --git a/src/share/vm/opto/regalloc.hpp b/src/share/vm/opto/regalloc.hpp
index 71f4defc2..d0a993e57 100644
--- a/src/share/vm/opto/regalloc.hpp
+++ b/src/share/vm/opto/regalloc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -39,6 +39,7 @@ class PhaseCFG;
//------------------------------PhaseRegAlloc------------------------------------
// Abstract register allocator
class PhaseRegAlloc : public Phase {
+ friend class VMStructs;
static void (*_alloc_statistics[MAX_REG_ALLOCATORS])();
static int _num_allocators;
diff --git a/src/share/vm/opto/type.hpp b/src/share/vm/opto/type.hpp
index 4d08d50d5..133ce78f0 100644
--- a/src/share/vm/opto/type.hpp
+++ b/src/share/vm/opto/type.hpp
@@ -64,6 +64,8 @@ class TypeKlassPtr;
// different kind of Type exists. Types are never modified after creation, so
// all their interesting fields are constant.
class Type {
+ friend class VMStructs;
+
public:
enum TYPES {
Bad=0, // Type check