mirror of
https://github.com/RGBCube/serenity
synced 2025-05-29 12:35:06 +00:00
UserspaceEmulator: Avoid copies of non trivial types on invocations
These include AK::String and X86::Instruction
This commit is contained in:
parent
95d2feed33
commit
c0d6afdc67
2 changed files with 6 additions and 6 deletions
|
@ -70,7 +70,7 @@ Emulator::Emulator(String const& executable_path, Vector<StringView> const& argu
|
|||
setup_signal_trampoline();
|
||||
}
|
||||
|
||||
Vector<ELF::AuxiliaryValue> Emulator::generate_auxiliary_vector(FlatPtr load_base, FlatPtr entry_eip, String executable_path, int executable_fd) const
|
||||
Vector<ELF::AuxiliaryValue> Emulator::generate_auxiliary_vector(FlatPtr load_base, FlatPtr entry_eip, String const& executable_path, int executable_fd) const
|
||||
{
|
||||
// FIXME: This is not fully compatible with the auxiliary vector the kernel generates, this is just the bare
|
||||
// minimum to get the loader going.
|
||||
|
@ -486,7 +486,7 @@ void Emulator::emit_profile_sample(AK::OutputStream& output)
|
|||
output.write_or_error(builder.string_view().bytes());
|
||||
}
|
||||
|
||||
void Emulator::emit_profile_event(AK::OutputStream& output, StringView event_name, String contents)
|
||||
void Emulator::emit_profile_event(AK::OutputStream& output, StringView event_name, String const& contents)
|
||||
{
|
||||
StringBuilder builder;
|
||||
timeval tv {};
|
||||
|
@ -496,7 +496,7 @@ void Emulator::emit_profile_event(AK::OutputStream& output, StringView event_nam
|
|||
output.write_or_error(builder.string_view().bytes());
|
||||
}
|
||||
|
||||
String Emulator::create_instruction_line(FlatPtr address, X86::Instruction insn)
|
||||
String Emulator::create_instruction_line(FlatPtr address, X86::Instruction const& insn)
|
||||
{
|
||||
auto symbol = symbol_at(address);
|
||||
if (!symbol.has_value() || !symbol->source_position.has_value())
|
||||
|
|
|
@ -122,12 +122,12 @@ private:
|
|||
OwnPtr<MallocTracer> m_malloc_tracer;
|
||||
|
||||
void setup_stack(Vector<ELF::AuxiliaryValue>);
|
||||
Vector<ELF::AuxiliaryValue> generate_auxiliary_vector(FlatPtr load_base, FlatPtr entry_eip, String executable_path, int executable_fd) const;
|
||||
Vector<ELF::AuxiliaryValue> generate_auxiliary_vector(FlatPtr load_base, FlatPtr entry_eip, String const& executable_path, int executable_fd) const;
|
||||
void register_signal_handlers();
|
||||
void setup_signal_trampoline();
|
||||
|
||||
void emit_profile_sample(AK::OutputStream&);
|
||||
void emit_profile_event(AK::OutputStream&, StringView event_name, String contents);
|
||||
void emit_profile_event(AK::OutputStream&, StringView event_name, String const& contents);
|
||||
|
||||
int virt$accept4(FlatPtr);
|
||||
int virt$access(FlatPtr, size_t, int);
|
||||
|
@ -243,7 +243,7 @@ private:
|
|||
MmapRegion const* load_library_from_address(FlatPtr address);
|
||||
MmapRegion const* first_region_for_object(StringView name);
|
||||
String create_backtrace_line(FlatPtr address);
|
||||
String create_instruction_line(FlatPtr address, X86::Instruction insn);
|
||||
String create_instruction_line(FlatPtr address, X86::Instruction const& insn);
|
||||
|
||||
bool m_shutdown { false };
|
||||
int m_exit_status { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue