diff truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java @ 22046:e7c2d36daf72

TruffleLanguage.parse method to convert a source to CallTarget. Basic caching to make sure the code is shared among tenants in one JVM.
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Thu, 30 Jul 2015 17:36:34 +0200
parents f26b6524e5e0
children 0f0e34039769
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java	Thu Jul 30 17:16:59 2015 +0200
+++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java	Thu Jul 30 17:36:34 2015 +0200
@@ -814,7 +814,7 @@
 
         @Override
         public int hashCode() {
-            return description.hashCode();
+            return description.hashCode() * code.hashCode();
         }
 
         @Override
@@ -827,7 +827,7 @@
             }
             if (obj instanceof LiteralSource) {
                 LiteralSource other = (LiteralSource) obj;
-                return description.equals(other.description);
+                return description.equals(other.description) && code.equals(other.code);
             }
             return false;
         }