void codegen_store(struct variable *var, gp_boolean constant_offset, int offset, tree *offset_expr) { if (offset_expr) { if (constant_offset) { if (is_far(var)) { STORE_FILE(var->name, codegen_size, offset, true); } else { STORE_FILE(var->name, codegen_size, offset, false); } } else { if (is_far(var)) { STORE_INDIRECT(var->name, codegen_size, 0, true); } else { STORE_INDIRECT(var->name, codegen_size, 0, false); } } } else { if (is_far(var)) { STORE_FILE(var->name, codegen_size, 0, true); } else { STORE_FILE(var->name, codegen_size, 0, false); } } }
static void codegen_load_file(tree *symbol, struct variable *var) { int offset; int element_size; if ((symbol->tag == node_symbol) && (SYM_OFST(symbol))) { /* access an array */ element_size = type_size(var->type->prim); if ((var) && (var->type) && (var->type->tag == type_array)) { if (can_evaluate(SYM_OFST(symbol), false)) { /* direct access */ offset = analyze_check_array(symbol, var) * element_size; if (is_far(var)) { LOAD_FILE(var->name, codegen_size, offset, true); } else { LOAD_FILE(var->name, codegen_size, offset, false); } } else { codegen_indirect(SYM_OFST(symbol), var, element_size, false); if (is_far(var)) { LOAD_INDIRECT(var->name, codegen_size, 0, true); } else { LOAD_INDIRECT(var->name, codegen_size, 0, false); } } } else { analyze_error(symbol, "symbol %s is not an array", SYM_NAME(symbol)); } } else { if (is_far(var)) { LOAD_FILE(var->name, codegen_size, 0, true); } else { LOAD_FILE(var->name, codegen_size, 0, false); } } return; }
void codegen_unop(struct variable *var, gp_boolean constant_offset, int offset, tree *offset_expr, tree *unop, enum size_tag size) { temp_number = codegen_setup(size); if (offset_expr) { if (constant_offset) { if (is_far(var)) { UNOPGEN(UNOP_OP(unop), true, var->name, codegen_size, offset, true); } else { UNOPGEN(UNOP_OP(unop), true, var->name, codegen_size, offset, false); } } else { if (is_far(var)) { UNOPGEN(UNOP_OP(unop), false, var->name, codegen_size, 0, true); } else { UNOPGEN(UNOP_OP(unop), false, var->name, codegen_size, 0, false); } } } else { if (is_far(var)) { UNOPGEN(UNOP_OP(unop), true, var->name, codegen_size, 0, true); } else { UNOPGEN(UNOP_OP(unop), true, var->name, codegen_size, 0, false); } } if (temp_number > max_temp_number) max_temp_number = temp_number; }
bool OopDesc::is_near(void) const { return is_java_near() || is_obj_near() || is_generic_near() || is_far() || is_instance_class() || is_type_array_class() || is_obj_array_class(); }