To ensure that we stay on the same CPU that acquired the spinlock until
we're completely unlocked, we now leave the critical section *before*
re-enabling interrupts.
We want to grab g_scheduler_lock *before* Thread::m_block_lock.
This appears to have fixed a deadlock that I encountered while building
DOOM with make -j2.
Path resolution may do blocking I/O so we must not do it while holding
a spinlock. There are tons of problems like this throughout the kernel
and we need to find and fix all of them.
This fixes an issue where we could get preempted after acquiring the
current Processor pointer, but before calling methods on it.
I strongly suspect this was the cause of "Processor::current() == this"
assertion failures.
We cache on the AST node side as this is easier to track a position, we
just have to take care to wrap the values in a handle to make sure they
are not garbage collected.
Since tagged template literals can inspect the raw string it is not a
syntax error to have invalid escapes. However the cooked value should be
`undefined`.
We accomplish this by tracking whether parse_string_literal
fails and then using a NullLiteral (since UndefinedLiteral is not a
thing) and finally converting null in tagged template execution to
undefined.
We use strtod to convert a string to number after checking whether the
string is [+-]Infinity, however strtod also checks for either 'inf' or
'infinity' in a case-insensitive.
There are still valid cases for strtod to return infinity like 10e100000
so we just check if the "number" contains 'i' or 'I' in which case
the strtod infinity is not valid.
Assuming we had at least one argument meant that the ...arg count would
underflow causing the bound function to have length 0 instead of the
given length when binding with no arguments.
This hook allows us to reject private elements on certain exotic
objects like the window object in browser.
Note that per the spec we should only call this hook if the host is a
web browser, however because LibJS has no way of knowing whether it is
in a web browser environment we just always call the host hook.
This matches out general macro use, and specifically other verification
macros like VERIFY(), VERIFY_NOT_REACHED(), VERIFY_INTERRUPTS_ENABLED(),
and VERIFY_INTERRUPTS_DISABLED().
Similar to commit becec35, our code point display name data was a large
list of StringViews. RLE can be used here as well to remove about 32 MB
from the initialized data section to the read-only section.
Some of the refactoring to store strings as indices into an RLE array
also lets us clean up some of the code point name generators.
✍️ - U+270D U+FE0F WRITING HAND
👆 - U+1F446 BACKHAND INDEX POINTING UP
👇 - U+1F447 BACKHAND INDEX POINTING DOWN
👈 - U+1F448 BACKHAND INDEX POINTING LEFT
👉 - U+1F449 BACKHAND INDEX POINTING RIGHT
👋 - U+1F44B WAVING HAND
👏 - U+1F44F CLAPPING HANDS
🖐️ - U+1F590 HAND WITH FINGERS SPLAYED
🤏 - U+1F90F PINCHING HAND
🤙 - U+1F919 CALL ME HAND
🤚 - U+1F91A RAISED BACK OF HAND
🤝 - U+1F91D HANDSHAKE
🫱 - U+1FAF1 RIGHTWARDS HAND
🫲 - U+1FAF2 LEFTWARDS HAND
🫳 - U+1FAF3 PALM DOWN HAND
🫴 - U+1FAF4 PALM UP HAND
☹️ - U+2639 U+FE0F FROWNING FACE
☺️ - U+263A U+FE0F SMILING FACE
🤡 - U+1F921 CLOWN FACE
🥹 - U+1F979 FACE HOLDING BACK TEARS
🫠 - U+1FAE0 MELTING FACE
🫡 - U+1FAE1 SALUTING FACE
🫢 - U+1FAE2 FACE WITH OPEN EYES AND HAND OVER MOUTH
🫣 - U+1FAE3 FACE WITH PEEKING EYE
🫤 - U+1FAE4 FACE WITH DIAGONAL MOUTH
🫥 - U+1FAE5 DOTTED LINE FACE
Instead of locking it twice, we now frontload all the work that doesn't
touch the fd table, and then only lock it towards the end of the
syscall.
The benefit here is simplicity. The downside is that we do a bit of
unnecessary work in the EMFILE error case, but we don't need to optimize
that case anyway.
If the final copy_to_user() call fails when writing the file descriptors
to the output array, we have to make sure the file descriptors don't
remain in the process file descriptor table. Otherwise they are
basically leaked, as userspace is not aware of them.
This matches the behavior of our sys$socketpair() implementation.
We don't need to explicitly check for EMFILE conditions before doing
anything in sys$pipe(). The fd allocation code will take care of it
for us anyway.
Widget::handle_leave_event() hides the tooltip if one is shown. That's
usually fine and hides the widget's tooltip, but it can happen that
another widget managed to show a tooltip after the Leave event was
triggered and before it's processed.
Thus change handle_leave_event() to only hide the tooltip if it was show
by the widget.
Fixes the case where this could happen in the flame graph in Profiler
when moving the mouse over the tooltip window itself #14852.
Currently, the unique string lists are stored in the initialized data
sections of their shared libraries. In order to move the data to the
read-only section, generate the strings using RLE arrays.
We generate two arrays: the first is the RLE data itself, the second is
a list of indices into the RLE array for each string. We then generate a
decoding method to convert an RLE string to a StringView.
We ensure that when we call SharedInodeVMObject::sync we lock the inode
lock before calling Inode virtual write_bytes method directly to avoid
assertion on the unlocked inode lock, as it was regressed recently. This
is not a complete fix as the need to lock from each path before calling
the write_bytes method should be avoided because it can lead to
hard-to-find bugs, and this commit only fixes the problem temporarily.
Set preferred height instead of fixed height to allow the splitter to
move.
The splitter respects set_fixed_height() after a808cfa7 "LibGUI+
Applications: Govern Splitter resizing by opportunistic growth", and
that caused the splitter in Profiler to stop working.
Previously submenus would pop-up on their immediate open ancestors in
cases of limited screen real estate. If the submenu was sufficiently
large, this could make it difficult to navigate back down the menu
stack. Now submenus display on either side of their ancestors, making
it easy to zig-zag up and down menu stacks. This is similar to how
menus operate in many other DEs.
And invalidate the cursor before creating a new drag-and-drop
overlay. Fixes dnd overlay bitmaps failing to draw at the correct
location immedately after changing cursors.
Adds a member to record the last processed mouse buttons. If they
do not include MouseButton::Primary, return early before creating
a new drag and drop client. This fixes race conditions in which
MouseUp events canceling or completing a drop could be swallowed
by Overlay creation or postponed by an executing DragOperation,
leaving the operation in limbo.
Removes some verbiage and arranges things consistent with other
settings dialogs.
Ideally we shouldn't litter UIs with shortcuts, tips, tricks,
self-evident or redundant descriptions, etc, so this can be
refined again in the future once there's an official way to expose/
customize keyboard shortcuts.