Index: src/runtime/runtime-test.cc |
diff --git a/src/runtime/runtime-test.cc b/src/runtime/runtime-test.cc |
index 7054192a0f688aae0ece10d2c114aaa15dcdf802..199c423971195f571103b52cfb7813eebcdb36ae 100644 |
--- a/src/runtime/runtime-test.cc |
+++ b/src/runtime/runtime-test.cc |
@@ -736,15 +736,18 @@ RUNTIME_FUNCTION(Runtime_SpeciesProtector) { |
return isolate->heap()->ToBoolean(isolate->IsArraySpeciesLookupChainIntact()); |
} |
+#define CONVERT_ARG_HANDLE_CHECKED_2(Type, name, index) \ |
+ CHECK(Type::Is##Type(args[index])); \ |
+ Handle<Type> name = args.at<Type>(index); |
+ |
// Take a compiled wasm module, serialize it and copy the buffer into an array |
// buffer, which is then returned. |
RUNTIME_FUNCTION(Runtime_SerializeWasmModule) { |
HandleScope shs(isolate); |
DCHECK(args.length() == 1); |
- CONVERT_ARG_HANDLE_CHECKED(JSObject, module_obj, 0); |
+ CONVERT_ARG_HANDLE_CHECKED_2(WasmModuleObject, module_obj, 0); |
- Handle<FixedArray> orig = |
- handle(FixedArray::cast(module_obj->GetInternalField(0))); |
+ Handle<WasmCompiledModule> orig = handle(module_obj->get_compiled_module()); |
std::unique_ptr<ScriptData> data = |
WasmCompiledModuleSerializer::SerializeWasmModule(isolate, orig); |
void* buff = isolate->array_buffer_allocator()->Allocate(data->length()); |
@@ -794,7 +797,7 @@ RUNTIME_FUNCTION(Runtime_DeserializeWasmModule) { |
RUNTIME_FUNCTION(Runtime_ValidateWasmInstancesChain) { |
HandleScope shs(isolate); |
DCHECK(args.length() == 2); |
- CONVERT_ARG_HANDLE_CHECKED(JSObject, module_obj, 0); |
+ CONVERT_ARG_HANDLE_CHECKED_2(WasmModuleObject, module_obj, 0); |
CONVERT_ARG_HANDLE_CHECKED(Smi, instance_count, 1); |
wasm::testing::ValidateInstancesChain(isolate, module_obj, |
instance_count->value()); |
@@ -804,7 +807,7 @@ RUNTIME_FUNCTION(Runtime_ValidateWasmInstancesChain) { |
RUNTIME_FUNCTION(Runtime_ValidateWasmModuleState) { |
HandleScope shs(isolate); |
DCHECK(args.length() == 1); |
- CONVERT_ARG_HANDLE_CHECKED(JSObject, module_obj, 0); |
+ CONVERT_ARG_HANDLE_CHECKED_2(WasmModuleObject, module_obj, 0); |
wasm::testing::ValidateModuleState(isolate, module_obj); |
return isolate->heap()->ToBoolean(true); |
} |
@@ -812,8 +815,8 @@ RUNTIME_FUNCTION(Runtime_ValidateWasmModuleState) { |
RUNTIME_FUNCTION(Runtime_ValidateWasmOrphanedInstance) { |
HandleScope shs(isolate); |
DCHECK(args.length() == 1); |
- CONVERT_ARG_HANDLE_CHECKED(JSObject, instance_obj, 0); |
- wasm::testing::ValidateOrphanedInstance(isolate, instance_obj); |
+ CONVERT_ARG_HANDLE_CHECKED_2(WasmInstanceObject, instance, 0); |
+ wasm::testing::ValidateOrphanedInstance(isolate, instance); |
return isolate->heap()->ToBoolean(true); |
} |