Skip to content

Commit 9d3e790

Browse files
committed
Revert "Merge branch 'eval-server-improvements'"
This reverts commit b771669, reversing changes made to 2975829.
1 parent b771669 commit 9d3e790

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

src/vm/jvm/runtime/org/perl6/nqp/tools/EvalServer.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package org.perl6.nqp.tools;
22

33
import java.io.ByteArrayInputStream;
4-
import java.io.ByteArrayOutputStream;
54
import java.io.IOException;
65
import java.io.PrintStream;
76
import java.net.InetSocketAddress;
@@ -38,40 +37,6 @@ public class EvalServer {
3837
private WritableByteChannel tokenCh;
3938
private Path tokenPath;
4039

41-
public String run(String appPath, String code) throws Exception {
42-
String[] argv = new String[2];
43-
argv[0] = "-e";
44-
argv[1] = code;
45-
return run(appPath, argv);
46-
}
47-
48-
public String run(String appPath, String[] argv) throws Exception {
49-
try {
50-
cuType = LibraryLoader.loadFile( appPath, true );
51-
} catch (ThreadDeath td) {
52-
throw new RuntimeException("Couldn't loadFile. Your CLASSPATH might not be set up correctly.");
53-
}
54-
55-
GlobalContext gc = new GlobalContext();
56-
gc.in = new ByteArrayInputStream(new byte[0]);
57-
ByteArrayOutputStream baos = new ByteArrayOutputStream();
58-
gc.out = gc.err = new PrintStream( baos, true, "UTF-8" );
59-
gc.interceptExit = true;
60-
gc.sharingHint = true;
61-
62-
CompilationUnit cu = CompilationUnit.setupCompilationUnit(gc.mainThread, cuType, true);
63-
CodeRef entryRef = null;
64-
if (cu.entryQbid() >= 0) entryRef = cu.lookupCodeRef(cu.entryQbid());
65-
if (entryRef == null)
66-
throw new RuntimeException("This class is not an entry point");
67-
try {
68-
Ops.invokeMain(gc.mainThread, entryRef, cuType.getName(), argv);
69-
} catch (ThreadDeath td) {
70-
baos.flush();
71-
}
72-
return baos.toString("UTF-8");
73-
}
74-
7540
public static void main(String[] args) throws Exception {
7641
String executableName = System.getProperty("perl6.execname");
7742
if (executableName != null) {

0 commit comments

Comments
 (0)