Commit c7a8669c authored by Manos Koukoutos's avatar Manos Koukoutos Committed by V8 LUCI CQ

[test] Improve some error messages and comments

Change-Id: I8ac9f04ce8410f8ca81b1436850cd96ce79a3b6d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3122161
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76535}
parent f35bb272
......@@ -28,6 +28,7 @@ Handle<WasmInstanceObject> CompileModule(Zone* zone, Isolate* isolate,
MaybeHandle<WasmInstanceObject> maybe_instance =
CompileAndInstantiateForTesting(
isolate, &thrower, ModuleWireBytes(buffer.begin(), buffer.end()));
CHECK_WITH_MSG(!thrower.error(), thrower.error_msg());
return maybe_instance.ToHandleChecked();
}
......
......@@ -582,8 +582,11 @@ class WasmGenerator {
if (call_direct) {
builder_->EmitWithU32V(kExprReturnCall, func_index);
} else {
// This will not trap because table[func_index] always contains function
// func_index.
builder_->EmitI32Const(func_index);
builder_->EmitWithU32V(kExprReturnCallIndirect, sig_index);
// TODO(11954): Use other table indices too.
builder_->EmitByte(0); // Table index.
}
return;
......@@ -591,8 +594,11 @@ class WasmGenerator {
if (call_direct) {
builder_->EmitWithU32V(kExprCallFunction, func_index);
} else {
// This will not trap because table[func_index] always contains function
// func_index.
builder_->EmitI32Const(func_index);
builder_->EmitWithU32V(kExprCallIndirect, sig_index);
// TODO(11954): Use other table indices too.
builder_->EmitByte(0); // Table index.
}
}
......@@ -1730,7 +1736,7 @@ void WasmGenerator::GenerateOptRef(HeapType type, DataRange* data) {
// default case.
case HeapType::kAny: {
// Weighed according to the types in the module.
// TODO(manoskouk): Generate i31ref.
// TODO(11954): Generate i31ref.
uint32_t num_types = builder_->builder()->NumTypes();
uint8_t random = data->get<uint8_t>() % (num_types + 2);
if (random < num_structs_ + num_arrays_) {
......@@ -1769,7 +1775,7 @@ void WasmGenerator::GenerateOptRef(HeapType type, DataRange* data) {
// Else fall back to the default case outside the switch.
break;
}
// TODO(manoskouk): Add i31ref case.
// TODO(11954): Add i31ref case.
default:
break;
}
......
......@@ -362,7 +362,7 @@ void GenerateTestCase(Isolate* isolate, ModuleWireBytes wire_bytes,
ModuleOrigin::kWasmOrigin, isolate->counters(),
isolate->metrics_recorder(), v8::metrics::Recorder::ContextId::Empty(),
DecodingMethod::kSync, GetWasmEngine()->allocator());
CHECK(module_res.ok());
CHECK_WITH_MSG(module_res.ok(), module_res.error().message().c_str());
WasmModule* module = module_res.value().get();
CHECK_NOT_NULL(module);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment