/* * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
LIR_Opr FrameMap::map_to_opr(BasicType type, VMRegPair* reg, bool) {
LIR_Opr opr = LIR_OprFact::illegalOpr;
VMReg r_1 = reg->first();
VMReg r_2 = reg->second(); if (r_1->is_stack()) { int st_off = (r_1->reg2stack() + SharedRuntime::out_preserve_stack_slots()) * VMRegImpl::stack_slot_size;
opr = LIR_OprFact::address(new LIR_Address(SP_opr, st_off, type));
} elseif (r_1->is_Register()) { Register reg = r_1->as_Register(); if (r_2->is_Register() && (type == T_LONG || type == T_DOUBLE)) {
opr = as_long_opr(reg, r_2->as_Register());
} elseif (is_reference_type(type)) {
opr = as_oop_opr(reg);
} elseif (type == T_METADATA) {
opr = as_metadata_opr(reg);
} elseif (type == T_ADDRESS) {
opr = as_address_opr(reg);
} else { // PreferInterpreterNativeStubs should ensure we never need to // handle a long opr passed as R3+stack_slot
assert(! r_2->is_stack(), "missing support for ALIGN_WIDE_ARGUMENTS==0");
opr = as_opr(reg);
}
} elseif (r_1->is_FloatRegister()) {
FloatRegister reg = r_1->as_FloatRegister();
opr = type == T_FLOAT ? as_float_opr(reg) : as_double_opr(reg);
} else {
ShouldNotReachHere();
} return opr;
}
void FrameMap::initialize() { if (_init_done) return;
int i; int rnum = 0;
// Registers used for allocation
assert(Rthread == R10 && Rtemp == R12, "change the code here"); for (i = 0; i < 10; i++) {
map_register(rnum++, as_Register(i));
}
assert(rnum == pd_nof_cpu_regs_reg_alloc, "should be");
// Registers not used for allocation
map_register(rnum++, LR); // LR register should be listed first, see c1_LinearScan_arm.hpp::is_processed_reg_num.
assert(rnum == pd_nof_cpu_regs_processed_in_linearscan, "should be");
for (i = 0; i < nof_caller_save_cpu_regs(); i++) {
_caller_save_cpu_regs[i] = LIR_OprFact::single_cpu(i);
} for (i = 0; i < nof_caller_save_fpu_regs; i++) {
_caller_save_fpu_regs[i] = LIR_OprFact::single_fpu(i);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.