This does a few things in total:
* Ports the IPC-compiler to LibMain
* Extract some compiler steps into separate functions
* Minify some appends to use appendln (or appendff in the case of
StringBuilder)
This reduces the clang-tidies maximum cognitive-complexity score for
this file from 325 to under 100.
When completing `ls -l` to add another short option, the invariant
length should be zero as we are not replacing anything with our
suggestion.
Also skip the initial dash if there already is one.
Fixes#13301.
Forgot to remove that in c0c9825f67, as
this function was no longer declared and used... Until the previous
commit.
This meant that pressing the F2 key after opening a file no longer
matched the current tab.
Besides from reusing more parts from the code, this allows us to call
the action using the F2 key. That is also the reason why we have
to reassign `m_tab_context_menu_sheet_view` on tab change.
On x86-64, `int64_t` is defined to be `long` (not `long long`) , so for
printing, the "l" format specifier has to be used instead of i686's
"ll".
A couple of these macros weren't updated when the x86-64 target was
added, so using them produced warnings like this:
> warning: format specifies type 'long long' but the argument has type
> 'int64_t' (aka 'long') [-Wformat]
>
> "DW_CFA_GNU_negative_offset_extended(%" PRId64 ")\n", offset);
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
This commit changes the macros to be correct for both architectures, and
reorders them to be consistent and adds a couple missing ones for the
sake of completeness.
`delete` has to operate directly on Reference Records, so this
introduces a new set of operations called DeleteByValue, DeleteVariable
and DeleteById. They operate similarly to their Get counterparts,
except they end in creating a (temporary) Reference and calling delete_
on it.
When calling emit_load_from_reference with a MemberExpression, it is
only necessary to store the result of evaluating MemberExpression's
object when performing computed property lookup.
This allows us to skip unnecessary stores for identifier lookup.
For example, this would generate 3 unnecessary stores:
```
> Temporal.PlainDateTime.prototype.add
JS::Bytecode::Executable (REPL)
1:
[ 0] GetVariable 0 (Temporal)
[ 28] Store $2
[ 30] GetById 1 (PlainDateTime)
[ 40] Store $3
[ 48] GetById 2 (prototype)
[ 58] Store $4
[ 60] GetById 3 (add)
```
With this, it generates:
```
> Temporal.PlainDateTime.prototype.add
JS::Bytecode::Executable (REPL)
1:
[ 0] GetVariable 0 (Temporal)
[ 28] GetById 1 (PlainDateTime)
[ 38] GetById 2 (prototype)
[ 48] GetById 3 (add)
```
The body of for/in/of can contain an unconditional block terminator
(e.g. return, throw), so we have to check for that before generating
the Jump to the loop update block.
NewArray now only contains two elements maximum in `m_elements` to
indicate the range of registers to create the array from.
However, `m_element_count` still contains how many registers are in the
range and the stringifier was not updated to account for this. Thus, if
the range contained more than 2 registers, it would do a read OOB on
`m_elements`.
This makes it now just print the first and second entries in
`m_elements` in the format of `[<reg>-<reg>]`.
Some error indication was done by returning bool. This was changed to
propagate the error by ErrorOr from the underlying functions. The
returntype of the underlying functions was also changed to propagate the
error.
If we break out of the loop before we attempt to allocate again,
then we double free the memory pointed to by `name_path`.
Found by Static Analysis: Sonar Cloud
The names stdout / stderr are bound to conflict with existing
declarations when compiling against other LibC's. The build on OpenBSD
is broken for this reason at the moment.
Lets rename the members to more generic names to resolve the situation.
Previously, the whitespace collapsing code had a parameter telling it
whether the previous text node ended in whitespace. This was not
actually necessary, so let's get rid of it.
While GNU tar automatically detects the used compression algorithm,
POSIX requires that we specify -z if the tarball is compressed with
gzip.
Fixes a build error on OpenBSD.
Previously LibLine accepted read callbacks while it was in the process
of reading input, this wasn't an issue as no async code was being
executed up until the Shell autocompletion came along.
Simply defer input processing while processing input to avoid causing
problems.
Fixes#13280.
We're now able to detect all the regular CPUID feature flags from
ECX/EDX for EAX=1 :^)
None of the new ones are being used for anything yet, but they will show
up in /proc/cpuinfo and subsequently lscpu and SystemMonitor.
Note that I replaced the periods from the SSE 4.1 and 4.2 instructions
with underscores, which matches the internal enum names, Linux's
/proc/cpuinfo and the general pattern of replacing special characters
with underscores to limit feature names to [a-z0-9_].
The enum member stringification has been moved to a new function for
better re-usability and to avoid cluttering up Processor.cpp.
This will make it possible to add many, many more CPU features - more
than the current limit 32 and later limit of 64 if we stick with an enum
class to be specific :^)