comparison graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java @ 2842:7596ae867a7b

basic inlining passes all tests, including optimistic inlining
author Lukas Stadler <lukas.stadler@jku.at>
date Wed, 01 Jun 2011 16:26:17 +0200
parents 1cd59ca9ac86
children 7f14e6b48a9c
comparison
equal deleted inserted replaced
2841:633e66de40fe 2842:7596ae867a7b
1882 // return a dummy value because real value not needed 1882 // return a dummy value because real value not needed
1883 return CiValue.IllegalValue; 1883 return CiValue.IllegalValue;
1884 } 1884 }
1885 } 1885 }
1886 1886
1887 CiFrame computeFrameForState(int opId, FrameState state, CiBitMap frameRefMap) { 1887 CiFrame computeFrameForState(FrameState state, int opId, CiBitMap frameRefMap) {
1888 CiValue[] values = new CiValue[state.valuesSize() + state.locksSize()]; 1888 CiValue[] values = new CiValue[state.valuesSize() + state.locksSize()];
1889 int valueIndex = 0; 1889 int valueIndex = 0;
1890 1890
1891 for (int i = 0; i < state.valuesSize(); i++) { 1891 for (int i = 0; i < state.valuesSize(); i++) {
1892 values[valueIndex++] = toCiValue(opId, state.valueAt(i)); 1892 values[valueIndex++] = toCiValue(opId, state.valueAt(i));
1907 } else { 1907 } else {
1908 values[valueIndex++] = toCiValue(opId, lock); 1908 values[valueIndex++] = toCiValue(opId, lock);
1909 } 1909 }
1910 } 1910 }
1911 } 1911 }
1912 1912 CiFrame caller = null;
1913 return new CiFrame(null, ir.compilation.method, state.bci, values, state.localsSize(), state.stackSize(), state.locksSize()); 1913 if (state.outerFrameState() != null) {
1914 caller = computeFrameForState(state.outerFrameState(), opId, frameRefMap);
1915 }
1916 return new CiFrame(caller, state.method, state.bci, values, state.localsSize(), state.stackSize(), state.locksSize());
1914 } 1917 }
1915 1918
1916 private void computeDebugInfo(IntervalWalker iw, LIRInstruction op) { 1919 private void computeDebugInfo(IntervalWalker iw, LIRInstruction op) {
1917 assert iw != null : "interval walker needed for debug information"; 1920 assert iw != null : "interval walker needed for debug information";
1918 computeDebugInfo(iw, op, op.info); 1921 computeDebugInfo(iw, op, op.info);
1944 1947
1945 CiFrame computeFrame(FrameState state, int opId, CiBitMap frameRefMap) { 1948 CiFrame computeFrame(FrameState state, int opId, CiBitMap frameRefMap) {
1946 if (C1XOptions.TraceLinearScanLevel >= 3) { 1949 if (C1XOptions.TraceLinearScanLevel >= 3) {
1947 TTY.println("creating debug information at opId %d", opId); 1950 TTY.println("creating debug information at opId %d", opId);
1948 } 1951 }
1949 return computeFrameForState(opId, state, frameRefMap); 1952 return computeFrameForState(state, opId, frameRefMap);
1950 } 1953 }
1951 1954
1952 private void assignLocations(List<LIRInstruction> instructions, IntervalWalker iw) { 1955 private void assignLocations(List<LIRInstruction> instructions, IntervalWalker iw) {
1953 int numInst = instructions.size(); 1956 int numInst = instructions.size();
1954 boolean hasDead = false; 1957 boolean hasDead = false;