Path: blob/jdk8u272-b10-aarch32-20201026/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp
83404 views
/*1* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "c1/c1_Compilation.hpp"26#include "c1/c1_Instruction.hpp"27#include "c1/c1_InstructionPrinter.hpp"28#include "c1/c1_LIRAssembler.hpp"29#include "c1/c1_MacroAssembler.hpp"30#include "c1/c1_ValueStack.hpp"31#include "ci/ciInstance.hpp"32#ifdef TARGET_ARCH_x8633# include "nativeInst_x86.hpp"34# include "vmreg_x86.inline.hpp"35#endif36#ifdef TARGET_ARCH_aarch6437# include "nativeInst_aarch64.hpp"38# include "vmreg_aarch64.inline.hpp"39#endif40#ifdef TARGET_ARCH_sparc41# include "nativeInst_sparc.hpp"42# include "vmreg_sparc.inline.hpp"43#endif44#ifdef TARGET_ARCH_zero45# include "nativeInst_zero.hpp"46# include "vmreg_zero.inline.hpp"47#endif48#ifdef TARGET_ARCH_arm49# include "nativeInst_arm.hpp"50# include "vmreg_arm.inline.hpp"51#endif52#ifdef TARGET_ARCH_ppc53# include "nativeInst_ppc.hpp"54# include "vmreg_ppc.inline.hpp"55#endif56#ifdef TARGET_ARCH_aarch3257# include "nativeInst_aarch32.hpp"58# include "vmreg_aarch32.inline.hpp"59#endif606162void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) {63// we must have enough patching space so that call can be inserted64while ((intx) _masm->pc() - (intx) patch->pc_start() < NativeCall::instruction_size) {65_masm->nop();66}67patch->install(_masm, patch_code, obj, info);68append_code_stub(patch);6970#ifdef ASSERT71Bytecodes::Code code = info->scope()->method()->java_code_at_bci(info->stack()->bci());72if (patch->id() == PatchingStub::access_field_id) {73switch (code) {74case Bytecodes::_putstatic:75case Bytecodes::_getstatic:76case Bytecodes::_putfield:77case Bytecodes::_getfield:78break;79default:80ShouldNotReachHere();81}82} else if (patch->id() == PatchingStub::load_klass_id) {83switch (code) {84case Bytecodes::_new:85case Bytecodes::_anewarray:86case Bytecodes::_multianewarray:87case Bytecodes::_instanceof:88case Bytecodes::_checkcast:89break;90default:91ShouldNotReachHere();92}93} else if (patch->id() == PatchingStub::load_mirror_id) {94switch (code) {95case Bytecodes::_putstatic:96case Bytecodes::_getstatic:97case Bytecodes::_ldc:98case Bytecodes::_ldc_w:99break;100default:101ShouldNotReachHere();102}103} else if (patch->id() == PatchingStub::load_appendix_id) {104Bytecodes::Code bc_raw = info->scope()->method()->raw_code_at_bci(info->stack()->bci());105assert(Bytecodes::has_optional_appendix(bc_raw), "unexpected appendix resolution");106} else {107ShouldNotReachHere();108}109#endif110}111112PatchingStub::PatchID LIR_Assembler::patching_id(CodeEmitInfo* info) {113IRScope* scope = info->scope();114Bytecodes::Code bc_raw = scope->method()->raw_code_at_bci(info->stack()->bci());115if (Bytecodes::has_optional_appendix(bc_raw)) {116return PatchingStub::load_appendix_id;117}118return PatchingStub::load_mirror_id;119}120121//---------------------------------------------------------------122123124LIR_Assembler::LIR_Assembler(Compilation* c):125_compilation(c)126, _masm(c->masm())127, _bs(Universe::heap()->barrier_set())128, _frame_map(c->frame_map())129, _current_block(NULL)130, _pending_non_safepoint(NULL)131, _pending_non_safepoint_offset(0)132{133_slow_case_stubs = new CodeStubList();134#ifdef TARGET_ARCH_aarch64135init(); // Target-dependent initialization136#endif137}138139140LIR_Assembler::~LIR_Assembler() {141// The unwind handler label may be unbound if this destructor is invoked because of a bail-out.142// Reset it here to avoid an assertion.143_unwind_handler_entry.reset();144}145146147void LIR_Assembler::check_codespace() {148CodeSection* cs = _masm->code_section();149if (cs->remaining() < (int)(NOT_LP64(1*K)LP64_ONLY(2*K))) {150BAILOUT("CodeBuffer overflow");151}152}153154155void LIR_Assembler::append_code_stub(CodeStub* stub) {156_slow_case_stubs->append(stub);157}158159void LIR_Assembler::emit_stubs(CodeStubList* stub_list) {160for (int m = 0; m < stub_list->length(); m++) {161CodeStub* s = (*stub_list)[m];162163check_codespace();164CHECK_BAILOUT();165166#ifndef PRODUCT167if (CommentedAssembly) {168stringStream st;169s->print_name(&st);170st.print(" slow case");171_masm->block_comment(st.as_string());172}173#endif174s->emit_code(this);175#ifdef ASSERT176#ifndef AARCH64177s->assert_no_unbound_labels();178#endif179#endif180}181}182183184void LIR_Assembler::emit_slow_case_stubs() {185emit_stubs(_slow_case_stubs);186}187188189bool LIR_Assembler::needs_icache(ciMethod* method) const {190return !method->is_static();191}192193194int LIR_Assembler::code_offset() const {195return _masm->offset();196}197198199address LIR_Assembler::pc() const {200return _masm->pc();201}202203// To bang the stack of this compiled method we use the stack size204// that the interpreter would need in case of a deoptimization. This205// removes the need to bang the stack in the deoptimization blob which206// in turn simplifies stack overflow handling.207int LIR_Assembler::bang_size_in_bytes() const {208return MAX2(initial_frame_size_in_bytes(), _compilation->interpreter_frame_size());209}210211void LIR_Assembler::emit_exception_entries(ExceptionInfoList* info_list) {212for (int i = 0; i < info_list->length(); i++) {213XHandlers* handlers = info_list->at(i)->exception_handlers();214215for (int j = 0; j < handlers->length(); j++) {216XHandler* handler = handlers->handler_at(j);217assert(handler->lir_op_id() != -1, "handler not processed by LinearScan");218assert(handler->entry_code() == NULL ||219handler->entry_code()->instructions_list()->last()->code() == lir_branch ||220handler->entry_code()->instructions_list()->last()->code() == lir_delay_slot, "last operation must be branch");221222if (handler->entry_pco() == -1) {223// entry code not emitted yet224if (handler->entry_code() != NULL && handler->entry_code()->instructions_list()->length() > 1) {225handler->set_entry_pco(code_offset());226if (CommentedAssembly) {227_masm->block_comment("Exception adapter block");228}229emit_lir_list(handler->entry_code());230} else {231handler->set_entry_pco(handler->entry_block()->exception_handler_pco());232}233234assert(handler->entry_pco() != -1, "must be set now");235}236}237}238}239240241void LIR_Assembler::emit_code(BlockList* hir) {242if (PrintLIR) {243print_LIR(hir);244}245246int n = hir->length();247for (int i = 0; i < n; i++) {248emit_block(hir->at(i));249CHECK_BAILOUT();250}251252flush_debug_info(code_offset());253254DEBUG_ONLY(check_no_unbound_labels());255}256257258void LIR_Assembler::emit_block(BlockBegin* block) {259if (block->is_set(BlockBegin::backward_branch_target_flag)) {260align_backward_branch_target();261}262263// if this block is the start of an exception handler, record the264// PC offset of the first instruction for later construction of265// the ExceptionHandlerTable266if (block->is_set(BlockBegin::exception_entry_flag)) {267block->set_exception_handler_pco(code_offset());268}269270#ifndef PRODUCT271if (PrintLIRWithAssembly) {272// don't print Phi's273InstructionPrinter ip(false);274block->print(ip);275}276#endif /* PRODUCT */277278assert(block->lir() != NULL, "must have LIR");279X86_ONLY(assert(_masm->rsp_offset() == 0, "frame size should be fixed"));280281#ifndef PRODUCT282if (CommentedAssembly) {283stringStream st;284st.print_cr(" block B%d [%d, %d]", block->block_id(), block->bci(), block->end()->printable_bci());285_masm->block_comment(st.as_string());286}287#endif288289emit_lir_list(block->lir());290291X86_ONLY(assert(_masm->rsp_offset() == 0, "frame size should be fixed"));292}293294295void LIR_Assembler::emit_lir_list(LIR_List* list) {296peephole(list);297298int n = list->length();299for (int i = 0; i < n; i++) {300LIR_Op* op = list->at(i);301302check_codespace();303CHECK_BAILOUT();304305#ifndef PRODUCT306if (CommentedAssembly) {307// Don't record out every op since that's too verbose. Print308// branches since they include block and stub names. Also print309// patching moves since they generate funny looking code.310if (op->code() == lir_branch ||311(op->code() == lir_move && op->as_Op1()->patch_code() != lir_patch_none)) {312stringStream st;313op->print_on(&st);314_masm->block_comment(st.as_string());315}316}317if (PrintLIRWithAssembly) {318// print out the LIR operation followed by the resulting assembly319list->at(i)->print(); tty->cr();320}321#endif /* PRODUCT */322323op->emit_code(this);324325if (compilation()->debug_info_recorder()->recording_non_safepoints()) {326process_debug_info(op);327}328329#ifndef PRODUCT330if (PrintLIRWithAssembly) {331_masm->code()->decode();332}333#endif /* PRODUCT */334}335}336337#ifdef ASSERT338void LIR_Assembler::check_no_unbound_labels() {339CHECK_BAILOUT();340341for (int i = 0; i < _branch_target_blocks.length() - 1; i++) {342if (!_branch_target_blocks.at(i)->label()->is_bound()) {343tty->print_cr("label of block B%d is not bound", _branch_target_blocks.at(i)->block_id());344assert(false, "unbound label");345}346}347}348#endif349350//----------------------------------debug info--------------------------------351352353void LIR_Assembler::add_debug_info_for_branch(CodeEmitInfo* info) {354_masm->code_section()->relocate(pc(), relocInfo::poll_type);355int pc_offset = code_offset();356flush_debug_info(pc_offset);357info->record_debug_info(compilation()->debug_info_recorder(), pc_offset);358if (info->exception_handlers() != NULL) {359compilation()->add_exception_handlers_for_pco(pc_offset, info->exception_handlers());360}361}362363364void LIR_Assembler::add_call_info(int pc_offset, CodeEmitInfo* cinfo) {365flush_debug_info(pc_offset);366cinfo->record_debug_info(compilation()->debug_info_recorder(), pc_offset);367if (cinfo->exception_handlers() != NULL) {368compilation()->add_exception_handlers_for_pco(pc_offset, cinfo->exception_handlers());369}370}371372static ValueStack* debug_info(Instruction* ins) {373StateSplit* ss = ins->as_StateSplit();374if (ss != NULL) return ss->state();375return ins->state_before();376}377378void LIR_Assembler::process_debug_info(LIR_Op* op) {379Instruction* src = op->source();380if (src == NULL) return;381int pc_offset = code_offset();382if (_pending_non_safepoint == src) {383_pending_non_safepoint_offset = pc_offset;384return;385}386ValueStack* vstack = debug_info(src);387if (vstack == NULL) return;388if (_pending_non_safepoint != NULL) {389// Got some old debug info. Get rid of it.390if (debug_info(_pending_non_safepoint) == vstack) {391_pending_non_safepoint_offset = pc_offset;392return;393}394if (_pending_non_safepoint_offset < pc_offset) {395record_non_safepoint_debug_info();396}397_pending_non_safepoint = NULL;398}399// Remember the debug info.400if (pc_offset > compilation()->debug_info_recorder()->last_pc_offset()) {401_pending_non_safepoint = src;402_pending_non_safepoint_offset = pc_offset;403}404}405406// Index caller states in s, where 0 is the oldest, 1 its callee, etc.407// Return NULL if n is too large.408// Returns the caller_bci for the next-younger state, also.409static ValueStack* nth_oldest(ValueStack* s, int n, int& bci_result) {410ValueStack* t = s;411for (int i = 0; i < n; i++) {412if (t == NULL) break;413t = t->caller_state();414}415if (t == NULL) return NULL;416for (;;) {417ValueStack* tc = t->caller_state();418if (tc == NULL) return s;419t = tc;420bci_result = tc->bci();421s = s->caller_state();422}423}424425void LIR_Assembler::record_non_safepoint_debug_info() {426int pc_offset = _pending_non_safepoint_offset;427ValueStack* vstack = debug_info(_pending_non_safepoint);428int bci = vstack->bci();429430DebugInformationRecorder* debug_info = compilation()->debug_info_recorder();431assert(debug_info->recording_non_safepoints(), "sanity");432433debug_info->add_non_safepoint(pc_offset);434435// Visit scopes from oldest to youngest.436for (int n = 0; ; n++) {437int s_bci = bci;438ValueStack* s = nth_oldest(vstack, n, s_bci);439if (s == NULL) break;440IRScope* scope = s->scope();441//Always pass false for reexecute since these ScopeDescs are never used for deopt442debug_info->describe_scope(pc_offset, scope->method(), s->bci(), false/*reexecute*/);443}444445debug_info->end_non_safepoint(pc_offset);446}447448449void LIR_Assembler::add_debug_info_for_null_check_here(CodeEmitInfo* cinfo) {450add_debug_info_for_null_check(code_offset(), cinfo);451}452453void LIR_Assembler::add_debug_info_for_null_check(int pc_offset, CodeEmitInfo* cinfo) {454ImplicitNullCheckStub* stub = new ImplicitNullCheckStub(pc_offset, cinfo);455append_code_stub(stub);456}457458void LIR_Assembler::add_debug_info_for_div0_here(CodeEmitInfo* info) {459add_debug_info_for_div0(code_offset(), info);460}461462void LIR_Assembler::add_debug_info_for_div0(int pc_offset, CodeEmitInfo* cinfo) {463DivByZeroStub* stub = new DivByZeroStub(pc_offset, cinfo);464append_code_stub(stub);465}466467void LIR_Assembler::emit_rtcall(LIR_OpRTCall* op) {468rt_call(op->result_opr(), op->addr(), op->arguments(), op->tmp(), op->info());469}470471472void LIR_Assembler::emit_call(LIR_OpJavaCall* op) {473verify_oop_map(op->info());474475if (os::is_MP()) {476// must align calls sites, otherwise they can't be updated atomically on MP hardware477align_call(op->code());478}479480// emit the static call stub stuff out of line481emit_static_call_stub();482CHECK_BAILOUT();483484switch (op->code()) {485case lir_static_call:486case lir_dynamic_call:487call(op, relocInfo::static_call_type);488break;489case lir_optvirtual_call:490call(op, relocInfo::opt_virtual_call_type);491break;492case lir_icvirtual_call:493ic_call(op);494break;495case lir_virtual_call:496vtable_call(op);497break;498default:499fatal(err_msg_res("unexpected op code: %s", op->name()));500break;501}502503// JSR 292504// Record if this method has MethodHandle invokes.505if (op->is_method_handle_invoke()) {506compilation()->set_has_method_handle_invokes(true);507}508509#if defined(X86) && defined(TIERED)510// C2 leave fpu stack dirty clean it511if (UseSSE < 2) {512int i;513for ( i = 1; i <= 7 ; i++ ) {514ffree(i);515}516if (!op->result_opr()->is_float_kind()) {517ffree(0);518}519}520#endif // X86 && TIERED521}522523524void LIR_Assembler::emit_opLabel(LIR_OpLabel* op) {525_masm->bind (*(op->label()));526}527528529void LIR_Assembler::emit_op1(LIR_Op1* op) {530switch (op->code()) {531case lir_move:532if (op->move_kind() == lir_move_volatile) {533assert(op->patch_code() == lir_patch_none, "can't patch volatiles");534volatile_move_op(op->in_opr(), op->result_opr(), op->type(), op->info());535} else {536move_op(op->in_opr(), op->result_opr(), op->type(),537op->patch_code(), op->info(), op->pop_fpu_stack(),538op->move_kind() == lir_move_unaligned,539op->move_kind() == lir_move_wide);540}541break;542543case lir_prefetchr:544prefetchr(op->in_opr());545break;546547case lir_prefetchw:548prefetchw(op->in_opr());549break;550551case lir_roundfp: {552LIR_OpRoundFP* round_op = op->as_OpRoundFP();553roundfp_op(round_op->in_opr(), round_op->tmp(), round_op->result_opr(), round_op->pop_fpu_stack());554break;555}556557case lir_return:558return_op(op->in_opr());559break;560561case lir_safepoint:562if (compilation()->debug_info_recorder()->last_pc_offset() == code_offset()) {563_masm->nop();564}565safepoint_poll(op->in_opr(), op->info());566break;567568case lir_fxch:569fxch(op->in_opr()->as_jint());570break;571572case lir_fld:573fld(op->in_opr()->as_jint());574break;575576case lir_ffree:577ffree(op->in_opr()->as_jint());578break;579580case lir_branch:581break;582583case lir_push:584push(op->in_opr());585break;586587case lir_pop:588pop(op->in_opr());589break;590591case lir_neg:592negate(op->in_opr(), op->result_opr());593break;594595case lir_leal:596leal(op->in_opr(), op->result_opr());597break;598599case lir_null_check:600if (GenerateCompilerNullChecks) {601add_debug_info_for_null_check_here(op->info());602603if (op->in_opr()->is_single_cpu()) {604_masm->null_check(op->in_opr()->as_register());605} else {606Unimplemented();607}608}609break;610611case lir_monaddr:612monitor_address(op->in_opr()->as_constant_ptr()->as_jint(), op->result_opr());613break;614615#ifdef SPARC616case lir_pack64:617pack64(op->in_opr(), op->result_opr());618break;619620case lir_unpack64:621unpack64(op->in_opr(), op->result_opr());622break;623#endif624625case lir_unwind:626unwind_op(op->in_opr());627break;628629default:630Unimplemented();631break;632}633}634635636void LIR_Assembler::emit_op0(LIR_Op0* op) {637switch (op->code()) {638case lir_word_align: {639while (code_offset() % BytesPerWord != 0) {640_masm->nop();641}642break;643}644645case lir_nop:646assert(op->info() == NULL, "not supported");647_masm->nop();648break;649650case lir_label:651Unimplemented();652break;653654case lir_build_frame:655build_frame();656break;657658case lir_std_entry:659// init offsets660offsets()->set_value(CodeOffsets::OSR_Entry, _masm->offset());661_masm->align(CodeEntryAlignment);662if (needs_icache(compilation()->method())) {663check_icache();664}665offsets()->set_value(CodeOffsets::Verified_Entry, _masm->offset());666_masm->verified_entry();667build_frame();668offsets()->set_value(CodeOffsets::Frame_Complete, _masm->offset());669break;670671case lir_osr_entry:672offsets()->set_value(CodeOffsets::OSR_Entry, _masm->offset());673osr_entry();674break;675676case lir_24bit_FPU:677set_24bit_FPU();678break;679680case lir_reset_FPU:681reset_FPU();682break;683684case lir_breakpoint:685breakpoint();686break;687688case lir_fpop_raw:689fpop();690break;691692case lir_membar:693membar();694break;695696case lir_membar_acquire:697membar_acquire();698break;699700case lir_membar_release:701membar_release();702break;703704case lir_membar_loadload:705membar_loadload();706break;707708case lir_membar_storestore:709membar_storestore();710break;711712case lir_membar_loadstore:713membar_loadstore();714break;715716case lir_membar_storeload:717membar_storeload();718break;719720case lir_get_thread:721get_thread(op->result_opr());722break;723724default:725ShouldNotReachHere();726break;727}728}729730731void LIR_Assembler::emit_op2(LIR_Op2* op) {732switch (op->code()) {733case lir_cmp:734if (op->info() != NULL) {735assert(op->in_opr1()->is_address() || op->in_opr2()->is_address(),736"shouldn't be codeemitinfo for non-address operands");737add_debug_info_for_null_check_here(op->info()); // exception possible738}739comp_op(op->condition(), op->in_opr1(), op->in_opr2(), op);740break;741742case lir_cmp_l2i:743case lir_cmp_fd2i:744case lir_ucmp_fd2i:745comp_fl2i(op->code(), op->in_opr1(), op->in_opr2(), op->result_opr(), op);746break;747748case lir_cmove:749cmove(op->condition(), op->in_opr1(), op->in_opr2(), op->result_opr(), op->type());750break;751752case lir_shl:753case lir_shr:754case lir_ushr:755if (op->in_opr2()->is_constant()) {756shift_op(op->code(), op->in_opr1(), op->in_opr2()->as_constant_ptr()->as_jint(), op->result_opr());757} else {758shift_op(op->code(), op->in_opr1(), op->in_opr2(), op->result_opr(), op->tmp1_opr());759}760break;761762case lir_add:763case lir_sub:764case lir_mul:765case lir_mul_strictfp:766case lir_div:767case lir_div_strictfp:768case lir_rem:769assert(op->fpu_pop_count() < 2, "");770arith_op(771op->code(),772op->in_opr1(),773op->in_opr2(),774op->result_opr(),775op->info(),776op->fpu_pop_count() == 1);777break;778779case lir_abs:780case lir_sqrt:781case lir_sin:782case lir_tan:783case lir_cos:784case lir_log:785case lir_log10:786case lir_exp:787case lir_pow:788intrinsic_op(op->code(), op->in_opr1(), op->in_opr2(), op->result_opr(), op);789break;790791case lir_logic_and:792case lir_logic_or:793case lir_logic_xor:794logic_op(795op->code(),796op->in_opr1(),797op->in_opr2(),798op->result_opr());799break;800801case lir_throw:802throw_op(op->in_opr1(), op->in_opr2(), op->info());803break;804805case lir_xadd:806case lir_xchg:807atomic_op(op->code(), op->in_opr1(), op->in_opr2(), op->result_opr(), op->tmp1_opr());808break;809810default:811Unimplemented();812break;813}814}815816817void LIR_Assembler::build_frame() {818_masm->build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes());819}820821822void LIR_Assembler::roundfp_op(LIR_Opr src, LIR_Opr tmp, LIR_Opr dest, bool pop_fpu_stack) {823assert((src->is_single_fpu() && dest->is_single_stack()) ||824(src->is_double_fpu() && dest->is_double_stack()),825"round_fp: rounds register -> stack location");826827reg2stack (src, dest, src->type(), pop_fpu_stack);828}829830831void LIR_Assembler::move_op(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_PatchCode patch_code, CodeEmitInfo* info, bool pop_fpu_stack, bool unaligned, bool wide) {832if (src->is_register()) {833if (dest->is_register()) {834assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");835reg2reg(src, dest);836} else if (dest->is_stack()) {837assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");838reg2stack(src, dest, type, pop_fpu_stack);839} else if (dest->is_address()) {840reg2mem(src, dest, type, patch_code, info, pop_fpu_stack, wide, unaligned);841} else {842ShouldNotReachHere();843}844845} else if (src->is_stack()) {846assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");847if (dest->is_register()) {848stack2reg(src, dest, type);849} else if (dest->is_stack()) {850stack2stack(src, dest, type);851} else {852ShouldNotReachHere();853}854855} else if (src->is_constant()) {856if (dest->is_register()) {857const2reg(src, dest, patch_code, info); // patching is possible858} else if (dest->is_stack()) {859assert(patch_code == lir_patch_none && info == NULL, "no patching and info allowed here");860const2stack(src, dest);861} else if (dest->is_address()) {862assert(patch_code == lir_patch_none, "no patching allowed here");863const2mem(src, dest, type, info, wide);864} else {865ShouldNotReachHere();866}867868} else if (src->is_address()) {869mem2reg(src, dest, type, patch_code, info, wide, unaligned);870871} else {872ShouldNotReachHere();873}874}875876877void LIR_Assembler::verify_oop_map(CodeEmitInfo* info) {878#ifndef PRODUCT879if (VerifyOops) {880OopMapStream s(info->oop_map());881while (!s.is_done()) {882OopMapValue v = s.current();883if (v.is_oop()) {884VMReg r = v.reg();885if (!r->is_stack()) {886stringStream st;887st.print("bad oop %s at %d", r->as_Register()->name(), _masm->offset());888#ifdef SPARC889_masm->_verify_oop(r->as_Register(), strdup(st.as_string()), __FILE__, __LINE__);890#else891_masm->verify_oop(r->as_Register());892#endif893} else {894_masm->verify_stack_oop(r->reg2stack() * VMRegImpl::stack_slot_size);895}896}897check_codespace();898CHECK_BAILOUT();899900s.next();901}902}903#endif904}905906907