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

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

Issue 2360653002: [wasm] FromJS throws a TypeError for I64 values. (Closed)
Patch Set: Created 4 years, 3 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/ffi-error.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 6c50183beeadd533a25f44d1196b153b8cfe5534..4e9c03a711ef34b0ba57394e9c3950ae30f2722b 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -2393,15 +2393,11 @@ Node* WasmGraphBuilder::FromJS(Node* node, Node* context,
break;
}
case wasm::kAstI64:
- // TODO(titzer): JS->i64 has no good solution right now. Using 32 bits.
- num = graph()->NewNode(jsgraph()->machine()->TruncateFloat64ToWord32(),
- num);
- if (jsgraph()->machine()->Is64()) {
- // We cannot change an int32 to an int64 on a 32 bit platform. Instead
- // we will split the parameter node later.
- num = graph()->NewNode(jsgraph()->machine()->ChangeInt32ToInt64(), num);
- }
- break;
+ // Throw a TypeError. The native context is good enough here because we
+ // only throw a TypeError.
+ return BuildCallToRuntime(Runtime::kWasmThrowTypeError, jsgraph(),
+ jsgraph()->isolate()->native_context(), nullptr,
+ 0, effect_, *control_);
case wasm::kAstF32:
num = graph()->NewNode(jsgraph()->machine()->TruncateFloat64ToFloat32(),
num);
« no previous file with comments | « no previous file | test/mjsunit/wasm/ffi-error.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698