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

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

Issue 2400863003: [wasm] Simd128 types should not be available in asmjs modules. (Closed)
Patch Set: Fix test Created 4 years, 2 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 | « src/compiler/wasm-compiler.h ('k') | src/wasm/ast-decoder.h » ('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 9484e4fcfc3fb92a3814a735c0dadeb9e36a2363..9ff174d3a7d305290ad994617afefb9e14aabdd7 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -206,6 +206,9 @@ class WasmTrapHelper : public ZoneObject {
case wasm::kAstF64:
return jsgraph()->Float64Constant(bit_cast<double>(0xdeadbeefdeadbeef));
break;
+ case wasm::kAstS128:
+ return builder_->CreateS128Value(0xdeadbeef);
+ break;
default:
UNREACHABLE();
return nullptr;
@@ -2295,6 +2298,7 @@ Node* WasmGraphBuilder::ToJS(Node* node, wasm::LocalType type) {
switch (type) {
case wasm::kAstI32:
return BuildChangeInt32ToTagged(node);
+ case wasm::kAstS128:
case wasm::kAstI64:
// Throw a TypeError. The native context is good enough here because we
// only throw a TypeError.
@@ -2457,6 +2461,7 @@ Node* WasmGraphBuilder::FromJS(Node* node, Node* context,
num);
break;
}
+ case wasm::kAstS128:
case wasm::kAstI64:
// Throw a TypeError. The native context is good enough here because we
// only throw a TypeError.
@@ -3024,12 +3029,12 @@ void WasmGraphBuilder::SetSourcePosition(Node* node,
source_position_table_->SetSourcePosition(node, pos);
}
-Node* WasmGraphBuilder::DefaultS128Value() {
+Node* WasmGraphBuilder::CreateS128Value(int32_t value) {
// TODO(gdeepti): Introduce Simd128Constant to common-operator.h and use
// instead of creating a SIMD Value.
return graph()->NewNode(jsgraph()->machine()->CreateInt32x4(),
- Int32Constant(0), Int32Constant(0), Int32Constant(0),
- Int32Constant(0));
+ Int32Constant(value), Int32Constant(value),
+ Int32Constant(value), Int32Constant(value));
}
Node* WasmGraphBuilder::SimdOp(wasm::WasmOpcode opcode,
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/wasm/ast-decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698