Mercurial > hg > graal-compiler
comparison src/share/vm/c1/c1_LIRAssembler.cpp @ 18041:52b4284cb496
Merge with jdk8u20-b26
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 15 Oct 2014 16:02:50 +0200 |
parents | 89152779163c 0bf37f737702 |
children |
comparison
equal
deleted
inserted
replaced
17606:45d7b2c7029d | 18041:52b4284cb496 |
---|---|
56 // we must have enough patching space so that call can be inserted | 56 // we must have enough patching space so that call can be inserted |
57 while ((intx) _masm->pc() - (intx) patch->pc_start() < NativeCall::instruction_size) { | 57 while ((intx) _masm->pc() - (intx) patch->pc_start() < NativeCall::instruction_size) { |
58 _masm->nop(); | 58 _masm->nop(); |
59 } | 59 } |
60 patch->install(_masm, patch_code, obj, info); | 60 patch->install(_masm, patch_code, obj, info); |
61 append_patching_stub(patch); | 61 append_code_stub(patch); |
62 | 62 |
63 #ifdef ASSERT | 63 #ifdef ASSERT |
64 Bytecodes::Code code = info->scope()->method()->java_code_at_bci(info->stack()->bci()); | 64 Bytecodes::Code code = info->scope()->method()->java_code_at_bci(info->stack()->bci()); |
65 if (patch->id() == PatchingStub::access_field_id) { | 65 if (patch->id() == PatchingStub::access_field_id) { |
66 switch (code) { | 66 switch (code) { |
129 | 129 |
130 LIR_Assembler::~LIR_Assembler() { | 130 LIR_Assembler::~LIR_Assembler() { |
131 } | 131 } |
132 | 132 |
133 | 133 |
134 void LIR_Assembler::append_patching_stub(PatchingStub* stub) { | |
135 _slow_case_stubs->append(stub); | |
136 } | |
137 | |
138 | |
139 void LIR_Assembler::check_codespace() { | 134 void LIR_Assembler::check_codespace() { |
140 CodeSection* cs = _masm->code_section(); | 135 CodeSection* cs = _masm->code_section(); |
141 if (cs->remaining() < (int)(NOT_LP64(1*K)LP64_ONLY(2*K))) { | 136 if (cs->remaining() < (int)(NOT_LP64(1*K)LP64_ONLY(2*K))) { |
142 BAILOUT("CodeBuffer overflow"); | 137 BAILOUT("CodeBuffer overflow"); |
143 } | 138 } |
144 } | 139 } |
145 | 140 |
146 | 141 |
147 void LIR_Assembler::emit_code_stub(CodeStub* stub) { | 142 void LIR_Assembler::append_code_stub(CodeStub* stub) { |
148 _slow_case_stubs->append(stub); | 143 _slow_case_stubs->append(stub); |
149 } | 144 } |
150 | 145 |
151 void LIR_Assembler::emit_stubs(CodeStubList* stub_list) { | 146 void LIR_Assembler::emit_stubs(CodeStubList* stub_list) { |
152 for (int m = 0; m < stub_list->length(); m++) { | 147 for (int m = 0; m < stub_list->length(); m++) { |
188 | 183 |
189 address LIR_Assembler::pc() const { | 184 address LIR_Assembler::pc() const { |
190 return _masm->pc(); | 185 return _masm->pc(); |
191 } | 186 } |
192 | 187 |
188 // To bang the stack of this compiled method we use the stack size | |
189 // that the interpreter would need in case of a deoptimization. This | |
190 // removes the need to bang the stack in the deoptimization blob which | |
191 // in turn simplifies stack overflow handling. | |
192 int LIR_Assembler::bang_size_in_bytes() const { | |
193 return MAX2(initial_frame_size_in_bytes(), _compilation->interpreter_frame_size()); | |
194 } | |
193 | 195 |
194 void LIR_Assembler::emit_exception_entries(ExceptionInfoList* info_list) { | 196 void LIR_Assembler::emit_exception_entries(ExceptionInfoList* info_list) { |
195 for (int i = 0; i < info_list->length(); i++) { | 197 for (int i = 0; i < info_list->length(); i++) { |
196 XHandlers* handlers = info_list->at(i)->exception_handlers(); | 198 XHandlers* handlers = info_list->at(i)->exception_handlers(); |
197 | 199 |
433 add_debug_info_for_null_check(code_offset(), cinfo); | 435 add_debug_info_for_null_check(code_offset(), cinfo); |
434 } | 436 } |
435 | 437 |
436 void LIR_Assembler::add_debug_info_for_null_check(int pc_offset, CodeEmitInfo* cinfo) { | 438 void LIR_Assembler::add_debug_info_for_null_check(int pc_offset, CodeEmitInfo* cinfo) { |
437 ImplicitNullCheckStub* stub = new ImplicitNullCheckStub(pc_offset, cinfo); | 439 ImplicitNullCheckStub* stub = new ImplicitNullCheckStub(pc_offset, cinfo); |
438 emit_code_stub(stub); | 440 append_code_stub(stub); |
439 } | 441 } |
440 | 442 |
441 void LIR_Assembler::add_debug_info_for_div0_here(CodeEmitInfo* info) { | 443 void LIR_Assembler::add_debug_info_for_div0_here(CodeEmitInfo* info) { |
442 add_debug_info_for_div0(code_offset(), info); | 444 add_debug_info_for_div0(code_offset(), info); |
443 } | 445 } |
444 | 446 |
445 void LIR_Assembler::add_debug_info_for_div0(int pc_offset, CodeEmitInfo* cinfo) { | 447 void LIR_Assembler::add_debug_info_for_div0(int pc_offset, CodeEmitInfo* cinfo) { |
446 DivByZeroStub* stub = new DivByZeroStub(pc_offset, cinfo); | 448 DivByZeroStub* stub = new DivByZeroStub(pc_offset, cinfo); |
447 emit_code_stub(stub); | 449 append_code_stub(stub); |
448 } | 450 } |
449 | 451 |
450 void LIR_Assembler::emit_rtcall(LIR_OpRTCall* op) { | 452 void LIR_Assembler::emit_rtcall(LIR_OpRTCall* op) { |
451 rt_call(op->result_opr(), op->addr(), op->arguments(), op->tmp(), op->info()); | 453 rt_call(op->result_opr(), op->addr(), op->arguments(), op->tmp(), op->info()); |
452 } | 454 } |
795 } | 797 } |
796 } | 798 } |
797 | 799 |
798 | 800 |
799 void LIR_Assembler::build_frame() { | 801 void LIR_Assembler::build_frame() { |
800 _masm->build_frame(initial_frame_size_in_bytes()); | 802 _masm->build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes()); |
801 } | 803 } |
802 | 804 |
803 | 805 |
804 void LIR_Assembler::roundfp_op(LIR_Opr src, LIR_Opr tmp, LIR_Opr dest, bool pop_fpu_stack) { | 806 void LIR_Assembler::roundfp_op(LIR_Opr src, LIR_Opr tmp, LIR_Opr dest, bool pop_fpu_stack) { |
805 assert((src->is_single_fpu() && dest->is_single_stack()) || | 807 assert((src->is_single_fpu() && dest->is_single_stack()) || |
856 } | 858 } |
857 | 859 |
858 | 860 |
859 void LIR_Assembler::verify_oop_map(CodeEmitInfo* info) { | 861 void LIR_Assembler::verify_oop_map(CodeEmitInfo* info) { |
860 #ifndef PRODUCT | 862 #ifndef PRODUCT |
861 if (VerifyOopMaps || VerifyOops) { | 863 if (VerifyOops) { |
862 bool v = VerifyOops; | |
863 VerifyOops = true; | |
864 OopMapStream s(info->oop_map()); | 864 OopMapStream s(info->oop_map()); |
865 while (!s.is_done()) { | 865 while (!s.is_done()) { |
866 OopMapValue v = s.current(); | 866 OopMapValue v = s.current(); |
867 if (v.is_oop()) { | 867 if (v.is_oop()) { |
868 VMReg r = v.reg(); | 868 VMReg r = v.reg(); |
881 check_codespace(); | 881 check_codespace(); |
882 CHECK_BAILOUT(); | 882 CHECK_BAILOUT(); |
883 | 883 |
884 s.next(); | 884 s.next(); |
885 } | 885 } |
886 VerifyOops = v; | 886 } |
887 } | 887 #endif |
888 #endif | 888 } |
889 } |