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

Unified Diff: src/wasm/ast-decoder.cc

Issue 2423883003: [wasm] add atomic opcodes (Closed)
Patch Set: [wasm] add atomic opcodes 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/flag-definitions.h ('k') | src/wasm/wasm-opcodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/ast-decoder.cc
diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc
index ff5211d8fb80dbc2729193db331fd873fb7180fb..ea7ddcf52813b5f2b6dcdfd0c2a56403b3ab7c13 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -1158,6 +1158,24 @@ class WasmFullDecoder : public WasmDecoder {
len += DecodeSimdOpcode(opcode);
break;
}
+ case kAtomicPrefix: {
+ if (!module_ || module_->origin != kAsmJsOrigin) {
+ error("Atomics are allowed only in AsmJs modules");
+ break;
+ }
+ if (!FLAG_wasm_atomics_prototype) {
+ error("Invalid opcode (enable with --wasm_atomics_prototype)");
+ break;
+ }
+ len = 2;
+ byte atomic_opcode = checked_read_u8(pc_, 1, "atomic index");
+ opcode = static_cast<WasmOpcode>(opcode << 8 | atomic_opcode);
+ sig = WasmOpcodes::AtomicSignature(opcode);
+ if (sig) {
+ BuildAtomicOperator(opcode);
+ }
+ break;
+ }
default: {
// Deal with special asmjs opcodes.
if (module_ && module_->origin == kAsmJsOrigin) {
@@ -1340,6 +1358,8 @@ class WasmFullDecoder : public WasmDecoder {
return len;
}
+ void BuildAtomicOperator(WasmOpcode opcode) { UNIMPLEMENTED(); }
+
void DoReturn() {
int count = static_cast<int>(sig_->return_count());
TFNode** buffer = nullptr;
« no previous file with comments | « src/flag-definitions.h ('k') | src/wasm/wasm-opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698