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

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

Issue 2111843002: [wasm] Fix receiver conversion for WASM->JS calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 | test/mjsunit/wasm/import-table.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/wasm-compiler.cc
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
index 5fcfb701482e151cd5ea7d7a621d0a4d795103f1..dfd05d4c1cc8156c05a74476c6da68a9c307eee2 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -2605,9 +2605,12 @@ void WasmGraphBuilder::BuildWasmToJSWrapper(Handle<JSFunction> function,
if (arg_count_before_args) {
args[pos++] = jsgraph()->Int32Constant(wasm_count); // argument count
}
- // JS receiver.
- Handle<Object> global(function->context()->global_object(), isolate);
- args[pos++] = jsgraph()->Constant(global);
+ // Create the receiver constant (either undefined or the global proxy).
+ Handle<Object> receiver(isolate->heap()->undefined_value(), isolate);
+ if (is_sloppy(function->shared()->language_mode())) {
+ receiver = Handle<Object>(function->context()->global_proxy(), isolate);
+ }
+ args[pos++] = jsgraph()->Constant(receiver);
// Convert WASM numbers to JS values.
int param_index = 0;
« no previous file with comments | « no previous file | test/mjsunit/wasm/import-table.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698