Commit 2ae50a34 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by V8 LUCI CQ

[wasm][eh] Fix initial map for W.Exception

Just re-use the error constructor's initial map for the
WebAssembly.Exception constructor, instead of creating a new one.

R=jkummerow@chromium.org

Bug: v8:11992
Change-Id: If1ee53a1e9492c9ab4b59e363b388260ff097cf5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3071211Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#76108}
parent 12b81e8e
......@@ -2638,8 +2638,10 @@ void WasmJs::Install(Isolate* isolate, bool exposed_on_global_object) {
Handle<JSFunction> exception_constructor = InstallConstructorFunc(
isolate, webassembly, "Exception", WebAssemblyException);
SetDummyInstanceTemplate(isolate, exception_constructor);
Handle<Map> exception_map = isolate->factory()->NewMap(
i::JS_ERROR_TYPE, WasmExceptionPackage::kHeaderSize);
Handle<Map> exception_map(isolate->native_context()
->wasm_exception_error_function()
.initial_map(),
isolate);
Handle<JSObject> exception_proto(
JSObject::cast(isolate->native_context()
->wasm_exception_error_function()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment