@@ -1998,6 +1998,188 @@ protected Object getMetaQualifiedName(Object metaObject,
1998
1998
}
1999
1999
// endregion
2000
2000
2001
+ // region Hash entries
2002
+ @ CoreMethod (names = "has_hash_entries?" , onSingleton = true , required = 1 )
2003
+ public abstract static class HasHashEntriesNode extends InteropCoreMethodArrayArgumentsNode {
2004
+ @ Specialization (limit = "getCacheLimit()" )
2005
+ protected boolean hasHashEntriesNode (Object receiver ,
2006
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ) {
2007
+ return interop .hasHashEntries (receiver );
2008
+ }
2009
+ }
2010
+
2011
+
2012
+ @ CoreMethod (names = "hash_entries_iterator" , onSingleton = true , required = 1 )
2013
+ public abstract static class HashEntriesIteratorNode extends InteropCoreMethodArrayArgumentsNode {
2014
+ @ Specialization (limit = "getCacheLimit()" )
2015
+ protected Object hashEntriesIterator (Object receiver ,
2016
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ,
2017
+ @ Cached TranslateInteropExceptionNode translateInteropException ) {
2018
+ try {
2019
+ return interop .getHashEntriesIterator (receiver );
2020
+ } catch (UnsupportedMessageException e ) {
2021
+ throw translateInteropException .execute (e );
2022
+ }
2023
+ }
2024
+ }
2025
+
2026
+ @ CoreMethod (names = "hash_entry_existing?" , onSingleton = true , required = 2 )
2027
+ public abstract static class HashEntryExistingNode extends InteropCoreMethodArrayArgumentsNode {
2028
+ @ Specialization (limit = "getCacheLimit()" )
2029
+ protected boolean hashEntryExisting (Object receiver , Object key ,
2030
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ) {
2031
+ return interop .isHashEntryExisting (receiver , key );
2032
+ }
2033
+ }
2034
+
2035
+ @ CoreMethod (names = "hash_entry_insertable?" , onSingleton = true , required = 2 )
2036
+ public abstract static class HashEntryInsertableNode extends InteropCoreMethodArrayArgumentsNode {
2037
+ @ Specialization (limit = "getCacheLimit()" )
2038
+ protected boolean hashEntryInsertable (Object receiver , Object key ,
2039
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ) {
2040
+ return interop .isHashEntryInsertable (receiver , key );
2041
+ }
2042
+ }
2043
+
2044
+ @ CoreMethod (names = "hash_entry_modifiable?" , onSingleton = true , required = 2 )
2045
+ public abstract static class HashEntryModifiableNode extends InteropCoreMethodArrayArgumentsNode {
2046
+ @ Specialization (limit = "getCacheLimit()" )
2047
+ protected boolean hashEntryModifiable (Object receiver , Object key ,
2048
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ) {
2049
+ return interop .isHashEntryModifiable (receiver , key );
2050
+ }
2051
+ }
2052
+
2053
+ @ CoreMethod (names = "hash_entry_readable?" , onSingleton = true , required = 2 )
2054
+ public abstract static class HashEntryReadableNode extends InteropCoreMethodArrayArgumentsNode {
2055
+ @ Specialization (limit = "getCacheLimit()" )
2056
+ protected boolean hashEntryReadable (Object receiver , Object key ,
2057
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ) {
2058
+ return interop .isHashEntryReadable (receiver , key );
2059
+ }
2060
+ }
2061
+
2062
+ @ CoreMethod (names = "hash_entry_removable?" , onSingleton = true , required = 2 )
2063
+ public abstract static class HashEntryRemovableNode extends InteropCoreMethodArrayArgumentsNode {
2064
+ @ Specialization (limit = "getCacheLimit()" )
2065
+ protected boolean hashEntryRemovable (Object receiver , Object key ,
2066
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ) {
2067
+ return interop .isHashEntryRemovable (receiver , key );
2068
+ }
2069
+ }
2070
+
2071
+
2072
+ @ CoreMethod (names = "hash_entry_writable?" , onSingleton = true , required = 2 )
2073
+ public abstract static class HashEntryWritableNode extends InteropCoreMethodArrayArgumentsNode {
2074
+ @ Specialization (limit = "getCacheLimit()" )
2075
+ protected boolean hashEntryWritable (Object receiver , Object key ,
2076
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ) {
2077
+ return interop .isHashEntryWritable (receiver , key );
2078
+ }
2079
+ }
2080
+
2081
+ @ CoreMethod (names = "hash_keys_iterator" , onSingleton = true , required = 1 )
2082
+ public abstract static class HashKeysIteratorNode extends InteropCoreMethodArrayArgumentsNode {
2083
+ @ Specialization (limit = "getCacheLimit()" )
2084
+ protected Object hashKeysIterator (Object receiver ,
2085
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ,
2086
+ @ Cached TranslateInteropExceptionNode translateInteropException ) {
2087
+ try {
2088
+ return interop .getHashKeysIterator (receiver );
2089
+ } catch (UnsupportedMessageException e ) {
2090
+ throw translateInteropException .execute (e );
2091
+ }
2092
+ }
2093
+ }
2094
+
2095
+ @ CoreMethod (names = "hash_size" , onSingleton = true , required = 1 )
2096
+ public abstract static class HashSizeNode extends InteropCoreMethodArrayArgumentsNode {
2097
+ @ Specialization (limit = "getCacheLimit()" )
2098
+ protected long hashSize (Object receiver ,
2099
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ,
2100
+ @ Cached TranslateInteropExceptionNode translateInteropException ) {
2101
+ try {
2102
+ return interop .getHashSize (receiver );
2103
+ } catch (UnsupportedMessageException e ) {
2104
+ throw translateInteropException .execute (e );
2105
+ }
2106
+ }
2107
+ }
2108
+
2109
+ @ CoreMethod (names = "hash_values_iterator" , onSingleton = true , required = 1 )
2110
+ public abstract static class HashValuesIteratorNode extends InteropCoreMethodArrayArgumentsNode {
2111
+ @ Specialization (limit = "getCacheLimit()" )
2112
+ protected Object hashValuesIterator (Object receiver ,
2113
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ,
2114
+ @ Cached TranslateInteropExceptionNode translateInteropException ) {
2115
+ try {
2116
+ return interop .getHashValuesIterator (receiver );
2117
+ } catch (UnsupportedMessageException e ) {
2118
+ throw translateInteropException .execute (e );
2119
+ }
2120
+ }
2121
+ }
2122
+
2123
+
2124
+ @ CoreMethod (names = "read_hash_value" , onSingleton = true , required = 2 )
2125
+ public abstract static class ReadHashValueNode extends InteropCoreMethodArrayArgumentsNode {
2126
+ @ Specialization (limit = "getCacheLimit()" )
2127
+ protected Object readHashValue (Object receiver , Object key ,
2128
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ,
2129
+ @ Cached TranslateInteropExceptionNode translateInteropException ) {
2130
+ try {
2131
+ return interop .readHashValue (receiver , key );
2132
+ } catch (InteropException e ) {
2133
+ throw translateInteropException .execute (e );
2134
+ }
2135
+ }
2136
+ }
2137
+
2138
+ @ CoreMethod (names = "read_hash_value_or_default" , onSingleton = true , required = 3 )
2139
+ public abstract static class ReadHashValueOrDefaultNode extends InteropCoreMethodArrayArgumentsNode {
2140
+ @ Specialization (limit = "getCacheLimit()" )
2141
+ protected Object readHashValueOrDefault (Object receiver , Object key , Object defaultValue ,
2142
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ,
2143
+ @ Cached TranslateInteropExceptionNode translateInteropException ) {
2144
+ try {
2145
+ return interop .readHashValueOrDefault (receiver , key , defaultValue );
2146
+ } catch (UnsupportedMessageException e ) {
2147
+ throw translateInteropException .execute (e );
2148
+ }
2149
+ }
2150
+ }
2151
+
2152
+ @ CoreMethod (names = "remove_hash_entry" , onSingleton = true , required = 2 )
2153
+ public abstract static class RemoveHashEntryNode extends InteropCoreMethodArrayArgumentsNode {
2154
+ @ Specialization (limit = "getCacheLimit()" )
2155
+ protected Object removeHashEntry (Object receiver , Object key ,
2156
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ,
2157
+ @ Cached TranslateInteropExceptionNode translateInteropException ) {
2158
+ try {
2159
+ interop .removeHashEntry (receiver , key );
2160
+ return nil ;
2161
+ } catch (InteropException e ) {
2162
+ throw translateInteropException .execute (e );
2163
+ }
2164
+ }
2165
+ }
2166
+
2167
+ @ CoreMethod (names = "write_hash_entry" , onSingleton = true , required = 3 )
2168
+ public abstract static class WriteHashEntryNode extends InteropCoreMethodArrayArgumentsNode {
2169
+ @ Specialization (limit = "getCacheLimit()" )
2170
+ protected Object writeHashEntry (Object receiver , Object key , Object value ,
2171
+ @ CachedLibrary ("receiver" ) InteropLibrary interop ,
2172
+ @ Cached TranslateInteropExceptionNode translateInteropException ) {
2173
+ try {
2174
+ interop .writeHashEntry (receiver , key , value );
2175
+ return value ;
2176
+ } catch (InteropException e ) {
2177
+ throw translateInteropException .execute (e );
2178
+ }
2179
+ }
2180
+ }
2181
+ // endregion
2182
+
2001
2183
// region Identity
2002
2184
@ CoreMethod (names = "identical?" , onSingleton = true , required = 2 )
2003
2185
public abstract static class IsIdenticalNode extends InteropCoreMethodArrayArgumentsNode {
0 commit comments