Fix jit_empty_cache, also clear wasm table

This commit is contained in:
Fabian 2018-02-02 12:40:02 -05:00
parent 2f8f8059fb
commit 11bd94dd3e
2 changed files with 9 additions and 3 deletions

View file

@ -1470,6 +1470,13 @@ CPU.prototype.diverged = function () {
CPU.prototype.jit_empty_cache = function()
{
this.wm.exports["_jit_empty_cache"]();
const table = this.wm.imports["env"].table;
for(let i = 0; i < WASM_TABLE_SIZE; i++)
{
table.set(i, null);
}
};
CPU.prototype.call_interrupt_vector = function(interrupt_nr, is_software_int, has_error_code, error_code)

View file

@ -63,10 +63,9 @@ void jit_dirty_cache_small(uint32_t start_addr, uint32_t end_addr)
void jit_empty_cache()
{
assert(false); // XXX: is WASM_TABLE_SIZE correct?
for(uint32_t i = 0; i < WASM_TABLE_SIZE; i++)
for(int32_t i = 0; i < WASM_TABLE_SIZE; i++)
{
group_dirtiness[i]++;
jit_cache_arr[i].start_addr = 0;
}
}