Age | Commit message (Collapse) | Author |
|
This is where the fun begins. :^)
|
|
This is a continuation of the previous six commits.
The global object is only needed to return it if the execution context
stack is empty, but that doesn't seem like a useful thing to allow in
the first place - if you're not currently executing JS, and the
execution context stack is empty, there is no this value to retrieve.
|
|
This is a continuation of the previous five commits.
A first big step into the direction of no longer having to pass a realm
(or currently, a global object) trough layers upon layers of AOs!
Unlike the create() APIs we can safely assume that this is only ever
called when a running execution context and therefore current realm
exists. If not, you can always manually allocate the Error and put it in
a Completion :^)
In the spec, throw exceptions implicitly use the current realm's
intrinsics as well: https://tc39.es/ecma262/#sec-throw-an-exception
|
|
This is a continuation of the previous three commits.
Now that create() receives the allocating realm, we can simply forward
that to allocate(), which accounts for the majority of these changes.
Additionally, we can get rid of the realm_from_global_object() in one
place, with one more remaining in VM::throw_completion().
|
|
This is a continuation of the previous two commits.
As allocating a JS cell already primarily involves a realm instead of a
global object, and we'll need to pass one to the allocate() function
itself eventually (it's bridged via the global object right now), the
create() functions need to receive a realm as well.
The plan is for this to be the highest-level function that actually
receives a realm and passes it around, AOs on an even higher level will
use the "current realm" concept via VM::current_realm() as that's what
the spec assumes; passing around realms (or global objects, for that
matter) on higher AO levels is pointless and unlike for allocating
individual objects, which may happen outside of regular JS execution, we
don't need control over the specific realm that is being used there.
|
|
This is a continuation of the previous commit.
Calling initialize() is the first thing that's done after allocating a
cell on the JS heap - and in the common case of allocating an object,
that's where properties are assigned and intrinsics occasionally
accessed.
Since those are supposed to live on the realm eventually, this is
another step into that direction.
|
|
No functional changes - we can still very easily get to the global
object via `Realm::global_object()`. This is in preparation of moving
the intrinsics to the realm and no longer having to pass a global
object when allocating any object.
In a few (now, and many more in subsequent commits) places we get a
realm using `GlobalObject::associated_realm()`, this is intended to be
temporary. For example, create() functions will later receive the same
treatment and are passed a realm instead of a global object.
|
|
Using the fact that there are 2^52-2 NaN representations we can
"NaN-box" all the Values possible. This means that Value no longer has
an explicit "Type" but that information is now stored in the bits of a
double. This is done by "tagging" the top two bytes of the double.
For a full explanation see the large comment with asserts at the top of
Value.
We can also use the exact representation of the tags to make checking
properties like nullish, or is_cell quicker. But the largest gains are
in the fact that the size of a Value is now halved.
The SunSpider and other benchmarks have been ran to confirm that there
are no regressions in performance compared to the previous
implementation. The tests never performed worse and in some cases
performed better. But the biggest differences can be seen in memory
usage when large arrays are allocated. A simple test which allocates a
1000 arrays of size 100000 has roughly half the memory usage.
There is also space in the representations for future expansions such as
tuples and records.
To ensure that Values on the stack and registers are not lost during
garbage collection we also have to add a check to the Heap to check for
any of the cell tags and extracting the canonical form of the pointer
if it matches.
|
|
|
|
This is a cautious first step towards being able to create JS objects
before a global object has been instantiated.
|
|
This prevents us from needing a sv suffix, and potentially reduces the
need to run generic code for a single character (as contains,
starts_with, ends_with etc. for a char will be just a length and
equality check).
No functional changes.
|
|
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).
No functional changes.
|
|
This commit moves the length calculations out to be directly on the
StringView users. This is an important step towards the goal of removing
StringView(char const*), as it moves the responsibility of calculating
the size of the string to the user of the StringView (which will prevent
naive uses causing OOB access).
|
|
|
|
|
|
With this, Spreadsheet can now show an almost full stack trace for the
error (which is infintely better than just the error message).
|
|
|
|
And explicitly state which value wasn't found and where in the error.
|
|
Now the range A0:C4 in a sheet named "foo" can be represented as:
R`sheet("foo"):A0:C4`
This makes it possible to do cross-sheet lookups and more.
|
|
For some reason LibGUI sends two events for each edit, and one of them
contains an OOB cursor if a character was deleted.
This works around that for now.
|
|
This is a bit of a hack, but it is an easy way to finally get spacers
into GML.
This will translate well if spacers are later to become child objects of
the continer widget.
|
|
|
|
Deduced this mostly by looking at unveil()s.
|
|
This allows us to use FileSystemAccessClient functions.
|
|
|
|
|
|
|
|
These conditions weren't executed since 933a717f3b and always showed
a file import/export wizard.
|
|
Also moves WebContentClient and the references to the generated IPC
descriptions, since they are all components of OutOfProcessWebView.
This patch has no functional changes.
|
|
|
|
|
|
|
|
Implement undo/redo functionality in the Spreadsheet application
for the "extend" function, the drag-and-drop function, and when
copying and pasting.
|
|
Instead of having the undo operation only be able to undo one cell
for a given undo, make it able to handle multiple cells at a time.
Please enter the commit message for your changes. Lines starting
|
|
|
|
Previously, the paste action was always enabled and always assumed that
anything was selected, which led to a crash by clicking the paste action
right after the application startup.
This patch will automatically enable/disable the paste action depending
on whether a selection exists (it usually does, except on the app launch
and after adding a new tab) and if the clipboard mime type is a text/
group.
So no, you can't paste an image into the app anymore, even though this
mostly froze the app before...
|
|
|
|
|
|
Forgot to remove that in c0c9825f67e649daf277e75829c8f4bce1428115, 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.
|
|
These parts of code were identical to their action counterparts.
|
|
This is useful, for instance, in games in which you can switch held
items using the scroll wheel. In order to implement this, they
previously would have to either add a hard-coded division by 4, or look
up your mouse settings to adjust correctly.
This commit adds an MouseEvent.wheel_raw_delta_x() and
MouseEvent.wheel_raw_delta_y().
|
|
|
|
|
|
Also add some hints as to what the format field expects as it would be
very confusing otherwise.
|
|
Otherwise we'd end up clearing the selected rect before doing anything
with it if the user right-clicks on it.
|
|
These can be generated by saving something that's not serialisable (e.g.
functions), skip over them and let the load logic reevaluate them when
needed.
|
|
Take into account the current scroll position when calculating the
position of cells. This way when the user scrolls either horizontally
or vertically, the calculations done to find the cell position
will be correct.
|
|
When the drop location of a drag-and-drop operation is not valid, then
don't continue with the drop_event. For example, if the ending location
is the header row or header column, or is outside of the table, then
should not continue.
|
|
Implements ability to extend a cell's contents by clicking the bottom
right of the cell and dragging in a linear direction. For now, the
content that is extended is simply a copy of the target cell's
values.
|