@@ -485,14 +485,16 @@ public static StaticObject doBuiltinTypeConverter(Object value, EspressoType tar
485
485
@ Cached @ Exclusive ProxyInstantiateNode proxyInstantiatorNode ,
486
486
@ CachedLibrary (limit = "LIMIT" ) @ Exclusive InteropLibrary interop ,
487
487
@ Cached InstanceOf .Dynamic instanceOf ,
488
- @ Cached @ Shared InlinedBranchProfile errorProfile ) throws UnsupportedTypeException {
488
+ @ Cached InlinedBranchProfile noConverterProfile ,
489
+ @ Cached InlinedBranchProfile errorProfile ) throws UnsupportedTypeException {
489
490
try {
490
491
Object metaObject = interop .getMetaObject (value );
491
492
String metaName = getMetaName (metaObject , interop );
492
493
Klass rawType = targetType .getRawType ();
493
494
// first check if there's a user-defined custom type converter defined
494
495
PolyglotTypeMappings .TypeConverter converter = lookupTypeConverterNode .execute (metaName );
495
496
if (converter != null ) {
497
+ noConverterProfile .enter (node );
496
498
EspressoContext context = EspressoContext .get (node );
497
499
StaticObject foreignWrapper = StaticObject .createForeign (context .getLanguage (), context .getMeta ().java_lang_Object , value , interop );
498
500
StaticObject result = (StaticObject ) converter .convert (foreignWrapper );
@@ -579,7 +581,9 @@ public StaticObject doForeignNull(Object value,
579
581
"interop.hasMetaObject(value)" ,
580
582
"!isStaticObject(value)"
581
583
})
584
+ @ SuppressWarnings ("truffle-static-method" )
582
585
public StaticObject doMappedList (Object value ,
586
+ @ Bind Node node ,
583
587
@ Bind ("getContext()" ) EspressoContext context ,
584
588
@ Cached LookupTypeConverterNode lookupTypeConverterNode ,
585
589
@ Cached LookupProxyKlassNode lookupProxyKlassNode ,
@@ -608,7 +612,7 @@ public StaticObject doMappedList(Object value,
608
612
} catch (UnsupportedMessageException ex ) {
609
613
// no meta object, fall through to throw unsupported type
610
614
}
611
- errorProfile .enter (this );
615
+ errorProfile .enter (node );
612
616
throw UnsupportedTypeException .create (new Object []{value }, getMeta ().java_util_List .getTypeAsString ());
613
617
}
614
618
@@ -653,7 +657,9 @@ public StaticObject doForeignNull(Object value,
653
657
"isHostObject(getContext(), value)" ,
654
658
"!isStaticObject(value)"
655
659
})
660
+ @ SuppressWarnings ("truffle-static-method" )
656
661
public StaticObject doMappedCollection (Object value ,
662
+ @ Bind Node node ,
657
663
@ Bind ("getMeta()" ) Meta meta ,
658
664
@ Cached LookupTypeConverterNode lookupTypeConverterNode ,
659
665
@ Cached LookupProxyKlassNode lookupProxyKlassNode ,
@@ -682,7 +688,7 @@ public StaticObject doMappedCollection(Object value,
682
688
} catch (UnsupportedMessageException ex ) {
683
689
// no meta object, fall through to throw unsupported type
684
690
}
685
- errorProfile .enter (this );
691
+ errorProfile .enter (node );
686
692
throw UnsupportedTypeException .create (new Object []{value }, getMeta ().java_util_Collection .getTypeAsString ());
687
693
}
688
694
@@ -727,7 +733,9 @@ public StaticObject doForeignNull(Object value,
727
733
"isHostObject(getContext(), value)" ,
728
734
"!isStaticObject(value)"
729
735
})
736
+ @ SuppressWarnings ("truffle-static-method" )
730
737
public StaticObject doMappedIterable (Object value ,
738
+ @ Bind Node node ,
731
739
@ Bind ("getMeta()" ) Meta meta ,
732
740
@ Cached LookupTypeConverterNode lookupTypeConverterNode ,
733
741
@ Cached LookupProxyKlassNode lookupProxyKlassNode ,
@@ -756,7 +764,7 @@ public StaticObject doMappedIterable(Object value,
756
764
} catch (UnsupportedMessageException ex ) {
757
765
// no meta object, fall through to throw unsupported type
758
766
}
759
- errorProfile .enter (this );
767
+ errorProfile .enter (node );
760
768
throw UnsupportedTypeException .create (new Object []{value }, getMeta ().java_lang_Iterable .getTypeAsString ());
761
769
}
762
770
@@ -801,7 +809,9 @@ public StaticObject doForeignNull(Object value,
801
809
"isHostObject(getContext(), value)" ,
802
810
"!isStaticObject(value)"
803
811
})
812
+ @ SuppressWarnings ("truffle-static-method" )
804
813
public StaticObject doMappedIterator (Object value ,
814
+ @ Bind Node node ,
805
815
@ Bind ("getMeta()" ) Meta meta ,
806
816
@ Cached LookupTypeConverterNode lookupTypeConverterNode ,
807
817
@ Cached LookupProxyKlassNode lookupProxyKlassNode ,
@@ -830,7 +840,7 @@ public StaticObject doMappedIterator(Object value,
830
840
} catch (UnsupportedMessageException ex ) {
831
841
// no meta object, fall through to throw unsupported type
832
842
}
833
- errorProfile .enter (this );
843
+ errorProfile .enter (node );
834
844
throw UnsupportedTypeException .create (new Object []{value }, getMeta ().java_util_Iterator .getTypeAsString ());
835
845
}
836
846
@@ -875,7 +885,9 @@ public StaticObject doForeignNull(Object value,
875
885
"isHostObject(getContext(), value)" ,
876
886
"!isStaticObject(value)"
877
887
})
888
+ @ SuppressWarnings ("truffle-static-method" )
878
889
public StaticObject doMappedMap (Object value ,
890
+ @ Bind Node node ,
879
891
@ Bind ("getMeta()" ) Meta meta ,
880
892
@ Cached LookupTypeConverterNode lookupTypeConverterNode ,
881
893
@ Cached LookupProxyKlassNode lookupProxyKlassNode ,
@@ -903,7 +915,7 @@ public StaticObject doMappedMap(Object value,
903
915
} catch (UnsupportedMessageException ex ) {
904
916
// no meta object, fall through to throw unsupported type
905
917
}
906
- errorProfile .enter (this );
918
+ errorProfile .enter (node );
907
919
throw UnsupportedTypeException .create (new Object []{value }, getMeta ().java_util_Map .getTypeAsString ());
908
920
}
909
921
@@ -947,7 +959,9 @@ public StaticObject doForeignNull(Object value,
947
959
"isHostObject(getContext(), value)" ,
948
960
"!isStaticObject(value)"
949
961
})
962
+ @ SuppressWarnings ("truffle-static-method" )
950
963
public StaticObject doMappedSet (Object value ,
964
+ @ Bind Node node ,
951
965
@ Bind ("getMeta()" ) Meta meta ,
952
966
@ Cached LookupTypeConverterNode lookupTypeConverterNode ,
953
967
@ Cached LookupProxyKlassNode lookupProxyKlassNode ,
@@ -976,7 +990,7 @@ public StaticObject doMappedSet(Object value,
976
990
} catch (UnsupportedMessageException ex ) {
977
991
// no meta object, fall through to throw unsupported type
978
992
}
979
- errorProfile .enter (this );
993
+ errorProfile .enter (node );
980
994
throw UnsupportedTypeException .create (new Object []{value }, getMeta ().java_util_Set .getTypeAsString ());
981
995
}
982
996
@@ -1692,6 +1706,7 @@ public StaticObject doEspresso(StaticObject value,
1692
1706
"isHostObject(getContext(), value)"
1693
1707
})
1694
1708
StaticObject doForeignInterface (Object value ,
1709
+ @ Bind Node node ,
1695
1710
@ Shared ("value" ) @ CachedLibrary (limit = "LIMIT" ) InteropLibrary interop ,
1696
1711
@ Cached LookupProxyKlassNode lookupProxyKlassNode ,
1697
1712
@ Cached ProxyInstantiateNode proxyInstantiateNode ,
@@ -1706,7 +1721,7 @@ StaticObject doForeignInterface(Object value,
1706
1721
} catch (UnsupportedMessageException e ) {
1707
1722
// no meta object, fall through to throw unsupported type
1708
1723
}
1709
- errorProfile .enter (this );
1724
+ errorProfile .enter (node );
1710
1725
throw unsupportedType (value , targetType .getRawType ());
1711
1726
}
1712
1727
}
@@ -1756,6 +1771,7 @@ public StaticObject doEspresso(StaticObject value,
1756
1771
"isHostObject(getContext(), value)"
1757
1772
})
1758
1773
StaticObject doForeignConverter (Object value ,
1774
+ @ Bind Node node ,
1759
1775
@ Shared ("value" ) @ CachedLibrary (limit = "LIMIT" ) InteropLibrary interop ,
1760
1776
@ Cached LookupTypeConverterNode lookupTypeConverterNode ,
1761
1777
@ Cached InstanceOf .Dynamic instanceOf ,
@@ -1785,7 +1801,7 @@ StaticObject doForeignConverter(Object value,
1785
1801
} catch (UnsupportedMessageException e ) {
1786
1802
// no meta object, fall through to throw unsupported type
1787
1803
}
1788
- errorProfile .enter (this );
1804
+ errorProfile .enter (node );
1789
1805
throw ToEspressoNode .unsupportedType (value , targetType .getRawType ());
1790
1806
}
1791
1807
}
0 commit comments