Commit b8b08347 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

Revert "[wasm] Make an "incumbent context" available for module instantiation"

This reverts commit 8ba517e1.

Reason for revert: causing Chromium test failures on external/wpt/wasm/jsapi/functions/entry-different-function-realm.html, e.g. here: https://ci.chromium.org/p/v8/builders/ci/V8%20Blink%20Mac/3045

Original change's description:
> [wasm] Make an "incumbent context" available for module instantiation
> 
> A Wasm module's start function might be imported from JavaScript, and
> as such might contain calls to Blink. For such a case, we must make
> sure that an "incumbent context" is available.
> See microtask queue handling for a similar example.
> 
> Bug: chromium:1096558
> Change-Id: I2e3c0fc20d4e3581e490822c3ac63ce2c5e1e990
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2284982
> Reviewed-by: Toon Verwaest <verwaest@chromium.org>
> Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#68760}

TBR=jkummerow@chromium.org,verwaest@chromium.org

Change-Id: Ib36d2198cf686f561a2a64034faf0479686f3500
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1096558
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2290853Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68775}
parent b17c8b17
......@@ -4,7 +4,6 @@
#include "src/wasm/module-instantiate.h"
#include "src/api/api.h"
#include "src/asmjs/asm-js.h"
#include "src/logging/counters.h"
#include "src/numbers/conversions-inl.h"
......@@ -642,15 +641,10 @@ bool InstanceBuilder::ExecuteStartFunction() {
if (start_function_.is_null()) return true; // No start function.
HandleScope scope(isolate_);
// We have to make sure that an "incumbent context" is available in case
// the start function calls out to Blink.
HandleScopeImplementer* hsi = isolate_->handle_scope_implementer();
hsi->EnterContext(isolate_->context());
// Call the JS function.
Handle<Object> undefined = isolate_->factory()->undefined_value();
MaybeHandle<Object> retval =
Execution::Call(isolate_, start_function_, undefined, 0, nullptr);
hsi->LeaveContext();
if (retval.is_null()) {
DCHECK(isolate_->has_pending_exception());
......
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