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

Unified Diff: test/common/wasm/wasm-module-runner.cc

Issue 2405293002: [wasm] Add stack checks to loops. (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
« src/wasm/wasm-module.h ('K') | « test/common/wasm/wasm-module-runner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/common/wasm/wasm-module-runner.cc
diff --git a/test/common/wasm/wasm-module-runner.cc b/test/common/wasm/wasm-module-runner.cc
index 15c3ef433f48ff9d1604c058b31a2aa6da0e4d64..9dc304a61f084c5115a68abf4f141fb3ac2c9533 100644
--- a/test/common/wasm/wasm-module-runner.cc
+++ b/test/common/wasm/wasm-module-runner.cc
@@ -78,17 +78,16 @@ const Handle<JSObject> InstantiateModuleForTesting(Isolate* isolate,
}
const Handle<JSObject> CompileInstantiateWasmModuleForTesting(
- Isolate* isolate, Zone* zone, const byte* module_start,
- const byte* module_end, ModuleOrigin origin) {
- ErrorThrower thrower(isolate, "CompileInstantiateWasmModule");
+ Isolate* isolate, ErrorThrower* thrower, Zone* zone,
+ const byte* module_start, const byte* module_end, ModuleOrigin origin) {
std::unique_ptr<const WasmModule> module(DecodeWasmModuleForTesting(
- isolate, zone, &thrower, module_start, module_end, origin));
+ isolate, zone, thrower, module_start, module_end, origin));
if (module == nullptr) {
- thrower.Error("Wasm module decode failed");
+ thrower->Error("Wasm module decode failed");
return Handle<JSObject>::null();
}
- return InstantiateModuleForTesting(isolate, &thrower, module.get());
+ return InstantiateModuleForTesting(isolate, thrower, module.get());
}
int32_t RunWasmModuleForTesting(Isolate* isolate, Handle<JSObject> instance,
@@ -104,9 +103,9 @@ int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start,
const byte* module_end, ModuleOrigin origin) {
HandleScope scope(isolate);
Zone zone(isolate->allocator());
-
+ ErrorThrower thrower(isolate, "CompileAndRunWasmModule");
Handle<JSObject> instance = CompileInstantiateWasmModuleForTesting(
- isolate, &zone, module_start, module_end, origin);
+ isolate, &thrower, &zone, module_start, module_end, origin);
if (instance.is_null()) {
return -1;
}
@@ -225,6 +224,13 @@ void SetupIsolateForWasmModule(Isolate* isolate) {
isolate->native_context());
}
+MaybeHandle<JSArrayBuffer> GetInstanceMemoryForTesting(
+ Isolate* isolate, Handle<JSObject> instance) {
+ Object* mem = instance->GetInternalField(kWasmMemArrayBuffer);
+ DCHECK(IsWasmObject(*instance));
+ if (mem->IsUndefined(isolate)) return MaybeHandle<JSArrayBuffer>();
+ return Handle<JSArrayBuffer>(JSArrayBuffer::cast(mem));
+}
} // namespace testing
} // namespace wasm
} // namespace internal
« src/wasm/wasm-module.h ('K') | « test/common/wasm/wasm-module-runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698