1.1 --- a/templates/native.c Fri Dec 02 18:31:20 2016 +0100
1.2 +++ b/templates/native.c Fri Dec 02 21:16:06 2016 +0100
1.3 @@ -515,12 +515,30 @@
1.4 return attr;
1.5 }
1.6
1.7 +__attr __fn_native__dict_items(__attr __args[])
1.8 +{
1.9 + __attr * const _data = &__args[1];
1.10 + /* _data interpreted as dict */
1.11 + __mapping *data = _data->mapvalue;
1.12 +
1.13 + return __new_int(data->size);
1.14 +}
1.15 +
1.16 +__attr __fn_native__dict_buckets(__attr __args[])
1.17 +{
1.18 + __attr * const _data = &__args[1];
1.19 + /* _data interpreted as dict */
1.20 + __mapping *data = _data->mapvalue;
1.21 +
1.22 + return __new_int(data->capacity);
1.23 +}
1.24 +
1.25 __attr __fn_native__dict_bucketsize(__attr __args[])
1.26 {
1.27 - __attr * const self = &__args[1];
1.28 + __attr * const _data = &__args[1];
1.29 __attr * const index = &__args[2];
1.30 - /* self.__data__ interpreted as dict */
1.31 - __mapping *data = __load_via_object(self->value, __pos___data__).mapvalue;
1.32 + /* _data interpreted as dict */
1.33 + __mapping *data = _data->mapvalue;
1.34 /* index.__data__ interpreted as int */
1.35 int k = __load_via_object(index->value, __pos___data__).intvalue % data->capacity;
1.36
1.37 @@ -530,9 +548,9 @@
1.38
1.39 __attr __fn_native__dict_keys(__attr __args[])
1.40 {
1.41 - __attr * const self = &__args[1];
1.42 - /* self.__data__ interpreted as dict */
1.43 - __mapping *data = __load_via_object(self->value, __pos___data__).mapvalue;
1.44 + __attr * const _data = &__args[1];
1.45 + /* _data interpreted as dict */
1.46 + __mapping *data = _data->mapvalue;
1.47 unsigned int k, i, j, size = 0;
1.48 __fragment *f;
1.49
1.50 @@ -555,9 +573,9 @@
1.51
1.52 __attr __fn_native__dict_values(__attr __args[])
1.53 {
1.54 - __attr * const self = &__args[1];
1.55 - /* self.__data__ interpreted as dict */
1.56 - __mapping *data = __load_via_object(self->value, __pos___data__).mapvalue;
1.57 + __attr * const _data = &__args[1];
1.58 + /* _data interpreted as dict */
1.59 + __mapping *data = _data->mapvalue;
1.60 unsigned int k, i, j, size = 0;
1.61 __fragment *f;
1.62
1.63 @@ -580,11 +598,11 @@
1.64
1.65 __attr __fn_native__dict_key(__attr __args[])
1.66 {
1.67 - __attr * const self = &__args[1];
1.68 + __attr * const _data = &__args[1];
1.69 __attr * const index = &__args[2];
1.70 __attr * const element = &__args[3];
1.71 - /* self.__data__ interpreted as dict */
1.72 - __mapping *data = __load_via_object(self->value, __pos___data__).mapvalue;
1.73 + /* _data interpreted as dict */
1.74 + __mapping *data = _data->mapvalue;
1.75 /* index.__data__ interpreted as int */
1.76 int k = __load_via_object(index->value, __pos___data__).intvalue % data->capacity;
1.77 /* element.__data__ interpreted as int */
1.78 @@ -596,11 +614,11 @@
1.79
1.80 __attr __fn_native__dict_value(__attr __args[])
1.81 {
1.82 - __attr * const self = &__args[1];
1.83 + __attr * const _data = &__args[1];
1.84 __attr * const index = &__args[2];
1.85 __attr * const element = &__args[3];
1.86 - /* self.__data__ interpreted as dict */
1.87 - __mapping *data = __load_via_object(self->value, __pos___data__).mapvalue;
1.88 + /* _data interpreted as dict */
1.89 + __mapping *data = _data->mapvalue;
1.90 /* index.__data__ interpreted as int */
1.91 int k = __load_via_object(index->value, __pos___data__).intvalue % data->capacity;
1.92 /* element.__data__ interpreted as int */
1.93 @@ -612,12 +630,12 @@
1.94
1.95 __attr __fn_native__dict_additem(__attr __args[])
1.96 {
1.97 - __attr * const self = &__args[1];
1.98 + __attr * const _data = &__args[1];
1.99 __attr * const index = &__args[2];
1.100 __attr * const key = &__args[3];
1.101 __attr * const value = &__args[4];
1.102 - /* self.__data__ interpreted as dict */
1.103 - __mapping *data = __load_via_object(self->value, __pos___data__).mapvalue;
1.104 + /* _data interpreted as dict */
1.105 + __mapping *data = _data->mapvalue;
1.106 /* index.__data__ interpreted as int */
1.107 int k = __load_via_object(index->value, __pos___data__).intvalue % data->capacity;
1.108 unsigned int size = data->size;
1.109 @@ -640,13 +658,13 @@
1.110
1.111 __attr __fn_native__dict_setitem(__attr __args[])
1.112 {
1.113 - __attr * const self = &__args[1];
1.114 + __attr * const _data = &__args[1];
1.115 __attr * const index = &__args[2];
1.116 __attr * const element = &__args[3];
1.117 __attr * const key = &__args[4];
1.118 __attr * const value = &__args[5];
1.119 - /* self.__data__ interpreted as dict */
1.120 - __mapping *data = __load_via_object(self->value, __pos___data__).mapvalue;
1.121 + /* _data interpreted as dict */
1.122 + __mapping *data = _data->mapvalue;
1.123 /* index.__data__ interpreted as int */
1.124 int k = __load_via_object(index->value, __pos___data__).intvalue % data->capacity;
1.125 /* element.__data__ interpreted as int */