34 #include "vmreg_aarch64.inline.hpp"
35 #if INCLUDE_ALL_GCS
36 #include "gc/g1/g1BarrierSet.hpp"
37 #endif
38
39
40 #define __ ce->masm()->
41
42 void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
43 __ bind(_entry);
44 Metadata *m = _method->as_constant_ptr()->as_metadata();
45 __ mov_metadata(rscratch1, m);
46 ce->store_parameter(rscratch1, 1);
47 ce->store_parameter(_bci, 0);
48 __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::counter_overflow_id)));
49 ce->add_call_info_here(_info);
50 ce->verify_oop_map(_info);
51 __ b(_continuation);
52 }
53
54 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index,
55 bool throw_index_out_of_bounds_exception)
56 : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception)
57 , _index(index)
58 {
59 assert(info != NULL, "must have info");
60 _info = new CodeEmitInfo(info);
61 }
62
63 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
64 __ bind(_entry);
65 if (_info->deoptimize_on_exception()) {
66 address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
67 __ far_call(RuntimeAddress(a));
68 ce->add_call_info_here(_info);
69 ce->verify_oop_map(_info);
70 debug_only(__ should_not_reach_here());
71 return;
72 }
73
74 if (_index->is_cpu_register()) {
75 __ mov(rscratch1, _index->as_register());
76 } else {
77 __ mov(rscratch1, _index->as_jint());
78 }
79 Runtime1::StubID stub_id;
80 if (_throw_index_out_of_bounds_exception) {
81 stub_id = Runtime1::throw_index_exception_id;
82 } else {
83 stub_id = Runtime1::throw_range_check_failed_id;
84 }
85 __ far_call(RuntimeAddress(Runtime1::entry_for(stub_id)), NULL, rscratch2);
86 ce->add_call_info_here(_info);
87 ce->verify_oop_map(_info);
88 debug_only(__ should_not_reach_here());
89 }
90
91 PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
92 _info = new CodeEmitInfo(info);
93 }
94
95 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
96 __ bind(_entry);
97 address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
98 __ far_call(RuntimeAddress(a));
99 ce->add_call_info_here(_info);
100 ce->verify_oop_map(_info);
101 debug_only(__ should_not_reach_here());
102 }
|
34 #include "vmreg_aarch64.inline.hpp"
35 #if INCLUDE_ALL_GCS
36 #include "gc/g1/g1BarrierSet.hpp"
37 #endif
38
39
40 #define __ ce->masm()->
41
42 void CounterOverflowStub::emit_code(LIR_Assembler* ce) {
43 __ bind(_entry);
44 Metadata *m = _method->as_constant_ptr()->as_metadata();
45 __ mov_metadata(rscratch1, m);
46 ce->store_parameter(rscratch1, 1);
47 ce->store_parameter(_bci, 0);
48 __ far_call(RuntimeAddress(Runtime1::entry_for(Runtime1::counter_overflow_id)));
49 ce->add_call_info_here(_info);
50 ce->verify_oop_map(_info);
51 __ b(_continuation);
52 }
53
54 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array)
55 : _throw_index_out_of_bounds_exception(false), _index(index), _array(array) {
56 assert(info != NULL, "must have info");
57 _info = new CodeEmitInfo(info);
58 }
59
60 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index)
61 : _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) {
62 assert(info != NULL, "must have info");
63 _info = new CodeEmitInfo(info);
64 }
65
66 void RangeCheckStub::emit_code(LIR_Assembler* ce) {
67 __ bind(_entry);
68 if (_info->deoptimize_on_exception()) {
69 address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
70 __ far_call(RuntimeAddress(a));
71 ce->add_call_info_here(_info);
72 ce->verify_oop_map(_info);
73 debug_only(__ should_not_reach_here());
74 return;
75 }
76
77 if (_index->is_cpu_register()) {
78 __ mov(rscratch1, _index->as_register());
79 } else {
80 __ mov(rscratch1, _index->as_jint());
81 }
82 Runtime1::StubID stub_id;
83 if (_throw_index_out_of_bounds_exception) {
84 stub_id = Runtime1::throw_index_exception_id;
85 } else {
86 assert(_array != NULL, "sanity");
87 __ mov(rscratch2, _array->as_pointer_register());
88 stub_id = Runtime1::throw_range_check_failed_id;
89 }
90 __ far_call(RuntimeAddress(Runtime1::entry_for(stub_id)), NULL, rscratch2);
91 ce->add_call_info_here(_info);
92 ce->verify_oop_map(_info);
93 debug_only(__ should_not_reach_here());
94 }
95
96 PredicateFailedStub::PredicateFailedStub(CodeEmitInfo* info) {
97 _info = new CodeEmitInfo(info);
98 }
99
100 void PredicateFailedStub::emit_code(LIR_Assembler* ce) {
101 __ bind(_entry);
102 address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id);
103 __ far_call(RuntimeAddress(a));
104 ce->add_call_info_here(_info);
105 ce->verify_oop_map(_info);
106 debug_only(__ should_not_reach_here());
107 }
|