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

Unified Diff: test/cctest/wasm/wasm-run-utils.h

Issue 2438603003: [wasm] Track in the interpreter if a NaN could have been produced. (Closed)
Patch Set: Fixed nits. 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 | « test/cctest/wasm/test-run-wasm-interpreter.cc ('k') | test/common/wasm/wasm-module-runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/wasm-run-utils.h
diff --git a/test/cctest/wasm/wasm-run-utils.h b/test/cctest/wasm/wasm-run-utils.h
index 9f61c7a19f4a2505ad85e09bc10b4a552ff4485e..4daf57c2cafd372b75d1581e459d820b673874db 100644
--- a/test/cctest/wasm/wasm-run-utils.h
+++ b/test/cctest/wasm/wasm-run-utils.h
@@ -626,7 +626,8 @@ class WasmRunner {
compiled_(false),
signature_(MachineTypeForC<ReturnType>() == MachineType::None() ? 0 : 1,
GetParameterCount(p0, p1, p2, p3), storage_),
- compiler_(&signature_, module) {
+ compiler_(&signature_, module),
+ possible_nondeterminism_(false) {
DCHECK(module);
InitSigStorage(p0, p1, p2, p3);
}
@@ -736,6 +737,7 @@ class WasmRunner {
thread->PushFrame(compiler_.function_, args.start());
if (thread->Run() == WasmInterpreter::FINISHED) {
WasmVal val = thread->GetReturnValue();
+ possible_nondeterminism_ |= thread->PossibleNondeterminism();
return val.to<ReturnType>();
} else if (thread->state() == WasmInterpreter::TRAPPED) {
// TODO(titzer): return the correct trap code
@@ -752,6 +754,7 @@ class WasmRunner {
WasmFunction* function() { return compiler_.function_; }
WasmInterpreter* interpreter() { return compiler_.interpreter_; }
+ bool possible_nondeterminism() { return possible_nondeterminism_; }
protected:
v8::internal::AccountingAllocator allocator_;
@@ -761,6 +764,7 @@ class WasmRunner {
FunctionSig signature_;
WasmFunctionCompiler compiler_;
WasmFunctionWrapper<ReturnType> wrapper_;
+ bool possible_nondeterminism_;
bool interpret() { return compiler_.execution_mode_ == kExecuteInterpreted; }
« no previous file with comments | « test/cctest/wasm/test-run-wasm-interpreter.cc ('k') | test/common/wasm/wasm-module-runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698