@@ -1857,9 +1857,16 @@ public StaticObject doEspressoException(EspressoException value) {
1857
1857
"interop.isException(value)" ,
1858
1858
"!isEspressoException(value)"
1859
1859
})
1860
- StaticObject doforeign (Object value ,
1860
+ StaticObject doForeign (Object value ,
1861
1861
@ CachedLibrary (limit = "LIMIT" ) InteropLibrary interop ,
1862
- @ Bind ("getContext()" ) EspressoContext context ) {
1862
+ @ Cached LookupTypeConverterNode lookupTypeConverterNode ,
1863
+ @ Cached LookupInternalTypeConverterNode lookupInternalTypeConverterNode ,
1864
+ @ Cached ToReference .DynamicToReference converterToEspresso ,
1865
+ @ Bind ("getContext()" ) EspressoContext context ) throws UnsupportedTypeException {
1866
+ StaticObject result = ToReference .tryConverterForUnknownTarget (value , interop , lookupTypeConverterNode , lookupInternalTypeConverterNode , converterToEspresso , context .getMeta ());
1867
+ if (result != null ) {
1868
+ return result ;
1869
+ }
1863
1870
return StaticObject .createForeignException (context , value , interop );
1864
1871
}
1865
1872
@@ -1908,9 +1915,16 @@ public StaticObject doEspressoException(EspressoException value, @Bind("getMeta(
1908
1915
"interop.isException(value)" ,
1909
1916
"!isEspressoException(value)"
1910
1917
})
1911
- StaticObject doforeign (Object value ,
1918
+ StaticObject doForeign (Object value ,
1912
1919
@ CachedLibrary (limit = "LIMIT" ) InteropLibrary interop ,
1913
- @ Bind ("getContext()" ) EspressoContext context ) {
1920
+ @ Cached LookupTypeConverterNode lookupTypeConverterNode ,
1921
+ @ Cached LookupInternalTypeConverterNode lookupInternalTypeConverterNode ,
1922
+ @ Cached ToReference .DynamicToReference converterToEspresso ,
1923
+ @ Bind ("getContext()" ) EspressoContext context ) throws UnsupportedTypeException {
1924
+ StaticObject result = ToReference .tryConverterForUnknownTarget (value , interop , lookupTypeConverterNode , lookupInternalTypeConverterNode , converterToEspresso , context .getMeta ());
1925
+ if (result != null ) {
1926
+ return result ;
1927
+ }
1914
1928
return StaticObject .createForeignException (context , value , interop );
1915
1929
}
1916
1930
@@ -1959,9 +1973,16 @@ public StaticObject doEspressoException(EspressoException value, @Bind("getMeta(
1959
1973
"interop.isException(value)" ,
1960
1974
"!isEspressoException(value)"
1961
1975
})
1962
- StaticObject doforeign (Object value ,
1976
+ StaticObject doForeign (Object value ,
1963
1977
@ CachedLibrary (limit = "LIMIT" ) InteropLibrary interop ,
1964
- @ Bind ("getContext()" ) EspressoContext context ) {
1978
+ @ Bind ("getContext()" ) EspressoContext context ,
1979
+ @ Cached LookupTypeConverterNode lookupTypeConverterNode ,
1980
+ @ Cached LookupInternalTypeConverterNode lookupInternalTypeConverterNode ,
1981
+ @ Cached ToReference .DynamicToReference converterToEspresso ) throws UnsupportedTypeException {
1982
+ StaticObject result = ToReference .tryConverterForUnknownTarget (value , interop , lookupTypeConverterNode , lookupInternalTypeConverterNode , converterToEspresso , context .getMeta ());
1983
+ if (result != null ) {
1984
+ return result ;
1985
+ }
1965
1986
return StaticObject .createForeignException (context , value , interop );
1966
1987
}
1967
1988
0 commit comments