@SuppressWarnings("deprecation") public AbstractRootMethod getLanguageRoot(Atom language){ if (!languageRoots.containsKey(language)) { AbstractRootMethod languageRoot = roots.get(language, this); CGNode languageRootNode = null; try { languageRootNode = findOrCreateNode(languageRoot, Everywhere.EVERYWHERE); } catch (CancelException e) { e.printStackTrace(); Assertions.UNREACHABLE(); } languageRootNodes.add(languageRootNode); CallSiteReference site = CallSiteReference.make(1, languageRoot.getReference(), IInvokeInstruction.Dispatch.STATIC); CGNode fakeRootNode = getFakeRootNode(); CrossLanguageFakeRoot fakeRootMethod = (CrossLanguageFakeRoot) fakeRootNode.getMethod(); site = fakeRootMethod.addInvocationInternal(new int[0], site).getCallSite(); fakeRootNode.addTarget(site, languageRootNode); languageRoots.put(language, languageRoot); } return (AbstractRootMethod) languageRoots.get(language); }
@SuppressWarnings("deprecation") public AbstractRootMethod getLanguageRoot(Atom language){ if (!languageRoots.containsKey(language)) { AbstractRootMethod languageRoot = roots.get(language, this); CGNode languageRootNode = null; try { languageRootNode = findOrCreateNode(languageRoot, Everywhere.EVERYWHERE); } catch (CancelException e) { e.printStackTrace(); Assertions.UNREACHABLE(); } languageRootNodes.add(languageRootNode); CallSiteReference site = CallSiteReference.make(1, languageRoot.getReference(), IInvokeInstruction.Dispatch.STATIC); CGNode fakeRootNode = getFakeRootNode(); CrossLanguageFakeRoot fakeRootMethod = (CrossLanguageFakeRoot) fakeRootNode.getMethod(); site = fakeRootMethod.addInvocationInternal(new int[0], site).getCallSite(); fakeRootNode.addTarget(site, languageRootNode); languageRoots.put(language, languageRoot); } return (AbstractRootMethod) languageRoots.get(language); }
@Test public void testSwitch1() { try { runTest(singleTestSrc(), rtJar, simpleTestEntryPoint(), emptyList, true, null); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (CancelException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }