104 // VtableStubs creates the code stubs for compiled calls through vtables.
105 // There is one stub per (vtable index, args_size) pair, and the stubs are
106 // never deallocated. They don't need to be GCed because they contain no oops.
107
108 class VtableStubs : AllStatic {
109 public: // N must be public (some compilers need this for _table)
110 enum {
111 N = 256, // size of stub table; must be power of two
112 mask = N - 1
113 };
114
115 private:
116 static VtableStub* _table[N]; // table of existing stubs
117 static int _number_of_vtable_stubs; // number of stubs created so far (for statistics)
118
119 static VtableStub* create_vtable_stub(int vtable_index);
120 static VtableStub* create_itable_stub(int vtable_index);
121 static VtableStub* lookup (bool is_vtable_stub, int vtable_index);
122 static void enter (bool is_vtable_stub, int vtable_index, VtableStub* s);
123 static inline uint hash (bool is_vtable_stub, int vtable_index);
124
125 public:
126 static address create_stub(bool is_vtable_stub, int vtable_index, Method* method); // return the entry point of a stub for this call
127 static bool is_entry_point(address pc); // is pc a vtable stub entry point?
128 static bool contains(address pc); // is pc within any stub?
129 static VtableStub* stub_containing(address pc); // stub containing pc or NULL
130 static int number_of_vtable_stubs() { return _number_of_vtable_stubs; }
131 static void initialize();
132 };
133
134 #endif // SHARE_VM_CODE_VTABLESTUBS_HPP
|
104 // VtableStubs creates the code stubs for compiled calls through vtables.
105 // There is one stub per (vtable index, args_size) pair, and the stubs are
106 // never deallocated. They don't need to be GCed because they contain no oops.
107
108 class VtableStubs : AllStatic {
109 public: // N must be public (some compilers need this for _table)
110 enum {
111 N = 256, // size of stub table; must be power of two
112 mask = N - 1
113 };
114
115 private:
116 static VtableStub* _table[N]; // table of existing stubs
117 static int _number_of_vtable_stubs; // number of stubs created so far (for statistics)
118
119 static VtableStub* create_vtable_stub(int vtable_index);
120 static VtableStub* create_itable_stub(int vtable_index);
121 static VtableStub* lookup (bool is_vtable_stub, int vtable_index);
122 static void enter (bool is_vtable_stub, int vtable_index, VtableStub* s);
123 static inline uint hash (bool is_vtable_stub, int vtable_index);
124 static address find_stub (bool is_vtable_stub, int vtable_index);
125
126 public:
127 static address find_vtable_stub(int vtable_index) { return find_stub(true, vtable_index); }
128 static address find_itable_stub(int itable_index) { return find_stub(false, itable_index); }
129 static bool is_entry_point(address pc); // is pc a vtable stub entry point?
130 static bool contains(address pc); // is pc within any stub?
131 static VtableStub* stub_containing(address pc); // stub containing pc or NULL
132 static int number_of_vtable_stubs() { return _number_of_vtable_stubs; }
133 static void initialize();
134 };
135
136 #endif // SHARE_VM_CODE_VTABLESTUBS_HPP
|