| <<<Back 1 day (to 2020/01/28) | Fwd 1 day (to 2020/01/30)>>> | 20200129 |
avih | ator: i'd appreciate direction with the array storage on where to keep the values (array, size, count, etc): 1. change make js_Object hold js_Properties* instead of js_property*, and make that hold the tree, array and array maintenance values. 2. same as 1 but holds the struct directly rather than a pointer. 3/4. js_Object.properties remains as is, but object holds an additional js_UProperties (struct or pointer) which holds the array and maintenance values. | 09:17.37 |
| my current preference is 4 (pointer to the optimized storage). | 09:17.37 |
| there are about 8 walks properties walks outside of jsproperty.c . the walk function is unmodified as it works equally well on a js_Property pointer whether it's at the tree or at the array, but before calling each walk the array has to be scanned too with the same walk function. | 09:20.08 |
| the advantage of approach 1 is that js_Object size remains the same, but it costs 1 extra dereference when accessing the properties. the advantage of 3/4 is that code is mostly added rather than modified, but js_Object size becomes bigger | 09:24.05 |
ator | avih: just make it bigger (inline the struct with the new fields) | 10:34.31 |
| each malloc has its own overhead | 10:34.54 |
avih | ator: additional struct or change properties to the new container struct? | 10:35.01 |
ator | struct js_Object { ....; js_Properties *properties; struct { int n, m; js_ArrayProperty *p; } table; .... } | 10:35.48 |
avih | k, thx | 10:36.22 |
| ator: also, i didn't look too closely, but js_is_array_index uses int rather than uint, i'm pretty sure there are bugs lurking there with big index values | 10:43.29 |
| js_isarrayindex* | 10:43.38 |
| also, should probably use uint32 rather than plain unsigned. though i don't recall a system i know of which uses 16 bits ints | 10:45.08 |
| uint32 also makes it easier to test, you just multiply and if it wraps - it's invalid | 10:46.27 |
| with ints you have to divide for test or else you can get undefined behavior | 10:47.03 |
ator | we divide for the test. don't get me started on mixing signed and unsigned integers in C.... | 11:37.21 |
| if (n >= INT_MAX / 10) | 11:38.35 |
avih | ator: also, the spc says that array ix is < 2^31-1, so array length fits in uint32 without wrapping | 12:29.55 |
| i think it can be made compliant without too much effort, but not now (for me) | 12:30.42 |
| <<<Back 1 day (to 2020/01/28) | Forward 1 day (to 2020/01/30)>>> | |