poorna2152 / nballerina

WebAssembly Backend for the nBallerina compiler
https://ballerina.io/
Apache License 2.0
4 stars 0 forks source link

map representation in wasm #27

Closed poorna2152 closed 2 years ago

poorna2152 commented 2 years ago

Following the nBallerina implementation for representation of maps. Added the field $hash to the $String type. Initialize the $hash field with the value -1 when creating a string. Hash of a string is calculated only once. Use the hash function, https://github.com/google/closure-library/blob/35b3ced07212ca684d68501a2134b0e1178c7771/closure/goog/string/string.js#L1163