diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/vm/TruffleVM.java @ 21890:894f82515e38

Truffle/APIs and Debugging: Evolutionary steps to integrating debugging and tool support with TruffleVM APIs - Add a version string to language registration: Language.getShortName() produces a string with both language and version - Rename SLMain --> SLLanguage (little change current machinery) - Remove DebugEngine dependence on ExecutionContext: Visualizer access migrated to TruffleLanguage - ExecutionContext now has only one method left: getCompilerOptions() - Rename SourceExecutionProvider to DebugSupportProvider, now supplied by implementing abstract TruffleLanguage.getDebugSupport() - Revise DebugEngine and its helper classes to work with the new APIs
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Tue, 09 Jun 2015 15:20:30 -0700
parents 45083be8a812
children
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/vm/TruffleVM.java	Fri Jun 05 18:05:13 2015 -0700
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/vm/TruffleVM.java	Tue Jun 09 15:20:30 2015 -0700
@@ -34,7 +34,9 @@
 import com.oracle.truffle.api.*;
 import com.oracle.truffle.api.TruffleLanguage.Env;
 import com.oracle.truffle.api.TruffleLanguage.Registration;
+import com.oracle.truffle.api.debug.*;
 import com.oracle.truffle.api.impl.*;
+import com.oracle.truffle.api.instrument.*;
 import com.oracle.truffle.api.source.*;
 
 /**
@@ -416,6 +418,7 @@
         private final Properties props;
         private TruffleLanguage impl;
         private final String prefix;
+        private String shortName;
 
         Language(String prefix, Properties props) {
             this.prefix = prefix;
@@ -463,7 +466,18 @@
          * @return string describing the specific language version
          */
         public String getShortName() {
-            return getName() + getVersion();
+            if (shortName == null) {
+                shortName = getName() + "(" + getVersion() + ")";
+            }
+            return shortName;
+        }
+
+        public ToolSupportProvider getToolSupport() {
+            return SPI.getToolSupport(getImpl());
+        }
+
+        public DebugSupportProvider getDebugSupport() {
+            return SPI.getDebugSupport(getImpl());
         }
 
         TruffleLanguage getImpl() {
@@ -537,5 +551,15 @@
         public Object invoke(Object obj, Object[] args) throws IOException {
             return super.invoke(obj, args);
         }
+
+        @Override
+        public ToolSupportProvider getToolSupport(TruffleLanguage l) {
+            return super.getToolSupport(l);
+        }
+
+        @Override
+        public DebugSupportProvider getDebugSupport(TruffleLanguage l) {
+            return super.getDebugSupport(l);
+        }
     } // end of SPIAccessor
 }