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

Unified Diff: test/cctest/wasm/wasm-module-runner.h

Issue 2321443002: [wasm] Call the wasm interpreter from the wasm-code-fuzzer. (Closed)
Patch Set: Address comments 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 | « test/cctest/wasm/test-run-wasm-module.cc ('k') | test/cctest/wasm/wasm-module-runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/wasm-module-runner.h
diff --git a/test/cctest/wasm/wasm-module-runner.h b/test/cctest/wasm/wasm-module-runner.h
new file mode 100644
index 0000000000000000000000000000000000000000..5af466f4dfebbe3e851ae0ec0aeeb48c96ea3b99
--- /dev/null
+++ b/test/cctest/wasm/wasm-module-runner.h
@@ -0,0 +1,54 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_WASM_MODULE_RUNNER_H_
+#define V8_WASM_MODULE_RUNNER_H_
+
+#include "src/handles.h"
+#include "src/isolate.h"
+#include "src/objects.h"
+#include "src/wasm/wasm-interpreter.h"
+#include "src/wasm/wasm-module.h"
+#include "src/wasm/wasm-result.h"
+#include "src/zone.h"
+
+namespace v8 {
+namespace internal {
+namespace wasm {
+namespace testing {
+
+// Decodes the given encoded module.
+const WasmModule* DecodeWasmModuleForTesting(Isolate* isolate, Zone* zone,
+ ErrorThrower& thrower,
+ const byte* module_start,
+ const byte* module_end,
+ ModuleOrigin origin);
+
+// Instantiates a module without any imports and exports.
+const Handle<JSObject> InstantiateModuleForTesting(Isolate* isolate,
+ ErrorThrower& thrower,
+ const WasmModule* module);
+
+int32_t CallWasmFunctionForTesting(Isolate* isolate, Handle<JSObject> instance,
+ ErrorThrower& thrower, const char* name,
+ int argc, Handle<Object> argv[],
+ bool asm_js = false);
+
+// Decode, verify, and run the function labeled "main" in the
+// given encoded module. The module should have no imports.
+int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start,
+ const byte* module_end, bool asm_js = false);
+
+// Interprets the given module, starting at the function specified by
+// {function_index}. The return type of the function has to be int32. The module
+// should not have any imports or exports
+int32_t InterpretWasmModule(Isolate* isolate, ErrorThrower& thrower,
+ const WasmModule* module, int function_index,
+ WasmVal* args);
+} // namespace testing
+} // namespace wasm
+} // namespace internal
+} // namespace v8
+
+#endif // V8_WASM_MODULE_RUNNER_H_
« no previous file with comments | « test/cctest/wasm/test-run-wasm-module.cc ('k') | test/cctest/wasm/wasm-module-runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698