src/share/vm/ci/ciMethodHandle.hpp

changeset 2903
fabcf26ee72f
parent 2898
e2a92dd0d3d2
child 2949
f918d6096e23
equal deleted inserted replaced
2902:2f17eb233d13 2903:fabcf26ee72f
33 // 33 //
34 // The class represents a java.lang.invoke.MethodHandle object. 34 // The class represents a java.lang.invoke.MethodHandle object.
35 class ciMethodHandle : public ciInstance { 35 class ciMethodHandle : public ciInstance {
36 private: 36 private:
37 ciMethod* _callee; 37 ciMethod* _callee;
38 ciMethod* _caller;
38 ciCallProfile* _profile; 39 ciCallProfile* _profile;
39 40
40 // Return an adapter for this MethodHandle. 41 // Return an adapter for this MethodHandle.
41 ciMethod* get_adapter(bool is_invokedynamic) const; 42 ciMethod* get_adapter_impl(bool is_invokedynamic) const;
43 ciMethod* get_adapter( bool is_invokedynamic) const;
42 44
43 protected: 45 protected:
44 void print_impl(outputStream* st); 46 void print_impl(outputStream* st);
45 47
46 public: 48 public:
47 ciMethodHandle(instanceHandle h_i) : ciInstance(h_i) {}; 49 ciMethodHandle(instanceHandle h_i) :
50 ciInstance(h_i),
51 _callee(NULL),
52 _caller(NULL),
53 _profile(NULL)
54 {}
48 55
49 // What kind of ciObject is this? 56 // What kind of ciObject is this?
50 bool is_method_handle() const { return true; } 57 bool is_method_handle() const { return true; }
51 58
52 ciMethod* callee() const { return _callee; } 59 void set_callee(ciMethod* m) { _callee = m; }
53 void set_callee(ciMethod* m) { _callee = m; } 60 void set_caller(ciMethod* m) { _caller = m; }
54 61 void set_call_profile(ciCallProfile* profile) { _profile = profile; }
55 ciCallProfile* call_profile() const { return _profile; }
56 void set_call_profile(ciCallProfile* profile) { _profile = profile; }
57 62
58 // Return an adapter for a MethodHandle call. 63 // Return an adapter for a MethodHandle call.
59 ciMethod* get_method_handle_adapter() const { 64 ciMethod* get_method_handle_adapter() const { return get_adapter(false); }
60 return get_adapter(false);
61 }
62 65
63 // Return an adapter for an invokedynamic call. 66 // Return an adapter for an invokedynamic call.
64 ciMethod* get_invokedynamic_adapter() const { 67 ciMethod* get_invokedynamic_adapter() const { return get_adapter(true); }
65 return get_adapter(true);
66 }
67 }; 68 };
68 69
69 #endif // SHARE_VM_CI_CIMETHODHANDLE_HPP 70 #endif // SHARE_VM_CI_CIMETHODHANDLE_HPP

mercurial