24 */
25
26 #include "precompiled.hpp"
27 #include "c1/c1_CodeStubs.hpp"
28 #include "c1/c1_FrameMap.hpp"
29 #include "c1/c1_LIRAssembler.hpp"
30 #include "c1/c1_MacroAssembler.hpp"
31 #include "c1/c1_Runtime1.hpp"
32 #include "nativeInst_ppc.hpp"
33 #include "runtime/sharedRuntime.hpp"
34 #include "utilities/macros.hpp"
35 #include "vmreg_ppc.inline.hpp"
36 #if INCLUDE_ALL_GCS
37 #include "gc/g1/g1BarrierSet.hpp"
38 #endif // INCLUDE_ALL_GCS
39
40 #define __ ce->masm()->
41
42
43 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
44 : _throw_index_out_of_bounds_exception(array == NULL), _index(index), _array(array) {
45 assert(info != NULL, "must have info");
46 _info = new CodeEmitInfo(info);
47 }
48
49 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
50 __ bind(_entry);
51
52 if (_info->deoptimize_on_exception()) {
53 address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
54 // May be used by optimizations like LoopInvariantCodeMotion or RangeCheckEliminator.
55 DEBUG_ONLY( __ untested("RangeCheckStub: predicate_failed_trap_id"); )
56 //__ load_const_optimized(R0, a);
57 __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a));
58 __ mtctr(R0);
59 __ bctrl();
60 ce->add_call_info_here(_info);
61 ce->verify_oop_map(_info);
62 debug_only(__ illtrap());
63 return;
64 }
|
24 */
25
26 #include "precompiled.hpp"
27 #include "c1/c1_CodeStubs.hpp"
28 #include "c1/c1_FrameMap.hpp"
29 #include "c1/c1_LIRAssembler.hpp"
30 #include "c1/c1_MacroAssembler.hpp"
31 #include "c1/c1_Runtime1.hpp"
32 #include "nativeInst_ppc.hpp"
33 #include "runtime/sharedRuntime.hpp"
34 #include "utilities/macros.hpp"
35 #include "vmreg_ppc.inline.hpp"
36 #if INCLUDE_ALL_GCS
37 #include "gc/g1/g1BarrierSet.hpp"
38 #endif // INCLUDE_ALL_GCS
39
40 #define __ ce->masm()->
41
42
43 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
44 : _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
45 assert(info != NULL, "must have info");
46 _info = new CodeEmitInfo(info);
47 }
48
49 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
50 : _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
51 assert(info != NULL, "must have info");
52 _info = new CodeEmitInfo(info);
53 }
54
55 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
56 __ bind(_entry);
57
58 if (_info->deoptimize_on_exception()) {
59 address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
60 // May be used by optimizations like LoopInvariantCodeMotion or RangeCheckEliminator.
61 DEBUG_ONLY( __ untested("RangeCheckStub: predicate_failed_trap_id"); )
62 //__ load_const_optimized(R0, a);
63 __ add_const_optimized(R0, R29_TOC, MacroAssembler::offset_to_global_toc(a));
64 __ mtctr(R0);
65 __ bctrl();
66 ce->add_call_info_here(_info);
67 ce->verify_oop_map(_info);
68 debug_only(__ illtrap());
69 return;
70 }
|