/** * Maps all local-associated registers that are not parameters. * Tries to find an unreserved range that's wide enough for all of * the SSA registers, and then tries to map them all to that * range. If not all fit, a new range is tried until all registers * have been fit. */ private void handleLocalAssociatedOther() { for (ArrayList<RegisterSpec> specs : localVariables.values()) { int ropReg = 0; boolean done; do { int maxCategory = 1; // Compute max category for remaining unmapped registers. int sz = specs.size(); for (int i = 0; i < sz; i++) { RegisterSpec ssaSpec = specs.get(i); int category = ssaSpec.getCategory(); if (!ssaRegsMapped.get(ssaSpec.getReg()) && category > maxCategory) { maxCategory = category; } } ropReg = findRopRegForLocal(ropReg, maxCategory); done = tryMapRegs(specs, ropReg, maxCategory, true); // Increment for next call to findNext. ropReg++; } while (!done); } }
/** * Maps all local-associated parameters to rop registers. */ private void handleLocalAssociatedParams() { for (ArrayList<RegisterSpec> ssaRegs : localVariables.values()) { int sz = ssaRegs.size(); int paramIndex = -1; int paramCategory = 0; // First, find out if this local variable is a parameter. for (int i = 0; i < sz; i++) { RegisterSpec ssaSpec = ssaRegs.get(i); int ssaReg = ssaSpec.getReg(); paramIndex = getParameterIndexForReg(ssaReg); if (paramIndex >= 0) { paramCategory = ssaSpec.getCategory(); addMapping(ssaSpec, paramIndex); break; } } if (paramIndex < 0) { // This local wasn't a parameter. continue; } // Any remaining local-associated registers will be mapped later. tryMapRegs(ssaRegs, paramIndex, paramCategory, true); } }
done = tryMapRegs(specs, ropReg, maxCategory, true);
done = tryMapRegs(specs, ropReg, maxCategory, true);
/** * Maps all local-associated parameters to rop registers. */ private void handleLocalAssociatedParams() { for (ArrayList<RegisterSpec> ssaRegs : localVariables.values()) { int sz = ssaRegs.size(); int paramIndex = -1; int paramCategory = 0; // First, find out if this local variable is a parameter. for (int i = 0; i < sz; i++) { RegisterSpec ssaSpec = ssaRegs.get(i); int ssaReg = ssaSpec.getReg(); paramIndex = getParameterIndexForReg(ssaReg); if (paramIndex >= 0) { paramCategory = ssaSpec.getCategory(); addMapping(ssaSpec, paramIndex); break; } } if (paramIndex < 0) { // This local wasn't a parameter. continue; } // Any remaining local-associated registers will be mapped later. tryMapRegs(ssaRegs, paramIndex, paramCategory, true); } }
/** * Maps all local-associated parameters to rop registers. */ private void handleLocalAssociatedParams() { for (ArrayList<RegisterSpec> ssaRegs : localVariables.values()) { int sz = ssaRegs.size(); int paramIndex = -1; int paramCategory = 0; // First, find out if this local variable is a parameter. for (int i = 0; i < sz; i++) { RegisterSpec ssaSpec = ssaRegs.get(i); int ssaReg = ssaSpec.getReg(); paramIndex = getParameterIndexForReg(ssaReg); if (paramIndex >= 0) { paramCategory = ssaSpec.getCategory(); addMapping(ssaSpec, paramIndex); break; } } if (paramIndex < 0) { // This local wasn't a parameter. continue; } // Any remaining local-associated registers will be mapped later. tryMapRegs(ssaRegs, paramIndex, paramCategory, true); } }
done = tryMapRegs(specs, ropReg, maxCategory, true);
done = tryMapRegs(specs, ropReg, maxCategory, true);
/** * Maps all local-associated parameters to rop registers. */ private void handleLocalAssociatedParams() { for (ArrayList<RegisterSpec> ssaRegs : localVariables.values()) { int sz = ssaRegs.size(); int paramIndex = -1; int paramCategory = 0; // First, find out if this local variable is a parameter. for (int i = 0; i < sz; i++) { RegisterSpec ssaSpec = ssaRegs.get(i); int ssaReg = ssaSpec.getReg(); paramIndex = getParameterIndexForReg(ssaReg); if (paramIndex >= 0) { paramCategory = ssaSpec.getCategory(); addMapping(ssaSpec, paramIndex); break; } } if (paramIndex < 0) { // This local wasn't a parameter. continue; } // Any remaining local-associated registers will be mapped later. tryMapRegs(ssaRegs, paramIndex, paramCategory, true); } }
done = tryMapRegs(specs, ropReg, maxCategory, true);
/** * Maps all local-associated parameters to rop registers. */ private void handleLocalAssociatedParams() { for (ArrayList<RegisterSpec> ssaRegs : localVariables.values()) { int sz = ssaRegs.size(); int paramIndex = -1; int paramCategory = 0; // First, find out if this local variable is a parameter. for (int i = 0; i < sz; i++) { RegisterSpec ssaSpec = ssaRegs.get(i); int ssaReg = ssaSpec.getReg(); paramIndex = getParameterIndexForReg(ssaReg); if (paramIndex >= 0) { paramCategory = ssaSpec.getCategory(); addMapping(ssaSpec, paramIndex); break; } } if (paramIndex < 0) { // This local wasn't a parameter. continue; } // Any remaining local-associated registers will be mapped later. tryMapRegs(ssaRegs, paramIndex, paramCategory, true); } }
/** * Maps all local-associated parameters to rop registers. */ private void handleLocalAssociatedParams() { for (ArrayList<RegisterSpec> ssaRegs : localVariables.values()) { int sz = ssaRegs.size(); int paramIndex = -1; int paramCategory = 0; // First, find out if this local variable is a parameter. for (int i = 0; i < sz; i++) { RegisterSpec ssaSpec = ssaRegs.get(i); int ssaReg = ssaSpec.getReg(); paramIndex = getParameterIndexForReg(ssaReg); if (paramIndex >= 0) { paramCategory = ssaSpec.getCategory(); addMapping(ssaSpec, paramIndex); break; } } if (paramIndex < 0) { // This local wasn't a parameter. continue; } // Any remaining local-associated registers will be mapped later. tryMapRegs(ssaRegs, paramIndex, paramCategory, true); } }
done = tryMapRegs(specs, ropReg, maxCategory, true);
done = tryMapRegs(specs, ropReg, maxCategory, true);
/** * Maps all local-associated parameters to rop registers. */ private void handleLocalAssociatedParams() { for (ArrayList<RegisterSpec> ssaRegs : localVariables.values()) { int sz = ssaRegs.size(); int paramIndex = -1; int paramCategory = 0; // First, find out if this local variable is a parameter. for (int i = 0; i < sz; i++) { RegisterSpec ssaSpec = ssaRegs.get(i); int ssaReg = ssaSpec.getReg(); paramIndex = getParameterIndexForReg(ssaReg); if (paramIndex >= 0) { paramCategory = ssaSpec.getCategory(); addMapping(ssaSpec, paramIndex); break; } } if (paramIndex < 0) { // This local wasn't a parameter. continue; } // Any remaining local-associated registers will be mapped later. tryMapRegs(ssaRegs, paramIndex, paramCategory, true); } }
/** * Maps all local-associated parameters to rop registers. */ private void handleLocalAssociatedParams() { for (ArrayList<RegisterSpec> ssaRegs : localVariables.values()) { int sz = ssaRegs.size(); int paramIndex = -1; int paramCategory = 0; // First, find out if this local variable is a parameter. for (int i = 0; i < sz; i++) { RegisterSpec ssaSpec = ssaRegs.get(i); int ssaReg = ssaSpec.getReg(); paramIndex = getParameterIndexForReg(ssaReg); if (paramIndex >= 0) { paramCategory = ssaSpec.getCategory(); addMapping(ssaSpec, paramIndex); break; } } if (paramIndex < 0) { // This local wasn't a parameter. continue; } // Any remaining local-associated registers will be mapped later. tryMapRegs(ssaRegs, paramIndex, paramCategory, true); } }
int category = checkRegSpec.getCategory(); while (!tryMapRegs(ssaRegs, ropReg, category, false)) { ropReg = findNextUnreservedRopReg(ropReg + 1, category);
tryMapRegs(ssaRegs, maxReg, category, false); while (!tryMapRegs(ssaRegs, mapReg, category, false)) { mapReg = findNextUnreservedRopReg(mapReg + 1, category);
tryMapRegs(ssaRegs, maxReg, category, false); while (!tryMapRegs(ssaRegs, mapReg, category, false)) { mapReg = findNextUnreservedRopReg(mapReg + 1, category);
tryMapRegs(ssaRegs, maxReg, category, false); while (!tryMapRegs(ssaRegs, mapReg, category, false)) { mapReg = findNextUnreservedRopReg(mapReg + 1, category);