15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "c1/c1_CodeStubs.hpp"
27 #include "c1/c1_FrameMap.hpp"
28 #include "c1/c1_LIRAssembler.hpp"
29 #include "c1/c1_MacroAssembler.hpp"
30 #include "c1/c1_Runtime1.hpp"
31 #include "nativeInst_sparc.hpp"
32 #include "runtime/sharedRuntime.hpp"
33 #include "utilities/macros.hpp"
34 #include "vmreg_sparc.inline.hpp"
35 #if INCLUDE_ALL_GCS
36 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
37 #endif // INCLUDE_ALL_GCS
38
39 #define __ ce->masm()->
40
41 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
42 bool throw_index_out_of_bounds_exception)
43 : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)
44 , _index(index)
45 {
46 assert(info != NULL, "must have info");
47 _info = new CodeEmitInfo(info);
48 }
49
50
51 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
52 __ bind(_entry);
53
54 if (_info->deoptimize_on_exception()) {
55 address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
56 __ call(a, relocInfo::runtime_call_type);
57 __ delayed()->nop();
436 ce->emit_static_call_stub();
437 if (ce->compilation()->bailed_out()) {
438 return; // CodeCache is full
439 }
440
441 __ call(SharedRuntime::get_resolve_static_call_stub(), relocInfo::static_call_type);
442 __ delayed()->nop();
443 ce->add_call_info_here(info());
444 ce->verify_oop_map(info());
445
446 #ifndef PRODUCT
447 __ set((intptr_t)&Runtime1::_arraycopy_slowcase_cnt, O0);
448 __ ld(O0, 0, O1);
449 __ inc(O1);
450 __ st(O1, 0, O0);
451 #endif
452
453 __ br(Assembler::always, false, Assembler::pt, _continuation);
454 __ delayed()->nop();
455 }
456
457
458 ///////////////////////////////////////////////////////////////////////////////////
459 #if INCLUDE_ALL_GCS
460
461 void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {
462 // At this point we know that marking is in progress.
463 // If do_load() is true then we have to emit the
464 // load of the previous value; otherwise it has already
465 // been loaded into _pre_val.
466
467 __ bind(_entry);
468
469 assert(pre_val()->is_register(), "Precondition.");
470 Register pre_val_reg = pre_val()->as_register();
471
472 if (do_load()) {
473 ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false /*wide*/, false /*unaligned*/);
474 }
475
476 if (__ is_in_wdisp16_range(_continuation)) {
477 __ br_null(pre_val_reg, /*annul*/false, Assembler::pt, _continuation);
478 } else {
479 __ cmp(pre_val_reg, G0);
480 __ brx(Assembler::equal, false, Assembler::pn, _continuation);
481 }
482 __ delayed()->nop();
483
484 __ call(Runtime1::entry_for(Runtime1::Runtime1::g1_pre_barrier_slow_id));
485 __ delayed()->mov(pre_val_reg, G4);
486 __ br(Assembler::always, false, Assembler::pt, _continuation);
487 __ delayed()->nop();
488
489 }
490
491 void G1PostBarrierStub::emit_code(LIR_Assembler* ce) {
492 __ bind(_entry);
493
494 assert(addr()->is_register(), "Precondition.");
495 assert(new_val()->is_register(), "Precondition.");
496 Register addr_reg = addr()->as_pointer_register();
497 Register new_val_reg = new_val()->as_register();
498
499 if (__ is_in_wdisp16_range(_continuation)) {
500 __ br_null(new_val_reg, /*annul*/false, Assembler::pt, _continuation);
501 } else {
502 __ cmp(new_val_reg, G0);
503 __ brx(Assembler::equal, false, Assembler::pn, _continuation);
504 }
505 __ delayed()->nop();
506
507 __ call(Runtime1::entry_for(Runtime1::Runtime1::g1_post_barrier_slow_id));
508 __ delayed()->mov(addr_reg, G4);
509 __ br(Assembler::always, false, Assembler::pt, _continuation);
510 __ delayed()->nop();
511 }
512
513 #endif // INCLUDE_ALL_GCS
514 ///////////////////////////////////////////////////////////////////////////////////
515
516 #undef __
|
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "precompiled.hpp"
26 #include "c1/c1_CodeStubs.hpp"
27 #include "c1/c1_FrameMap.hpp"
28 #include "c1/c1_LIRAssembler.hpp"
29 #include "c1/c1_MacroAssembler.hpp"
30 #include "c1/c1_Runtime1.hpp"
31 #include "nativeInst_sparc.hpp"
32 #include "runtime/sharedRuntime.hpp"
33 #include "utilities/macros.hpp"
34 #include "vmreg_sparc.inline.hpp"
35
36 #define __ ce->masm()->
37
38 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
39 bool throw_index_out_of_bounds_exception)
40 : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)
41 , _index(index)
42 {
43 assert(info != NULL, "must have info");
44 _info = new CodeEmitInfo(info);
45 }
46
47
48 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
49 __ bind(_entry);
50
51 if (_info->deoptimize_on_exception()) {
52 address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
53 __ call(a, relocInfo::runtime_call_type);
54 __ delayed()->nop();
433 ce->emit_static_call_stub();
434 if (ce->compilation()->bailed_out()) {
435 return; // CodeCache is full
436 }
437
438 __ call(SharedRuntime::get_resolve_static_call_stub(), relocInfo::static_call_type);
439 __ delayed()->nop();
440 ce->add_call_info_here(info());
441 ce->verify_oop_map(info());
442
443 #ifndef PRODUCT
444 __ set((intptr_t)&Runtime1::_arraycopy_slowcase_cnt, O0);
445 __ ld(O0, 0, O1);
446 __ inc(O1);
447 __ st(O1, 0, O0);
448 #endif
449
450 __ br(Assembler::always, false, Assembler::pt, _continuation);
451 __ delayed()->nop();
452 }
453
454 #undef __
|