comparison 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
comparison
equal deleted inserted replaced
22045:ffbc7f472438 22046:e7c2d36daf72
812 void reset() { 812 void reset() {
813 } 813 }
814 814
815 @Override 815 @Override
816 public int hashCode() { 816 public int hashCode() {
817 return description.hashCode(); 817 return description.hashCode() * code.hashCode();
818 } 818 }
819 819
820 @Override 820 @Override
821 public boolean equals(Object obj) { 821 public boolean equals(Object obj) {
822 if (this == obj) { 822 if (this == obj) {
825 if (obj == null) { 825 if (obj == null) {
826 return false; 826 return false;
827 } 827 }
828 if (obj instanceof LiteralSource) { 828 if (obj instanceof LiteralSource) {
829 LiteralSource other = (LiteralSource) obj; 829 LiteralSource other = (LiteralSource) obj;
830 return description.equals(other.description); 830 return description.equals(other.description) && code.equals(other.code);
831 } 831 }
832 return false; 832 return false;
833 } 833 }
834 } 834 }
835 835