86 class C2EntryBarrierStub: public C2CodeStub {
87 private:
88 Label _guard; // Used on AArch64 and RISCV
89
90 public:
91 C2EntryBarrierStub() : C2CodeStub(),
92 _guard() {}
93
94 Label& guard() { return _guard; }
95
96 int max_size() const;
97 void emit(C2_MacroAssembler& masm);
98 };
99
100 class C2FastUnlockLightweightStub : public C2CodeStub {
101 private:
102 Register _obj;
103 Register _mark;
104 Register _t;
105 Register _thread;
106 Label _push_and_slow_path;
107 Label _check_successor;
108 Label _unlocked_continuation;
109 public:
110 C2FastUnlockLightweightStub(Register obj, Register mark, Register t, Register thread) : C2CodeStub(),
111 _obj(obj), _mark(mark), _t(t), _thread(thread) {}
112 int max_size() const;
113 void emit(C2_MacroAssembler& masm);
114 Label& push_and_slow_path() { return _push_and_slow_path; }
115 Label& check_successor() { return _check_successor; }
116 Label& unlocked_continuation() { return _unlocked_continuation; }
117 Label& slow_path_continuation() { return continuation(); }
118 };
119
120 #ifdef _LP64
121 class C2HandleAnonOMOwnerStub : public C2CodeStub {
122 private:
123 Register _monitor;
124 Register _tmp;
125 public:
126 C2HandleAnonOMOwnerStub(Register monitor, Register tmp = noreg) : C2CodeStub(),
127 _monitor(monitor), _tmp(tmp) {}
128 Register monitor() { return _monitor; }
129 Register tmp() { return _tmp; }
130 int max_size() const;
131 void emit(C2_MacroAssembler& masm);
132 };
133 #endif
134
135 //-----------------------------C2GeneralStub-----------------------------------
136 // A generalized stub that can be used to implement an arbitrary stub in a
137 // type-safe manner. An example:
138 //
139 // Register dst; XMMRegister src;
140 // // The lambda defining how the code is emitted in the stub
141 // auto slowpath = [](C2_MacroAssembler& masm, C2GeneralStub<Register, XMMRegister>& stub) {
142 // // Access the saved data in a type safe manner
143 // Register dst = stub.get<0>();
144 // XMMRegister src = stub.get<1>();
145 // masm.bind(stub.entry());
146 // ...
147 // masm.jump(stub.continuation());
148 // }
149 // // Create a stub with 2 data fields being dst and src, a max size of 4 bytes
150 // // and predefined emission function
151 // auto stub = C2CodeStub::make<Register, XMMRegister>(dst, src, 4, slowpath);
152 // __ jump_conditional(stub->entry());
153 // ...
|
86 class C2EntryBarrierStub: public C2CodeStub {
87 private:
88 Label _guard; // Used on AArch64 and RISCV
89
90 public:
91 C2EntryBarrierStub() : C2CodeStub(),
92 _guard() {}
93
94 Label& guard() { return _guard; }
95
96 int max_size() const;
97 void emit(C2_MacroAssembler& masm);
98 };
99
100 class C2FastUnlockLightweightStub : public C2CodeStub {
101 private:
102 Register _obj;
103 Register _mark;
104 Register _t;
105 Register _thread;
106 Label _slow_path;
107 Label _push_and_slow_path;
108 Label _check_successor;
109 Label _unlocked_continuation;
110 public:
111 C2FastUnlockLightweightStub(Register obj, Register mark, Register t, Register thread) : C2CodeStub(),
112 _obj(obj), _mark(mark), _t(t), _thread(thread) {}
113 int max_size() const;
114 void emit(C2_MacroAssembler& masm);
115 Label& slow_path() { return _slow_path; }
116 Label& push_and_slow_path() { return _push_and_slow_path; }
117 Label& check_successor() { return _check_successor; }
118 Label& unlocked_continuation() { return _unlocked_continuation; }
119 Label& slow_path_continuation() { return continuation(); }
120 };
121
122 #ifdef _LP64
123 class C2HandleAnonOMOwnerStub : public C2CodeStub {
124 private:
125 Register _monitor;
126 Register _tmp;
127 public:
128 C2HandleAnonOMOwnerStub(Register monitor, Register tmp = noreg) : C2CodeStub(),
129 _monitor(monitor), _tmp(tmp) {}
130 Register monitor() { return _monitor; }
131 Register tmp() { return _tmp; }
132 int max_size() const;
133 void emit(C2_MacroAssembler& masm);
134 };
135 #endif // _LP64
136
137 //-----------------------------C2GeneralStub-----------------------------------
138 // A generalized stub that can be used to implement an arbitrary stub in a
139 // type-safe manner. An example:
140 //
141 // Register dst; XMMRegister src;
142 // // The lambda defining how the code is emitted in the stub
143 // auto slowpath = [](C2_MacroAssembler& masm, C2GeneralStub<Register, XMMRegister>& stub) {
144 // // Access the saved data in a type safe manner
145 // Register dst = stub.get<0>();
146 // XMMRegister src = stub.get<1>();
147 // masm.bind(stub.entry());
148 // ...
149 // masm.jump(stub.continuation());
150 // }
151 // // Create a stub with 2 data fields being dst and src, a max size of 4 bytes
152 // // and predefined emission function
153 // auto stub = C2CodeStub::make<Register, XMMRegister>(dst, src, 4, slowpath);
154 // __ jump_conditional(stub->entry());
155 // ...
|