86 ce->add_call_info_here(_info); |
86 ce->add_call_info_here(_info); |
87 ce->verify_oop_map(_info); |
87 ce->verify_oop_map(_info); |
88 __ jmp(_continuation); |
88 __ jmp(_continuation); |
89 } |
89 } |
90 |
90 |
91 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, |
91 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index, LIR_Opr array) |
92 bool throw_index_out_of_bounds_exception) |
92 : _throw_index_out_of_bounds_exception(false), _index(index), _array(array) { |
93 : _throw_index_out_of_bounds_exception(throw_index_out_of_bounds_exception) |
|
94 , _index(index) |
|
95 { |
|
96 assert(info != NULL, "must have info"); |
93 assert(info != NULL, "must have info"); |
97 _info = new CodeEmitInfo(info); |
94 _info = new CodeEmitInfo(info); |
98 } |
95 } |
99 |
96 |
|
97 RangeCheckStub::RangeCheckStub(CodeEmitInfo* info, LIR_Opr index) |
|
98 : _throw_index_out_of_bounds_exception(true), _index(index), _array(NULL) { |
|
99 assert(info != NULL, "must have info"); |
|
100 _info = new CodeEmitInfo(info); |
|
101 } |
100 |
102 |
101 void RangeCheckStub::emit_code(LIR_Assembler* ce) { |
103 void RangeCheckStub::emit_code(LIR_Assembler* ce) { |
102 __ bind(_entry); |
104 __ bind(_entry); |
103 if (_info->deoptimize_on_exception()) { |
105 if (_info->deoptimize_on_exception()) { |
104 address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); |
106 address a = Runtime1::entry_for(Runtime1::predicate_failed_trap_id); |
118 Runtime1::StubID stub_id; |
120 Runtime1::StubID stub_id; |
119 if (_throw_index_out_of_bounds_exception) { |
121 if (_throw_index_out_of_bounds_exception) { |
120 stub_id = Runtime1::throw_index_exception_id; |
122 stub_id = Runtime1::throw_index_exception_id; |
121 } else { |
123 } else { |
122 stub_id = Runtime1::throw_range_check_failed_id; |
124 stub_id = Runtime1::throw_range_check_failed_id; |
|
125 ce->store_parameter(_array->as_pointer_register(), 1); |
123 } |
126 } |
124 __ call(RuntimeAddress(Runtime1::entry_for(stub_id))); |
127 __ call(RuntimeAddress(Runtime1::entry_for(stub_id))); |
125 ce->add_call_info_here(_info); |
128 ce->add_call_info_here(_info); |
126 ce->verify_oop_map(_info); |
129 ce->verify_oop_map(_info); |
127 debug_only(__ should_not_reach_here()); |
130 debug_only(__ should_not_reach_here()); |