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

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: 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
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..0599a40dafbfe4b81f69c3bd8edff7c630f797a0 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),
+ may_produced_nan_(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();
+ may_produced_nan_ |= thread->MayProducedNaN();
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 may_produced_nan() { return may_produced_nan_; }
protected:
v8::internal::AccountingAllocator allocator_;
@@ -761,6 +764,7 @@ class WasmRunner {
FunctionSig signature_;
WasmFunctionCompiler compiler_;
WasmFunctionWrapper<ReturnType> wrapper_;
+ bool may_produced_nan_;
bool interpret() { return compiler_.execution_mode_ == kExecuteInterpreted; }

Powered by Google App Engine
This is Rietveld 408576698