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

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

Issue 2637643002: [wasm] Table.Grow should grow dispatch tables (Closed)
Patch Set: Rebase + review Created 3 years, 11 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 | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-js.cc
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc
index f2c630dd4a52f4f6c0a9376811f9d0da9251e28e..69ee0813ea7367d6a828664838d12656c538b555 100644
--- a/src/wasm/wasm-js.cc
+++ b/src/wasm/wasm-js.cc
@@ -546,7 +546,10 @@ void WebAssemblyTableGrow(const v8::FunctionCallbackInfo<v8::Value>& args) {
isolate->ThrowException(e);
return;
}
+
int new_size = static_cast<int>(new_size64);
+ i::WasmTableObject::Grow(i_isolate, receiver,
+ static_cast<uint32_t>(new_size - old_size));
if (new_size != old_size) {
i::Handle<i::FixedArray> new_array =
@@ -557,7 +560,9 @@ void WebAssemblyTableGrow(const v8::FunctionCallbackInfo<v8::Value>& args) {
receiver->set_functions(*new_array);
}
- // TODO(titzer): update relevant instances.
+ // TODO(gdeepti): use weak links for instances
+ v8::ReturnValue<v8::Value> return_value = args.GetReturnValue();
+ return_value.Set(old_size);
}
void WebAssemblyTableGet(const v8::FunctionCallbackInfo<v8::Value>& args) {
« no previous file with comments | « no previous file | src/wasm/wasm-module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698