@@ -1570,6 +1570,70 @@ module StdIntMap = struct
15701570 )
15711571end
15721572
1573+ module StdInt64Map = struct
1574+ let this vthis = match vthis with
1575+ | VInstance {ikind = IInt64Map h } -> h
1576+ | v -> unexpected_value v " int64 map"
1577+
1578+ let copy = vifun0 (fun vthis ->
1579+ let copied = RuntimeInt64Hashtbl. copy (this vthis) in
1580+ encode_int64_map_direct copied
1581+ )
1582+
1583+ let exists = vifun1 (fun vthis vkey ->
1584+ vbool (RuntimeInt64Hashtbl. mem (this vthis) (EvalIntegers. decode_haxe_i64 vkey))
1585+ )
1586+
1587+ let get = vifun1 (fun vthis vkey ->
1588+ try RuntimeInt64Hashtbl. find (this vthis) (EvalIntegers. decode_haxe_i64 vkey)
1589+ with Not_found -> vnull
1590+ )
1591+
1592+ let iterator = vifun0 (fun vthis ->
1593+ let keys = RuntimeInt64Hashtbl. fold (fun _ v acc -> v :: acc) (this vthis) [] in
1594+ encode_list_iterator keys
1595+ )
1596+
1597+ let keys = vifun0 (fun vthis ->
1598+ let keys = RuntimeInt64Hashtbl. fold (fun k _ acc -> EvalIntegers. encode_haxe_i64_int64 k :: acc) (this vthis) [] in
1599+ encode_list_iterator keys
1600+ )
1601+
1602+ let keyValueIterator = map_key_value_iterator key_haxe_iterators_map_key_value_iterator
1603+
1604+ let remove = vifun1 (fun vthis vkey ->
1605+ let this = this vthis in
1606+ let key = EvalIntegers. decode_haxe_i64 vkey in
1607+ let b = RuntimeInt64Hashtbl. mem this key in
1608+ RuntimeInt64Hashtbl. remove this key;
1609+ vbool b
1610+ )
1611+
1612+ let set = vifun2 (fun vthis vkey vvalue ->
1613+ RuntimeInt64Hashtbl. add (this vthis) (EvalIntegers. decode_haxe_i64 vkey) vvalue;
1614+ vnull
1615+ )
1616+
1617+ let toString = vifun0 (fun vthis ->
1618+ let this = this vthis in
1619+ let l = RuntimeInt64Hashtbl. fold (fun key vvalue acc ->
1620+ (join empty_string [create_ascii (Int64. to_string key); create_ascii " => " ; s_value 0 vvalue]) :: acc) this [] in
1621+ let s = join rcomma l in
1622+ let s = join empty_string [rbkopen;s;rbkclose] in
1623+ vstring s
1624+ )
1625+
1626+ let clear = vifun0 (fun vthis ->
1627+ RuntimeInt64Hashtbl. clear (this vthis);
1628+ vnull
1629+ )
1630+
1631+ let size = vifun0 (fun vthis ->
1632+ vint (RuntimeInt64Hashtbl. size (this vthis))
1633+ )
1634+ end
1635+
1636+
15731637module StdStringMap = struct
15741638 let this vthis = match vthis with
15751639 | VInstance {ikind = IStringMap h } -> h
@@ -3229,6 +3293,19 @@ let init_maps builtins =
32293293 " clear" ,StdIntMap. clear;
32303294 " size" ,StdIntMap. size;
32313295 ];
3296+ init_fields builtins ([" haxe" ;" ds" ]," Int64Map" ) [] [
3297+ " copy" ,StdInt64Map. copy;
3298+ " exists" ,StdInt64Map. exists;
3299+ " get" ,StdInt64Map. get;
3300+ " iterator" ,StdInt64Map. iterator;
3301+ " keys" ,StdInt64Map. keys;
3302+ " keyValueIterator" ,StdInt64Map. keyValueIterator;
3303+ " remove" ,StdInt64Map. remove;
3304+ " set" ,StdInt64Map. set;
3305+ " toString" ,StdInt64Map. toString;
3306+ " clear" ,StdInt64Map. clear;
3307+ " size" ,StdInt64Map. size;
3308+ ];
32323309 init_fields builtins ([" haxe" ;" ds" ]," ObjectMap" ) [] [
32333310 " copy" ,StdObjectMap. copy;
32343311 " exists" ,StdObjectMap. exists;
@@ -3296,6 +3373,7 @@ let init_constructors builtins =
32963373 );
32973374 add key_haxe_ds_StringMap (fun _ -> encode_string_map_direct (RuntimeStringHashtbl. create () ));
32983375 add key_haxe_ds_IntMap (fun _ -> encode_int_map_direct (RuntimeIntHashtbl. create () ));
3376+ add key_haxe_ds_Int64Map (fun _ -> encode_int64_map_direct (RuntimeInt64Hashtbl. create () ));
32993377 add key_haxe_ds_ObjectMap (fun _ -> encode_object_map_direct (Obj. magic (ValueHashtbl. create 0 )));
33003378 add key_haxe_io_BytesBuffer (fun _ -> encode_instance key_haxe_io_BytesBuffer ~kind: (IOutput (Buffer. create 0 )));
33013379 add key_haxe_io_Bytes
@@ -3387,6 +3465,7 @@ let init_empty_constructors builtins =
33873465 IntHashtbl. add h key_String (fun () -> v_empty_string);
33883466 IntHashtbl. add h key_haxe_ds_StringMap (fun () -> encode_instance key_haxe_ds_StringMap ~kind: (IStringMap (RuntimeStringHashtbl. create () )));
33893467 IntHashtbl. add h key_haxe_ds_IntMap (fun () -> encode_instance key_haxe_ds_IntMap ~kind: (IIntMap (RuntimeIntHashtbl. create () )));
3468+ IntHashtbl. add h key_haxe_ds_Int64Map (fun () -> encode_instance key_haxe_ds_Int64Map ~kind: (IInt64Map (RuntimeInt64Hashtbl. create () )));
33903469 IntHashtbl. add h key_haxe_ds_ObjectMap (fun () -> encode_instance key_haxe_ds_ObjectMap ~kind: (IObjectMap (Obj. magic (ValueHashtbl. create 0 ))));
33913470 IntHashtbl. add h key_haxe_io_BytesBuffer (fun () -> encode_instance key_haxe_io_BytesBuffer ~kind: (IOutput (Buffer. create 0 )))
33923471
0 commit comments