Commit fa93a68
committed
Implement
When accessing an object ivars, it's not rare to access the same
object's ivar quickly after.
For instance from enumerator.c:
```c
enumerator = rb_obj_alloc(rb_cEnumerator);
rb_ivar_set(enumerator, id_sliceafter_enum, enumerable);
rb_ivar_set(enumerator, id_sliceafter_pat, pat);
rb_ivar_set(enumerator, id_sliceafter_pred, pred);
```
If we keep a cache of the last IMEMO/fields we interacted with,
we can save having to lookup the `gen_fields_tbl`, synchronize
the VM lock, etc.gen_fields_tbl cache1 parent fccd96c commit fa93a68
3 files changed
Lines changed: 44 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1238 | 1238 | | |
1239 | 1239 | | |
1240 | 1240 | | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
1244 | 1254 | | |
1245 | 1255 | | |
1246 | 1256 | | |
| |||
1261 | 1271 | | |
1262 | 1272 | | |
1263 | 1273 | | |
1264 | | - | |
1265 | | - | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
1266 | 1283 | | |
1267 | 1284 | | |
1268 | 1285 | | |
| |||
1286 | 1303 | | |
1287 | 1304 | | |
1288 | 1305 | | |
1289 | | - | |
1290 | | - | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
1291 | 1317 | | |
1292 | | - | |
1293 | 1318 | | |
1294 | 1319 | | |
1295 | 1320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3441 | 3441 | | |
3442 | 3442 | | |
3443 | 3443 | | |
| 3444 | + | |
| 3445 | + | |
| 3446 | + | |
3444 | 3447 | | |
3445 | 3448 | | |
3446 | 3449 | | |
| |||
3505 | 3508 | | |
3506 | 3509 | | |
3507 | 3510 | | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
3508 | 3514 | | |
3509 | 3515 | | |
3510 | 3516 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1070 | 1070 | | |
1071 | 1071 | | |
1072 | 1072 | | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
1073 | 1078 | | |
1074 | 1079 | | |
1075 | 1080 | | |
| |||
0 commit comments