1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

AK+Everywhere: Rename String to DeprecatedString

We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
This commit is contained in:
Linus Groh 2022-12-04 18:02:33 +00:00 committed by Andreas Kling
parent f74251606d
commit 6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions

View file

@ -141,7 +141,7 @@ ErrorOr<void, ValidationError> AbstractMachine::validate(Module& module)
InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<ExternValue> externs)
{
if (auto result = validate(const_cast<Module&>(module)); result.is_error())
return InstantiationError { String::formatted("Validation failed: {}", result.error()) };
return InstantiationError { DeprecatedString::formatted("Validation failed: {}", result.error()) };
auto main_module_instance_pointer = make<ModuleInstance>();
auto& main_module_instance = *main_module_instance_pointer;
@ -177,7 +177,7 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
});
auto result = config.execute(interpreter);
if (result.is_trap())
instantiation_result = InstantiationError { String::formatted("Global value construction trapped: {}", result.trap().reason) };
instantiation_result = InstantiationError { DeprecatedString::formatted("Global value construction trapped: {}", result.trap().reason) };
else
global_values.append(result.values().first());
}
@ -204,7 +204,7 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
});
auto result = config.execute(interpreter);
if (result.is_trap()) {
instantiation_result = InstantiationError { String::formatted("Element construction trapped: {}", result.trap().reason) };
instantiation_result = InstantiationError { DeprecatedString::formatted("Element construction trapped: {}", result.trap().reason) };
return IterationDecision::Continue;
}
@ -257,7 +257,7 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
});
auto result = config.execute(interpreter);
if (result.is_trap()) {
instantiation_result = InstantiationError { String::formatted("Element section initialisation trapped: {}", result.trap().reason) };
instantiation_result = InstantiationError { DeprecatedString::formatted("Element section initialisation trapped: {}", result.trap().reason) };
return IterationDecision::Break;
}
auto d = result.values().first().to<i32>();
@ -317,7 +317,7 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
});
auto result = config.execute(interpreter);
if (result.is_trap()) {
instantiation_result = InstantiationError { String::formatted("Data section initialisation trapped: {}", result.trap().reason) };
instantiation_result = InstantiationError { DeprecatedString::formatted("Data section initialisation trapped: {}", result.trap().reason) };
return;
}
size_t offset = 0;
@ -328,7 +328,7 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
return;
if (main_module_instance.memories().size() <= data.index.value()) {
instantiation_result = InstantiationError {
String::formatted("Data segment referenced out-of-bounds memory ({}) of max {} entries",
DeprecatedString::formatted("Data segment referenced out-of-bounds memory ({}) of max {} entries",
data.index.value(), main_module_instance.memories().size())
};
return;
@ -347,7 +347,7 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
if (auto max = instance->type().limits().max(); max.has_value()) {
if (*max * Constants::page_size < data.init.size() + offset) {
instantiation_result = InstantiationError {
String::formatted("Data segment attempted to write to out-of-bounds memory ({}) of max {} bytes",
DeprecatedString::formatted("Data segment attempted to write to out-of-bounds memory ({}) of max {} bytes",
data.init.size() + offset, instance->type().limits().max().value())
};
return;
@ -373,7 +373,7 @@ InstantiationResult AbstractMachine::instantiate(Module const& module, Vector<Ex
auto& functions = main_module_instance.functions();
auto index = section.function().index();
if (functions.size() <= index.value()) {
instantiation_result = InstantiationError { String::formatted("Start section function referenced invalid index {} of max {} entries", index.value(), functions.size()) };
instantiation_result = InstantiationError { DeprecatedString::formatted("Start section function referenced invalid index {} of max {} entries", index.value(), functions.size()) };
return;
}
invoke(functions[index.value()], {});