Age | Commit message (Collapse) | Author |
|
|
|
With this commit, <AK/Format.h> has a more supportive role and isn't
used directly.
Essentially, there now is a public 'vformat' function ('v' for vector)
which takes already type erased parameters. The name is choosen to
indicate that this function behaves similar to C-style functions taking
a va_list equivalent.
The interface for frontend users are now 'String::formatted' and
'StringBuilder::appendff'.
|
|
|
|
The VM is always there, but we only have an Interpreter while we are
running code.
|
|
Don't require clients to templatize modrm().read{8,16,32,64}() with
the ValueWithShadow type when we can figure it out automatically.
The main complication here is that ValueWithShadow is a UE concept
while the MemoryOrRegisterReference inlines exist at the lower LibX86
layer and so doesn't have direct access to those types. But that's
nothing we can't solve with some simple template trickery. :^)
|
|
m_cached_code_end points at the first invalid byte, so we need to
update the cache if the last byte we want to read points at the
end or past it. Previously we updated the cache 1 byte prematurely in
read16, read32, read64 (but not in read8).
Noticed by reading the code (the code looked different from read8() and
the other 3). I didn't find anything that actually hit this case.
|
|
As noticed in #3578.
|
|
This is useful for reading and writing doubles for #3329.
It is also useful for emulating 64-bit binaries.
MemoryOrRegisterReference assumes that 64-bit values are always
memory references since that's enough for fpu support. If we
ever want to emulate 64-bit binaries, that part will need minor
updating.
|
|
Fixes keyboard increment/decrement of SpinBox values.
After PR #2412 the TextBox class started not propagating arrow key
events to the parent widgets because it handles them itself now.
It also added two new events for these arrow keys, so use them instead
in SpinBox.
|
|
|
|
With this patch, we now enforce basic same-origin policy for this one
<iframe> attribute.
To make it easier to add more attributes like this, I've added an
extended IDL attribute ("[ReturnNullIfCrossOrigin]") that does exactly
what it sounds like. :^)
|
|
Getting ready for some extremely basic same-origin policy stuff,
this initial implementation simply checks that two origins have
identical protocol, host and port.
|
|
This is a convenience getter to retrieve the security origin of a DOM
window's document.
|
|
|
|
This matches the standard API names contentWindow and contentDocument.
|
|
Empty string is extremely common and we can avoid a lot of heap churn
by simply caching one in the VM. Primitive strings are immutable anyway
so there is no observable behavior change outside of fewer collections.
|
|
No need to instantiate unique symbols for each Interpreter; they can
be VM-global. This reduces the memory cost and startup time anyway.
|
|
There's a lot more of these things to fix. We'll also want to move from
passing Interpreter& around to VM& instead wherever that is enough.
|
|
|
|
This will allow us to throw exceptions even when there is no active
interpreter in the VM.
|
|
I had this in #3580 but I must have lost it during rebasing.
|
|
SortingProxyModel
|
|
|
|
|
|
|
|
|
|
Two things I hate about C++:
1. 'int', 'signed int' and 'unsigned int' are two distinct types while
'char, 'signed char' and 'unsigned char' are *three* distinct types.
This is because 'signed int' is an alias for 'int' but 'signed char'
can't be an alias for 'char' because on some weird systems 'char' is
unsigned.
One might think why not do it the other way around, make 'int' an
alias for 'signed int' and 'char' an alias for whatever that is on
the platform, or make 'char' signed on all platforms. But who am I
to ask?
2. 'unsigned long' and 'unsigned long long' are always different types,
even if both are 64 bit numbers.
This commit fixes a few bugs that coming from this.
See Also: 1b3169f405ac9250b65ee3608e2962f51d2d8e3c.
|
|
StringBuilder::appendf was already used, thus this name. If we some day
replace all usages of printf, we could rename this method.
|
|
This function is not avaliable in the kernel.
In the future it would be nice to have some sort of <charconv> header
that does this for all integer types and then call it in strtoull and et
cetera.
The difference would be that this function say 'from_chars' would return
an Optional and not just interpret anything invalid as zero.
|
|
this fixes the passwd issues discovered in #3296
|
|
|
|
Core::Account abstracts login semantics like password checking and
switching uid/gid.
|
|
|
|
|
|
|
|
|
|
Can be used to display the list of autocomplete suggestions and apply
a suggestion that was chosen by the user.
|
|
CppAutoComplete gets a string of code and a position within it, and
returns a Vector of auto-complete suggestions that are relevant for the
given position.
Currently, it's very naive - it uses our CppLexer to find identifiers
in the code which the auto-complete target is a prefix of.
|
|
|
|
|
|
This lets you show some disabled text when no text is entered, and the
editor is not focused.
|
|
I accidentally committed some code here to force a crash, but this
should just assert.
|
|
We can't GC while we're already in GC. Assert if this happens.
|
|
To make it a little clearer what this is for. (This is an RAII helper
class for adding and removing an Interpreter to a VM's list of the
currently active (executing code) Interpreters.)
|
|
|
|
If we are in a nested execution context, we shouldn't only mark things
used by the active interpreter.
|
|
There are three classes avaliable that share the functionality of
BufferStream:
1. InputMemoryStream is for reading from static buffers. Example:
Bytes input = /* ... */;
InputMemoryStream stream { input };
LittleEndian<u32> little_endian_value;
input >> little_endian_value;
u32 host_endian_value;
input >> host_endian_value;
SomeComplexStruct complex_struct;
input >> Bytes { &complex_struct, sizeof(complex_struct) };
2. OutputMemoryStream is for writing to static buffers. Example:
Array<u8, 4096> buffer;
OutputMemoryStream stream;
stream << LittleEndian<u32> { 42 };
stream << ReadonlyBytes { &complex_struct, sizeof(complex_struct) };
foo(stream.bytes());
3. DuplexMemoryStream for writing to dynamic buffers, can also be used
as an intermediate buffer by reading from it directly. Example:
DuplexMemoryStream stream;
stream << NetworkOrdered<u32> { 13 };
stream << NetowkrOrdered<u64> { 22 };
NetworkOrdered<u32> value;
stream >> value;
ASSERT(value == 13);
foo(stream.copy_into_contiguous_buffer());
Unlike BufferStream these streams do not use a fixed endianness
(BufferStream used little endian) these have to be explicitly specified.
There are helper types in <AK/Endian.h>.
|
|
|
|
|
|
I could not test these changes because I could not get my telnet client
(on Linux) to connect to the telnet server running in Serenity.
I tried the follwing:
# Serenity
su
TelnetServer
# Linux
telnet localhost 8823
The server then immediatelly closes the connection:
Connection closed by foreign host.
In the debug logs the following message appears:
[NetworkTask(5:5)]: handle_tcp: unexpected flags in FinWait2 state
[NetworkTask(5:5)]: handle_tcp: unexpected flags in Closed state
[NetworkTask(5:5)]: handle_tcp: unexpected flags in Closed state
This seems to be an unrelated bug in the TCP implementation.
|