00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifdef DELTA_COMPILER
00030
00031 class RFrame : public PrintableResourceObj {
00032 protected:
00033 frame _fr;
00034 RFrame* _caller, *_callee;
00035 int _num;
00036 int _distance;
00037 int _invocations;
00038
00039 int _ncallers;
00040 int _sends;
00041 int _cumulSends;
00042 int _loopDepth;
00043
00044 RFrame(frame fr, const RFrame* callee);
00045 virtual void init() = 0;
00046 void print(const char* name);
00047
00048 public:
00049
00050 static RFrame* new_RFrame(frame fr, const RFrame* callee);
00051
00052 virtual bool is_interpreted() const { return false; }
00053 virtual bool is_compiled() const { return false; }
00054 bool is_super() const;
00055 int invocations() const { return _invocations; }
00056 int sends() const { return _sends; }
00057 int cumulSends() const { return _cumulSends; }
00058 int loopDepth() const { return _loopDepth; }
00059 int num() const { return _num; }
00060 int distance() const { return _distance; }
00061 void set_distance(int d);
00062 int nCallers() const { return _ncallers; }
00063 bool is_blockMethod() const;
00064 frame fr() const { return _fr; }
00065 virtual LookupKey* key() const = 0;
00066 virtual int cost() const = 0;
00067 virtual methodOop top_method() const = 0;
00068 virtual deltaVFrame* top_vframe() const = 0;
00069 virtual void cleanupStaleInlineCaches() = 0;
00070 virtual nmethod* nm() const { ShouldNotCallThis(); return NULL; }
00071 bool hasBlockArgs() const;
00072 GrowableArray<blockClosureOop>* blockArgs() const;
00073
00074 RFrame* caller();
00075 RFrame* callee() const { return _callee; }
00076 RFrame* parent() const;
00077 void print() = 0;
00078
00079 static int computeSends(methodOop m);
00080 static int computeSends(nmethod* nm);
00081 static int computeCumulSends(methodOop m);
00082 static int computeCumulSends(nmethod* nm);
00083 };
00084
00085 class CompiledRFrame : public RFrame {
00086 protected:
00087 nmethod* _nm;
00088 deltaVFrame* _vf;
00089
00090 CompiledRFrame(frame fr, const RFrame* callee);
00091 void init();
00092 friend class RFrame;
00093
00094 public:
00095 CompiledRFrame(frame fr);
00096 bool is_compiled() const { return true; }
00097 methodOop top_method() const;
00098 deltaVFrame* top_vframe() const { return _vf; }
00099 nmethod* nm() const { return _nm; }
00100 LookupKey* key() const;
00101 int cost() const;
00102 void cleanupStaleInlineCaches();
00103 void print();
00104 };
00105
00106 class InterpretedRFrame : public RFrame {
00107 protected:
00108 methodOop _method;
00109 int _bci;
00110 klassOop _receiverKlass;
00111 deltaVFrame* _vf;
00112 LookupKey* _key;
00113
00114 InterpretedRFrame(frame fr, const RFrame* callee);
00115 void init();
00116 friend class RFrame;
00117
00118 public:
00119 InterpretedRFrame(frame fr, methodOop m, klassOop rcvrKlass);
00120 bool is_interpreted() const { return true; }
00121 methodOop top_method() const { return _method; }
00122 deltaVFrame* top_vframe() const { return _vf; }
00123 LookupKey* key() const;
00124 int cost() const;
00125 void cleanupStaleInlineCaches();
00126 void print();
00127 };
00128
00129 #endif