Lines Matching defs:table
22 #include "src/wasm/jump-table-assembler.h"
245 // Grow the dispatch table and add a new entry at the end.
258 int WasmTableObject::Grow(Isolate* isolate, Handle<WasmTableObject> table,
260 uint32_t old_size = table->current_length();
265 if (!table->maximum_length().ToUint32(&max_size)) {
276 int old_capacity = table->entries().length();
284 handle(table->entries(), isolate), grow);
285 table->set_entries(*new_store, WriteBarrierMode::UPDATE_WRITE_BARRIER);
287 table->set_current_length(new_size);
289 Handle<FixedArray> dispatch_tables(table->dispatch_tables(), isolate);
293 // that has imported this table.
295 // TODO(titzer): replace the dispatch table with a weak list of all
296 // the instances that import a given table.
312 WasmTableObject::Set(isolate, table, entry, init_value);
318 Handle<WasmTableObject> table,
320 return entry_index < static_cast<uint32_t>(table->current_length());
324 Handle<WasmTableObject> table,
328 !table->instance().IsUndefined()
329 ? WasmInstanceObject::cast(table->instance()).module()
335 return wasm::TypecheckJSObject(isolate, module, entry, table->type(),
340 Handle<WasmTableObject> table,
345 ClearDispatchTables(isolate, table, entry_index); // Degenerate case.
359 UpdateDispatchTables(isolate, *table, entry_index, wasm_function,
362 UpdateDispatchTables(isolate, table, entry_index,
366 UpdateDispatchTables(isolate, table, entry_index,
372 void WasmTableObject::Set(Isolate* isolate, Handle<WasmTableObject> table,
375 DCHECK(IsInBounds(isolate, table, index));
376 DCHECK(IsValidElement(isolate, table, entry));
378 Handle<FixedArray> entries(table->entries(), isolate);
382 switch (table->type().heap_representation()) {
387 SetFunctionTableEntry(isolate, table, entries, entry_index, entry);
398 DCHECK(!table->instance().IsUndefined());
400 DCHECK(WasmInstanceObject::cast(table->instance())
402 ->has_signature(table->type().ref_index()));
403 SetFunctionTableEntry(isolate, table, entries, entry_index, entry);
409 Handle<WasmTableObject> table,
411 Handle<FixedArray> entries(table->entries(), isolate);
413 DCHECK(IsInBounds(isolate, table, index));
424 switch (table->type().heap_representation()) {
440 DCHECK(!table->instance().IsUndefined());
442 DCHECK(WasmInstanceObject::cast(table->instance())
444 ->has_signature(table->type().ref_index()));
449 // {entry} is not a valid entry in the table. It has to be a placeholder
456 // it in the table slot yet.
464 void WasmTableObject::Fill(Isolate* isolate, Handle<WasmTableObject> table,
468 DCHECK_LE(start, table->current_length());
469 DCHECK_LE(count, table->current_length());
470 DCHECK_LE(start + count, table->current_length());
473 WasmTableObject::Set(isolate, table, start + i, entry);
478 WasmTableObject table,
485 // this table.
486 FixedArray dispatch_tables = table.dispatch_tables();
492 // table, which contains a tuple needed by the import wrapper.
528 Handle<WasmTableObject> table,
532 // this table.
533 Handle<FixedArray> dispatch_tables(table->dispatch_tables(), isolate);
550 Isolate* isolate, Handle<WasmTableObject> table, int entry_index,
553 // this table.
554 Handle<FixedArray> dispatch_tables(table->dispatch_tables(), isolate);
615 Handle<WasmTableObject> table,
617 Handle<FixedArray> dispatch_tables(table->dispatch_tables(), isolate);
635 Isolate* isolate, Handle<WasmTableObject> table, int entry_index,
645 table->entries().set(entry_index, *tuple);
649 Isolate* isolate, const WasmModule* module, Handle<WasmTableObject> table,
653 DCHECK(wasm::IsSubtypeOf(table->type(), wasm::kWasmFuncRef, module));
654 DCHECK_LT(entry_index, table->current_length());
657 Handle<Object> element(table->entries().get(entry_index), isolate);
691 IftNativeAllocations(Handle<WasmIndirectFunctionTable> table, uint32_t size)
693 table->set_sig_ids(sig_ids_.data());
694 table->set_targets(targets_.data());
701 void resize(Handle<WasmIndirectFunctionTable> table, uint32_t new_size) {
704 table->managed_native_allocations())
708 table->set_sig_ids(sig_ids_.data());
709 table->set_targets(targets_.data());
721 auto table = Handle<WasmIndirectFunctionTable>::cast(
723 table->set_size(size);
724 table->set_refs(*refs);
726 isolate, IftNativeAllocations::SizeInMemory(size), table, size);
727 table->set_managed_native_allocations(*native_allocations);
729 table->Clear(i);
731 return table;
749 Handle<WasmIndirectFunctionTable> table,
751 uint32_t old_size = table->size();
754 table->set_size(new_size);
756 // Grow table exponentially to guarantee amortized constant allocation and gc
758 Handle<FixedArray> old_refs(table->refs(), isolate);
766 Managed<IftNativeAllocations>::cast(table->managed_native_allocations())
768 ->resize(table, new_capacity);
772 table->set_refs(*new_refs);
774 table->Clear(i);
1082 // The function in the target instance was imported. Use its imports table,
1148 Handle<WasmIndirectFunctionTable> table =
1150 WasmIndirectFunctionTable::Resize(isolate, table, minimum_size);
1502 // Update the dispatch table.