|
13 | 13 | #define MAX_VERSIONS 4 |
14 | 14 |
|
15 | 15 | // Maximum number of branch instructions we can track |
16 | | -#define MAX_BRANCHES 100000 |
| 16 | +#define MAX_BRANCHES 250000 |
17 | 17 |
|
18 | 18 | // Registered branch entries |
19 | 19 | branch_t branch_entries[MAX_BRANCHES]; |
@@ -284,7 +284,18 @@ int ctx_diff(const ctx_t* src, const ctx_t* dst) |
284 | 284 |
|
285 | 285 | diff += self_diff; |
286 | 286 |
|
287 | | - // TODO: when we track local types, need to check them too |
| 287 | + // For each local type we track |
| 288 | + for (size_t i = 0; i < MAX_LOCAL_TYPES; ++i) |
| 289 | + { |
| 290 | + val_type_t t_src = src->local_types[i]; |
| 291 | + val_type_t t_dst = dst->local_types[i]; |
| 292 | + int temp_diff = type_diff(t_src, t_dst); |
| 293 | + |
| 294 | + if (temp_diff == INT_MAX) |
| 295 | + return INT_MAX; |
| 296 | + |
| 297 | + diff += temp_diff; |
| 298 | + } |
288 | 299 |
|
289 | 300 | // For each value on the temp stack |
290 | 301 | for (size_t i = 0; i < src->stack_size; ++i) |
@@ -659,7 +670,6 @@ void gen_branch( |
659 | 670 | ) |
660 | 671 | { |
661 | 672 | RUBY_ASSERT(target0.iseq != NULL); |
662 | | - //RUBY_ASSERT(target1.iseq != NULL); |
663 | 673 | RUBY_ASSERT_ALWAYS(num_branches < MAX_BRANCHES); |
664 | 674 | uint32_t branch_idx = num_branches++; |
665 | 675 |
|
@@ -879,7 +889,7 @@ invalidate_block_version(block_t* block) |
879 | 889 |
|
880 | 890 | // For each incoming branch |
881 | 891 | uint32_t* branch_idx; |
882 | | - rb_darray_foreach(block->incoming, i, branch_idx) |
| 892 | + rb_darray_foreach(block->incoming, incoming_idx, branch_idx) |
883 | 893 | { |
884 | 894 | //uint32_t branch_idx = block->incoming[i]; |
885 | 895 | branch_t* branch = &branch_entries[*branch_idx]; |
|
0 commit comments