mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
7071307: MethodHandle bimorphic inlining should consider the frequency
Reviewed-by: twisti, roland, kvn, iveresov
This commit is contained in:
parent
1038fed51d
commit
32fd1b087d
20 changed files with 346 additions and 61 deletions
|
@ -981,6 +981,34 @@ class java_lang_invoke_AdapterMethodHandle: public java_lang_invoke_BoundMethodH
|
|||
};
|
||||
|
||||
|
||||
// A simple class that maintains an invocation count
|
||||
class java_lang_invoke_CountingMethodHandle: public java_lang_invoke_MethodHandle {
|
||||
friend class JavaClasses;
|
||||
|
||||
private:
|
||||
static int _vmcount_offset;
|
||||
static void compute_offsets();
|
||||
|
||||
public:
|
||||
// Accessors
|
||||
static int vmcount(oop mh);
|
||||
static void set_vmcount(oop mh, int count);
|
||||
|
||||
// Testers
|
||||
static bool is_subclass(klassOop klass) {
|
||||
return SystemDictionary::CountingMethodHandle_klass() != NULL &&
|
||||
Klass::cast(klass)->is_subclass_of(SystemDictionary::CountingMethodHandle_klass());
|
||||
}
|
||||
static bool is_instance(oop obj) {
|
||||
return obj != NULL && is_subclass(obj->klass());
|
||||
}
|
||||
|
||||
// Accessors for code generation:
|
||||
static int vmcount_offset_in_bytes() { return _vmcount_offset; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Interface to java.lang.invoke.MemberName objects
|
||||
// (These are a private interface for Java code to query the class hierarchy.)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue