Print this page
rev 2161 : [mq]: initial-intrinsification-changes
rev 2162 : [mq]: code-review-comments-vladimir
rev 2163 : [mq]: client_assertion_fauilure
rev 2164 : [mq]: code-review-comments-tom
Split |
Close |
Expand all |
Collapse all |
--- old/src/share/vm/c1/c1_CodeStubs.hpp
+++ new/src/share/vm/c1/c1_CodeStubs.hpp
1 1 /*
2 2 * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 *
5 5 * This code is free software; you can redistribute it and/or modify it
6 6 * under the terms of the GNU General Public License version 2 only, as
7 7 * published by the Free Software Foundation.
8 8 *
9 9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 12 * version 2 for more details (a copy is included in the LICENSE file that
13 13 * accompanied this code).
14 14 *
15 15 * You should have received a copy of the GNU General Public License version
16 16 * 2 along with this work; if not, write to the Free Software Foundation,
17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 18 *
19 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 20 * or visit www.oracle.com if you need additional information or have any
21 21 * questions.
22 22 *
23 23 */
24 24
25 25 #ifndef SHARE_VM_C1_C1_CODESTUBS_HPP
26 26 #define SHARE_VM_C1_C1_CODESTUBS_HPP
27 27
28 28 #include "c1/c1_FrameMap.hpp"
29 29 #include "c1/c1_IR.hpp"
30 30 #include "c1/c1_Instruction.hpp"
31 31 #include "c1/c1_LIR.hpp"
32 32 #include "c1/c1_Runtime1.hpp"
33 33 #include "utilities/array.hpp"
34 34
35 35 class CodeEmitInfo;
36 36 class LIR_Assembler;
37 37 class LIR_OpVisitState;
38 38
39 39 // CodeStubs are little 'out-of-line' pieces of code that
40 40 // usually handle slow cases of operations. All code stubs
41 41 // are collected and code is emitted at the end of the
42 42 // nmethod.
43 43
44 44 class CodeStub: public CompilationResourceObj {
45 45 protected:
46 46 Label _entry; // label at the stub entry point
47 47 Label _continuation; // label where stub continues, if any
48 48
49 49 public:
50 50 CodeStub() {}
51 51
52 52 // code generation
53 53 void assert_no_unbound_labels() { assert(!_entry.is_unbound() && !_continuation.is_unbound(), "unbound label"); }
54 54 virtual void emit_code(LIR_Assembler* e) = 0;
55 55 virtual CodeEmitInfo* info() const { return NULL; }
56 56 virtual bool is_exception_throw_stub() const { return false; }
57 57 virtual bool is_range_check_stub() const { return false; }
58 58 virtual bool is_divbyzero_stub() const { return false; }
59 59 #ifndef PRODUCT
60 60 virtual void print_name(outputStream* out) const = 0;
61 61 #endif
62 62
63 63 // label access
64 64 Label* entry() { return &_entry; }
65 65 Label* continuation() { return &_continuation; }
66 66 // for LIR
67 67 virtual void visit(LIR_OpVisitState* visit) {
68 68 #ifndef PRODUCT
69 69 if (LIRTracePeephole && Verbose) {
70 70 tty->print("no visitor for ");
71 71 print_name(tty);
72 72 tty->cr();
73 73 }
74 74 #endif
75 75 }
76 76 };
77 77
78 78
79 79 define_array(CodeStubArray, CodeStub*)
80 80 define_stack(_CodeStubList, CodeStubArray)
81 81
82 82 class CodeStubList: public _CodeStubList {
83 83 public:
84 84 CodeStubList(): _CodeStubList() {}
85 85
86 86 void append(CodeStub* stub) {
87 87 if (!contains(stub)) {
88 88 _CodeStubList::append(stub);
89 89 }
90 90 }
91 91 };
92 92
93 93 class CounterOverflowStub: public CodeStub {
94 94 private:
95 95 CodeEmitInfo* _info;
96 96 int _bci;
97 97 LIR_Opr _method;
98 98
99 99 public:
100 100 CounterOverflowStub(CodeEmitInfo* info, int bci, LIR_Opr method) : _info(info), _bci(bci), _method(method) {
101 101 }
102 102
103 103 virtual void emit_code(LIR_Assembler* e);
104 104
105 105 virtual void visit(LIR_OpVisitState* visitor) {
106 106 visitor->do_slow_case(_info);
107 107 visitor->do_input(_method);
108 108 }
109 109
110 110 #ifndef PRODUCT
111 111 virtual void print_name(outputStream* out) const { out->print("CounterOverflowStub"); }
112 112 #endif // PRODUCT
113 113
114 114 };
115 115
116 116 class ConversionStub: public CodeStub {
117 117 private:
118 118 Bytecodes::Code _bytecode;
119 119 LIR_Opr _input;
120 120 LIR_Opr _result;
121 121
122 122 static float float_zero;
123 123 static double double_zero;
124 124 public:
125 125 ConversionStub(Bytecodes::Code bytecode, LIR_Opr input, LIR_Opr result)
126 126 : _bytecode(bytecode), _input(input), _result(result) {
127 127 }
128 128
129 129 Bytecodes::Code bytecode() { return _bytecode; }
130 130 LIR_Opr input() { return _input; }
131 131 LIR_Opr result() { return _result; }
132 132
133 133 virtual void emit_code(LIR_Assembler* e);
134 134 virtual void visit(LIR_OpVisitState* visitor) {
135 135 visitor->do_slow_case();
136 136 visitor->do_input(_input);
137 137 visitor->do_output(_result);
138 138 }
139 139 #ifndef PRODUCT
140 140 virtual void print_name(outputStream* out) const { out->print("ConversionStub"); }
141 141 #endif // PRODUCT
142 142 };
143 143
144 144
145 145 // Throws ArrayIndexOutOfBoundsException by default but can be
146 146 // configured to throw IndexOutOfBoundsException in constructor
147 147 class RangeCheckStub: public CodeStub {
148 148 private:
149 149 CodeEmitInfo* _info;
150 150 LIR_Opr _index;
151 151 bool _throw_index_out_of_bounds_exception;
152 152
153 153 public:
154 154 RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, bool throw_index_out_of_bounds_exception = false);
155 155 virtual void emit_code(LIR_Assembler* e);
156 156 virtual CodeEmitInfo* info() const { return _info; }
157 157 virtual bool is_exception_throw_stub() const { return true; }
158 158 virtual bool is_range_check_stub() const { return true; }
159 159 virtual void visit(LIR_OpVisitState* visitor) {
160 160 visitor->do_slow_case(_info);
161 161 visitor->do_input(_index);
162 162 }
163 163 #ifndef PRODUCT
164 164 virtual void print_name(outputStream* out) const { out->print("RangeCheckStub"); }
165 165 #endif // PRODUCT
166 166 };
167 167
168 168
169 169 class DivByZeroStub: public CodeStub {
170 170 private:
171 171 CodeEmitInfo* _info;
172 172 int _offset;
173 173
174 174 public:
175 175 DivByZeroStub(CodeEmitInfo* info)
176 176 : _info(info), _offset(-1) {
177 177 }
178 178 DivByZeroStub(int offset, CodeEmitInfo* info)
179 179 : _info(info), _offset(offset) {
180 180 }
181 181 virtual void emit_code(LIR_Assembler* e);
182 182 virtual CodeEmitInfo* info() const { return _info; }
183 183 virtual bool is_exception_throw_stub() const { return true; }
184 184 virtual bool is_divbyzero_stub() const { return true; }
185 185 virtual void visit(LIR_OpVisitState* visitor) {
186 186 visitor->do_slow_case(_info);
187 187 }
188 188 #ifndef PRODUCT
189 189 virtual void print_name(outputStream* out) const { out->print("DivByZeroStub"); }
190 190 #endif // PRODUCT
191 191 };
192 192
193 193
194 194 class ImplicitNullCheckStub: public CodeStub {
195 195 private:
196 196 CodeEmitInfo* _info;
197 197 int _offset;
198 198
199 199 public:
200 200 ImplicitNullCheckStub(int offset, CodeEmitInfo* info)
201 201 : _offset(offset), _info(info) {
202 202 }
203 203 virtual void emit_code(LIR_Assembler* e);
204 204 virtual CodeEmitInfo* info() const { return _info; }
205 205 virtual bool is_exception_throw_stub() const { return true; }
206 206 virtual void visit(LIR_OpVisitState* visitor) {
207 207 visitor->do_slow_case(_info);
208 208 }
209 209 #ifndef PRODUCT
210 210 virtual void print_name(outputStream* out) const { out->print("ImplicitNullCheckStub"); }
211 211 #endif // PRODUCT
212 212 };
213 213
214 214
215 215 class NewInstanceStub: public CodeStub {
216 216 private:
217 217 ciInstanceKlass* _klass;
218 218 LIR_Opr _klass_reg;
219 219 LIR_Opr _result;
220 220 CodeEmitInfo* _info;
221 221 Runtime1::StubID _stub_id;
222 222
223 223 public:
224 224 NewInstanceStub(LIR_Opr klass_reg, LIR_Opr result, ciInstanceKlass* klass, CodeEmitInfo* info, Runtime1::StubID stub_id);
225 225 virtual void emit_code(LIR_Assembler* e);
226 226 virtual CodeEmitInfo* info() const { return _info; }
227 227 virtual void visit(LIR_OpVisitState* visitor) {
228 228 visitor->do_slow_case(_info);
229 229 visitor->do_input(_klass_reg);
230 230 visitor->do_output(_result);
231 231 }
232 232 #ifndef PRODUCT
233 233 virtual void print_name(outputStream* out) const { out->print("NewInstanceStub"); }
234 234 #endif // PRODUCT
235 235 };
236 236
237 237
238 238 class NewTypeArrayStub: public CodeStub {
239 239 private:
240 240 LIR_Opr _klass_reg;
241 241 LIR_Opr _length;
242 242 LIR_Opr _result;
243 243 CodeEmitInfo* _info;
244 244
245 245 public:
246 246 NewTypeArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info);
247 247 virtual void emit_code(LIR_Assembler* e);
248 248 virtual CodeEmitInfo* info() const { return _info; }
249 249 virtual void visit(LIR_OpVisitState* visitor) {
250 250 visitor->do_slow_case(_info);
251 251 visitor->do_input(_klass_reg);
252 252 visitor->do_input(_length);
253 253 assert(_result->is_valid(), "must be valid"); visitor->do_output(_result);
254 254 }
255 255 #ifndef PRODUCT
256 256 virtual void print_name(outputStream* out) const { out->print("NewTypeArrayStub"); }
257 257 #endif // PRODUCT
258 258 };
259 259
260 260
261 261 class NewObjectArrayStub: public CodeStub {
262 262 private:
263 263 LIR_Opr _klass_reg;
264 264 LIR_Opr _length;
265 265 LIR_Opr _result;
266 266 CodeEmitInfo* _info;
267 267
268 268 public:
269 269 NewObjectArrayStub(LIR_Opr klass_reg, LIR_Opr length, LIR_Opr result, CodeEmitInfo* info);
270 270 virtual void emit_code(LIR_Assembler* e);
271 271 virtual CodeEmitInfo* info() const { return _info; }
272 272 virtual void visit(LIR_OpVisitState* visitor) {
273 273 visitor->do_slow_case(_info);
274 274 visitor->do_input(_klass_reg);
275 275 visitor->do_input(_length);
276 276 assert(_result->is_valid(), "must be valid"); visitor->do_output(_result);
277 277 }
278 278 #ifndef PRODUCT
279 279 virtual void print_name(outputStream* out) const { out->print("NewObjectArrayStub"); }
280 280 #endif // PRODUCT
281 281 };
282 282
283 283
284 284 class MonitorAccessStub: public CodeStub {
285 285 protected:
286 286 LIR_Opr _obj_reg;
287 287 LIR_Opr _lock_reg;
288 288
289 289 public:
290 290 MonitorAccessStub(LIR_Opr obj_reg, LIR_Opr lock_reg) {
291 291 _obj_reg = obj_reg;
292 292 _lock_reg = lock_reg;
293 293 }
294 294
295 295 #ifndef PRODUCT
296 296 virtual void print_name(outputStream* out) const { out->print("MonitorAccessStub"); }
297 297 #endif // PRODUCT
298 298 };
299 299
300 300
301 301 class MonitorEnterStub: public MonitorAccessStub {
302 302 private:
303 303 CodeEmitInfo* _info;
304 304
305 305 public:
306 306 MonitorEnterStub(LIR_Opr obj_reg, LIR_Opr lock_reg, CodeEmitInfo* info);
307 307
308 308 virtual void emit_code(LIR_Assembler* e);
309 309 virtual CodeEmitInfo* info() const { return _info; }
310 310 virtual void visit(LIR_OpVisitState* visitor) {
311 311 visitor->do_input(_obj_reg);
312 312 visitor->do_input(_lock_reg);
313 313 visitor->do_slow_case(_info);
314 314 }
315 315 #ifndef PRODUCT
316 316 virtual void print_name(outputStream* out) const { out->print("MonitorEnterStub"); }
317 317 #endif // PRODUCT
318 318 };
319 319
320 320
321 321 class MonitorExitStub: public MonitorAccessStub {
322 322 private:
323 323 bool _compute_lock;
324 324 int _monitor_ix;
325 325
326 326 public:
327 327 MonitorExitStub(LIR_Opr lock_reg, bool compute_lock, int monitor_ix)
328 328 : MonitorAccessStub(LIR_OprFact::illegalOpr, lock_reg),
329 329 _compute_lock(compute_lock), _monitor_ix(monitor_ix) { }
330 330 virtual void emit_code(LIR_Assembler* e);
331 331 virtual void visit(LIR_OpVisitState* visitor) {
332 332 assert(_obj_reg->is_illegal(), "unused");
333 333 if (_compute_lock) {
334 334 visitor->do_temp(_lock_reg);
335 335 } else {
336 336 visitor->do_input(_lock_reg);
337 337 }
338 338 }
339 339 #ifndef PRODUCT
340 340 virtual void print_name(outputStream* out) const { out->print("MonitorExitStub"); }
341 341 #endif // PRODUCT
342 342 };
343 343
344 344
345 345 class PatchingStub: public CodeStub {
346 346 public:
347 347 enum PatchID {
348 348 access_field_id,
349 349 load_klass_id
350 350 };
351 351 enum constants {
352 352 patch_info_size = 3
353 353 };
354 354 private:
355 355 PatchID _id;
356 356 address _pc_start;
357 357 int _bytes_to_copy;
358 358 Label _patched_code_entry;
359 359 Label _patch_site_entry;
360 360 Label _patch_site_continuation;
361 361 Register _obj;
362 362 CodeEmitInfo* _info;
363 363 int _oop_index; // index of the patchable oop in nmethod oop table if needed
364 364 static int _patch_info_offset;
365 365
366 366 void align_patch_site(MacroAssembler* masm);
367 367
368 368 public:
369 369 static int patch_info_offset() { return _patch_info_offset; }
370 370
371 371 PatchingStub(MacroAssembler* masm, PatchID id, int oop_index = -1):
372 372 _id(id)
373 373 , _info(NULL)
374 374 , _oop_index(oop_index) {
375 375 if (os::is_MP()) {
376 376 // force alignment of patch sites on MP hardware so we
377 377 // can guarantee atomic writes to the patch site.
378 378 align_patch_site(masm);
379 379 }
380 380 _pc_start = masm->pc();
381 381 masm->bind(_patch_site_entry);
382 382 }
383 383
384 384 void install(MacroAssembler* masm, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) {
385 385 _info = info;
386 386 _obj = obj;
387 387 masm->bind(_patch_site_continuation);
388 388 _bytes_to_copy = masm->pc() - pc_start();
389 389 if (_id == PatchingStub::access_field_id) {
390 390 // embed a fixed offset to handle long patches which need to be offset by a word.
391 391 // the patching code will just add the field offset field to this offset so
392 392 // that we can refernce either the high or low word of a double word field.
393 393 int field_offset = 0;
394 394 switch (patch_code) {
395 395 case lir_patch_low: field_offset = lo_word_offset_in_bytes; break;
396 396 case lir_patch_high: field_offset = hi_word_offset_in_bytes; break;
397 397 case lir_patch_normal: field_offset = 0; break;
398 398 default: ShouldNotReachHere();
399 399 }
400 400 NativeMovRegMem* n_move = nativeMovRegMem_at(pc_start());
401 401 n_move->set_offset(field_offset);
402 402 } else if (_id == load_klass_id) {
403 403 assert(_obj != noreg, "must have register object for load_klass");
404 404 #ifdef ASSERT
405 405 // verify that we're pointing at a NativeMovConstReg
406 406 nativeMovConstReg_at(pc_start());
407 407 #endif
408 408 } else {
409 409 ShouldNotReachHere();
410 410 }
411 411 assert(_bytes_to_copy <= (masm->pc() - pc_start()), "not enough bytes");
412 412 }
413 413
414 414 address pc_start() const { return _pc_start; }
415 415 PatchID id() const { return _id; }
416 416
417 417 virtual void emit_code(LIR_Assembler* e);
418 418 virtual CodeEmitInfo* info() const { return _info; }
419 419 virtual void visit(LIR_OpVisitState* visitor) {
420 420 visitor->do_slow_case(_info);
421 421 }
422 422 #ifndef PRODUCT
423 423 virtual void print_name(outputStream* out) const { out->print("PatchingStub"); }
424 424 #endif // PRODUCT
425 425 };
426 426
427 427
428 428 //------------------------------------------------------------------------------
429 429 // DeoptimizeStub
430 430 //
431 431 class DeoptimizeStub : public CodeStub {
432 432 private:
433 433 CodeEmitInfo* _info;
434 434
435 435 public:
436 436 DeoptimizeStub(CodeEmitInfo* info) : _info(new CodeEmitInfo(info)) {}
437 437
438 438 virtual void emit_code(LIR_Assembler* e);
439 439 virtual CodeEmitInfo* info() const { return _info; }
440 440 virtual bool is_exception_throw_stub() const { return true; }
441 441 virtual void visit(LIR_OpVisitState* visitor) {
442 442 visitor->do_slow_case(_info);
443 443 }
444 444 #ifndef PRODUCT
445 445 virtual void print_name(outputStream* out) const { out->print("DeoptimizeStub"); }
446 446 #endif // PRODUCT
447 447 };
448 448
449 449
450 450 class SimpleExceptionStub: public CodeStub {
451 451 private:
452 452 LIR_Opr _obj;
453 453 Runtime1::StubID _stub;
454 454 CodeEmitInfo* _info;
455 455
456 456 public:
457 457 SimpleExceptionStub(Runtime1::StubID stub, LIR_Opr obj, CodeEmitInfo* info):
458 458 _obj(obj), _info(info), _stub(stub) {
459 459 }
460 460
461 461 void set_obj(LIR_Opr obj) {
462 462 _obj = obj;
463 463 }
464 464
465 465 virtual void emit_code(LIR_Assembler* e);
466 466 virtual CodeEmitInfo* info() const { return _info; }
467 467 virtual bool is_exception_throw_stub() const { return true; }
468 468 virtual void visit(LIR_OpVisitState* visitor) {
469 469 if (_obj->is_valid()) visitor->do_input(_obj);
470 470 visitor->do_slow_case(_info);
471 471 }
472 472 #ifndef PRODUCT
473 473 virtual void print_name(outputStream* out) const { out->print("SimpleExceptionStub"); }
474 474 #endif // PRODUCT
475 475 };
476 476
477 477
478 478
479 479 class ArrayStoreExceptionStub: public SimpleExceptionStub {
480 480 private:
481 481 CodeEmitInfo* _info;
482 482
483 483 public:
484 484 ArrayStoreExceptionStub(LIR_Opr obj, CodeEmitInfo* info): SimpleExceptionStub(Runtime1::throw_array_store_exception_id, obj, info) {}
485 485 #ifndef PRODUCT
486 486 virtual void print_name(outputStream* out) const { out->print("ArrayStoreExceptionStub"); }
487 487 #endif // PRODUCT
488 488 };
489 489
490 490
491 491 class ArrayCopyStub: public CodeStub {
492 492 private:
493 493 LIR_OpArrayCopy* _op;
494 494
495 495 public:
496 496 ArrayCopyStub(LIR_OpArrayCopy* op): _op(op) { }
497 497
498 498 LIR_Opr src() const { return _op->src(); }
499 499 LIR_Opr src_pos() const { return _op->src_pos(); }
500 500 LIR_Opr dst() const { return _op->dst(); }
501 501 LIR_Opr dst_pos() const { return _op->dst_pos(); }
502 502 LIR_Opr length() const { return _op->length(); }
503 503 LIR_Opr tmp() const { return _op->tmp(); }
504 504
505 505 virtual void emit_code(LIR_Assembler* e);
506 506 virtual CodeEmitInfo* info() const { return _op->info(); }
507 507 virtual void visit(LIR_OpVisitState* visitor) {
508 508 // don't pass in the code emit info since it's processed in the fast path
509 509 visitor->do_slow_case();
510 510 }
511 511 #ifndef PRODUCT
↓ open down ↓ |
511 lines elided |
↑ open up ↑ |
512 512 virtual void print_name(outputStream* out) const { out->print("ArrayCopyStub"); }
513 513 #endif // PRODUCT
514 514 };
515 515
516 516 //////////////////////////////////////////////////////////////////////////////////////////
517 517 #ifndef SERIALGC
518 518
519 519 // Code stubs for Garbage-First barriers.
520 520 class G1PreBarrierStub: public CodeStub {
521 521 private:
522 + bool _do_load;
522 523 LIR_Opr _addr;
523 524 LIR_Opr _pre_val;
524 525 LIR_PatchCode _patch_code;
525 526 CodeEmitInfo* _info;
526 527
527 528 public:
528 - // pre_val (a temporary register) must be a register;
529 +
530 + // Version that _does_ generate a load of the previous value from addr.
529 531 // addr (the address of the field to be read) must be a LIR_Address
532 + // pre_val (a temporary register) must be a register;
530 533 G1PreBarrierStub(LIR_Opr addr, LIR_Opr pre_val, LIR_PatchCode patch_code, CodeEmitInfo* info) :
531 - _addr(addr), _pre_val(pre_val), _patch_code(patch_code), _info(info)
534 + _addr(addr), _pre_val(pre_val), _do_load(true),
535 + _patch_code(patch_code), _info(info)
532 536 {
533 537 assert(_pre_val->is_register(), "should be temporary register");
534 538 assert(_addr->is_address(), "should be the address of the field");
535 539 }
536 540
541 + // Version that _does not_ generate load of the previous value; the
542 + // previous value is assumed to have already been loaded into pre_val.
543 + G1PreBarrierStub(LIR_Opr pre_val) :
544 + _addr(LIR_OprFact::illegalOpr), _pre_val(pre_val), _do_load(false),
545 + _patch_code(lir_patch_none), _info(NULL)
546 + {
547 + assert(_pre_val->is_register(), "should be a register");
548 + }
549 +
537 550 LIR_Opr addr() const { return _addr; }
538 551 LIR_Opr pre_val() const { return _pre_val; }
539 552 LIR_PatchCode patch_code() const { return _patch_code; }
540 553 CodeEmitInfo* info() const { return _info; }
554 + bool do_load() const { return _do_load; }
541 555
542 556 virtual void emit_code(LIR_Assembler* e);
543 557 virtual void visit(LIR_OpVisitState* visitor) {
544 - // don't pass in the code emit info since it's processed in the fast
545 - // path
546 - if (_info != NULL)
547 - visitor->do_slow_case(_info);
548 - else
558 + if (_do_load) {
559 + // don't pass in the code emit info since it's processed in the fast
560 + // path
561 + if (_info != NULL)
562 + visitor->do_slow_case(_info);
563 + else
564 + visitor->do_slow_case();
565 +
566 + visitor->do_input(_addr);
567 + visitor->do_temp(_pre_val);
568 + } else {
549 569 visitor->do_slow_case();
550 - visitor->do_input(_addr);
551 - visitor->do_temp(_pre_val);
570 + visitor->do_input(_pre_val);
571 + }
552 572 }
553 573 #ifndef PRODUCT
554 574 virtual void print_name(outputStream* out) const { out->print("G1PreBarrierStub"); }
555 575 #endif // PRODUCT
556 576 };
557 577
558 578 class G1PostBarrierStub: public CodeStub {
559 579 private:
560 580 LIR_Opr _addr;
561 581 LIR_Opr _new_val;
562 582
563 583 static jbyte* _byte_map_base;
564 584 static jbyte* byte_map_base_slow();
565 585 static jbyte* byte_map_base() {
566 586 if (_byte_map_base == NULL) {
567 587 _byte_map_base = byte_map_base_slow();
568 588 }
569 589 return _byte_map_base;
570 590 }
571 591
572 592 public:
573 593 // addr (the address of the object head) and new_val must be registers.
574 594 G1PostBarrierStub(LIR_Opr addr, LIR_Opr new_val): _addr(addr), _new_val(new_val) { }
575 595
576 596 LIR_Opr addr() const { return _addr; }
577 597 LIR_Opr new_val() const { return _new_val; }
578 598
579 599 virtual void emit_code(LIR_Assembler* e);
580 600 virtual void visit(LIR_OpVisitState* visitor) {
581 601 // don't pass in the code emit info since it's processed in the fast path
582 602 visitor->do_slow_case();
583 603 visitor->do_input(_addr);
584 604 visitor->do_input(_new_val);
585 605 }
586 606 #ifndef PRODUCT
587 607 virtual void print_name(outputStream* out) const { out->print("G1PostBarrierStub"); }
588 608 #endif // PRODUCT
589 609 };
590 610
591 611 #endif // SERIALGC
592 612 //////////////////////////////////////////////////////////////////////////////////////////
593 613
594 614 #endif // SHARE_VM_C1_C1_CODESTUBS_HPP
↓ open down ↓ |
33 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX