Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: src/wasm/wasm-module.cc

Issue 2844163006: [wasm] Move Table.Grow implementation to wasm-objects.cc, cleanup (Closed)
Patch Set: Cleanup Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-module.h ('k') | src/wasm/wasm-objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 44c77462783a2c8bf6e158d5e03c7dcce1879ae1..b7bf3b3b157a369089cad7131111662d8e357101 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -2083,10 +2083,8 @@ class InstantiationHelper {
Handle<FixedArray> all_dispatch_tables;
if (!table_instance.table_object.is_null()) {
// Get the existing dispatch table(s) with the WebAssembly.Table object.
- all_dispatch_tables = WasmTableObject::AddDispatchTable(
- isolate_, table_instance.table_object,
- Handle<WasmInstanceObject>::null(), index,
- Handle<FixedArray>::null(), Handle<FixedArray>::null());
+ all_dispatch_tables =
+ handle(table_instance.table_object->dispatch_tables());
}
// Count the number of table exports for each function (needed for lazy
@@ -2224,37 +2222,6 @@ void wasm::DetachWebAssemblyMemoryBuffer(Isolate* isolate,
}
}
-void wasm::GrowDispatchTables(Isolate* isolate,
- Handle<FixedArray> dispatch_tables,
- uint32_t old_size, uint32_t count) {
- DCHECK_EQ(0, dispatch_tables->length() % 4);
-
- Zone specialization_zone(isolate->allocator(), ZONE_NAME);
- for (int i = 0; i < dispatch_tables->length(); i += 4) {
- Handle<FixedArray> old_function_table(
- FixedArray::cast(dispatch_tables->get(i + 2)));
- Handle<FixedArray> old_signature_table(
- FixedArray::cast(dispatch_tables->get(i + 3)));
- Handle<FixedArray> new_function_table =
- isolate->factory()->CopyFixedArrayAndGrow(old_function_table, count);
- Handle<FixedArray> new_signature_table =
- isolate->factory()->CopyFixedArrayAndGrow(old_signature_table, count);
-
- // Update dispatch tables with new function/signature tables
- dispatch_tables->set(i + 2, *new_function_table);
- dispatch_tables->set(i + 3, *new_signature_table);
-
- // Patch the code of the respective instance.
- CodeSpecialization code_specialization(isolate, &specialization_zone);
- code_specialization.PatchTableSize(old_size, old_size + count);
- code_specialization.RelocateObject(old_function_table, new_function_table);
- code_specialization.RelocateObject(old_signature_table,
- new_signature_table);
- code_specialization.ApplyToWholeInstance(
- WasmInstanceObject::cast(dispatch_tables->get(i)));
- }
-}
-
void testing::ValidateInstancesChain(Isolate* isolate,
Handle<WasmModuleObject> module_obj,
int instance_count) {
« no previous file with comments | « src/wasm/wasm-module.h ('k') | src/wasm/wasm-objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698