# HG changeset patch # User Doug Simon # Date 1351787453 -3600 # Node ID eb980b869753574572bd4e68f961f4401cd7bc5e # Parent cc3fa26e7de75234900d98e32a57dbdf194aa7e9 refactored anonymous class into inner class to ease debugging diff -r cc3fa26e7de7 -r eb980b869753 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompilationResult.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompilationResult.java Thu Nov 01 17:30:04 2012 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotCompilationResult.java Thu Nov 01 17:30:53 2012 +0100 @@ -54,6 +54,15 @@ } } + static class SiteComparator implements Comparator { + public int compare(Site s1, Site s2) { + if (s1.pcOffset == s2.pcOffset && (s1 instanceof Mark ^ s2 instanceof Mark)) { + return s1 instanceof Mark ? -1 : 1; + } + return s1.pcOffset - s2.pcOffset; + } + } + private static Site[] getSortedSites(CompilationResult target) { List[] lists = new List[] {target.getSafepoints(), target.getDataReferences(), target.getMarks()}; int count = 0; @@ -67,15 +76,7 @@ result[pos++] = (Site) elem; } } - Arrays.sort(result, new Comparator() { - - public int compare(Site s1, Site s2) { - if (s1.pcOffset == s2.pcOffset && (s1 instanceof Mark ^ s2 instanceof Mark)) { - return s1 instanceof Mark ? -1 : 1; - } - return s1.pcOffset - s2.pcOffset; - } - }); + Arrays.sort(result, new SiteComparator()); return result; } }