I got an error (Error: Operand over 16-bits. Got 65536) when rendering many block forms.
Here is my minimum reproduction (it will take some time to finish the reproduction):
https://ember-twiddle.com/91d05c4de485d559df2a316e106fab27
test('Block form', function(assert) {
for (let i = 0; i < 65535; i++) {
this.render(hbs`<div id="test">{{#if true}}Hello{{/if}}</div>`);
}
assert.equal(this.$('#test').text().trim(), 'Hello');
});
I think the error is from glimmer-vm. Is it a bug?
@nightpig yeah it's a bug in glimmer-vm. The operand size in glimmer-vm is 16-bits. That makes sense for things like the size of arguments to a single component, but it's too small for the count of total blocks in a program. We can fix it by using two operand slots for blocks, which would give us 32-bits worth of blocks (billions), which should work. We could also fall back to storing the numbers in constants (which we do for very big numbers) for programs with billions of blocks.
This has been fixed in the following versions given Ember's support policy:
Most helpful comment
This has been fixed in the following versions given Ember's support policy: