Matthew Olsson
dd49ec17a2
LibJS: Implement spec-complient instance_of operation
2020-07-14 20:15:19 +02:00
Matthew Olsson
a51b2393f2
LibJS: Integrate iterator protocol into language features
...
Finally use Symbol.iterator protocol in language features :) currently
only used in for-of loops and spread expressions, but will have more
uses later (Maps, Sets, Array.from, etc).
2020-07-14 17:58:42 +02:00
thankyouverycool
4970c448bf
LibGUI: Draw contiguous frame if GroupBox title is left empty
2020-07-14 17:55:39 +02:00
Nico Weber
1dfae92eac
LibMarkdown: Reset offset to 0 on each new List line
...
Found by FuzzMarkdown.
2020-07-14 17:45:16 +02:00
Andreas Kling
ef84865c8c
LibX86+UserspaceEmulator: Devirtualize and inline more instruction code
...
Use some template hacks to force GCC to inline more of the instruction
decoding stuff into the UserspaceEmulator main execution loop.
This is my last optimization for today, and we've gone from ~60 seconds
when running "UserspaceEmulator UserspaceEmulator id" to ~8 seconds :^)
2020-07-13 21:00:51 +02:00
Andreas Kling
7ea36f5ed0
LibX86: Don't build_opcode_table_if_needed() every instruction decode
...
Instead, just do this once at startup. :^)
2020-07-13 20:42:37 +02:00
Andreas Kling
868db2313f
LibX86: Apply aggressive inlining to Instruction decoding functions
...
These functions really benefit from being inlined together instead
of being separated.
This yields roughly a ~2x speedup.
2020-07-13 20:34:54 +02:00
Andreas Kling
a27473cbc2
UserspaceEmulator+LibX86: Turn on -O3 optimization for emulation code
...
Since this code is performance-sensitive, let's have the compiler do
whatever it can to help us with the most important files.
This yields a ~8% speedup.
2020-07-13 20:23:00 +02:00
Tom
c8d3f8cdeb
LibGUI: Add Options flags and OpenMultiple mode for FilePicker
...
If the application can't open more than one file, we should not
allow the user to select multiple.
2020-07-13 19:49:34 +02:00
Tom
d4c6ae8263
LibGUI: Add ability to disable multiselect for views
2020-07-13 19:49:34 +02:00
Tom
f266f0e880
LibGUI: Improve IconView performance with large selections
...
This implements the following optimizations:
* Rather than clearing a HashTable of selected items and re-populating
it every time the selection rectangle changes, determine the delta
by only examining the items that might be in the area where the
selection may have changed compared to the previous area. Then
only add/remove selection items as needed.
* When painting, only query and paint the items actually visible.
Also, keep a local cache of item information such as calculated
rectangles and selection state, so it doesn't have to be calculated
over and over again.
2020-07-13 19:49:34 +02:00
Tom
b778804d20
LibGUI: Add ModelClient abstract class and allow registering clients
...
This solves a problem where the SortingProxyModel doesn't
receive the on_update call because other code overwrote
the handler later on.
2020-07-13 19:49:34 +02:00
Nico Weber
0e10a92ebc
LibLine: Add Ctrl-N/P as history next/previous shortcuts
2020-07-13 19:48:53 +02:00
Nico Weber
b0384bb1bb
LibLine: Move search-related updates into do_cursor_left/right
...
This way, arrow-left and arrow-right behave consistently with ctrl-b/ctrl-f.
2020-07-13 19:48:53 +02:00
Matthew Olsson
4c3a415dc3
LibJS: Add String Iterator tests
2020-07-13 15:07:29 +02:00
Matthew Olsson
c831fb17bf
LibJS: Add StringIterator
2020-07-13 15:07:29 +02:00
thankyouverycool
332f349e07
LibGUI: Fix keybind conflicts in TreeView
...
Changes the shortcut to expand and collapse subtrees from alt to
ctrl+right/left arrows in TreeView. The current shortcuts conflict
with applications that already have navigation controls bound to alt
like file manager.
2020-07-13 14:27:23 +02:00
thankyouverycool
366d7e6d05
LibGUI: Only report toggled directories once on subtree collapse/expansion
...
This prevents redundant calls to on_toggle for the same indices when
subtrees are collapsed or expanded.
2020-07-13 14:27:23 +02:00
Andreas Kling
f1bbc39148
LibX86: ALWAYS_INLINE some Instruction members
2020-07-13 13:50:22 +02:00
Stefano Cristiano
a1e1aa96fb
Toolchain: Allow building using CMake on macOS
2020-07-13 08:46:44 +02:00
Andreas Kling
226c0cfb20
LibVT: Don't scroll to bottom when pressing the right shift key
2020-07-12 14:32:39 +02:00
AnotherTest
9054811ace
LibM: Add 'isnormal'
2020-07-12 01:19:48 +02:00
Andreas Kling
97f4cebc8d
UserspaceEmulator+LibX86: Implement the LEA instruction
...
This piggybacks nicely on Instruction's ModR/M resolution code. :^)
2020-07-11 23:57:14 +02:00
Andreas Kling
9257657340
LibC: Some s/int/size_t/ in the malloc code
2020-07-11 23:57:14 +02:00
Matthew Olsson
43d955014d
LibJS: Implement Symbol.toStringTag
2020-07-11 23:13:29 +02:00
Matthew Olsson
5ecd504f4e
LibJS: Implement spec-compliant Object.prototype.toString
2020-07-11 23:13:29 +02:00
Matthew Olsson
531fdb2e82
LibJS: Prefer "define_property" over "put"
2020-07-11 18:54:13 +02:00
Matthew Olsson
c485c86015
LibJS: Use macros to enumerate well-known symbols
...
Not only is this a much nicer api (can't pass a typo'd string into the
get_well_known_symbol function), it is also a bit more performant since
there are no hashmap lookups.
2020-07-11 18:54:13 +02:00
Matthew Olsson
2ea85355fe
LibJS: Start implementing iterable framework, add ArrayIterator
...
With the addition of symbol keys, work can now be done on starting to
implement the well-known symbol functionality. The most important of
these well-known symbols is by far Symbol.iterator.
This patch adds IteratorPrototype, as well as ArrayIterator and
ArrayIteratorPrototype. In the future, sometime after StringIterator has
also been added, this will allow us to use Symbol.iterator directly in
for..of loops, enabling the use of custom iterator objects. Also makes
adding iterator support to native objects much easier (as will have to
be done for Map and Set, when they get added).
2020-07-11 18:54:13 +02:00
Matthew Olsson
51bfc6c6b3
LibJS: Renamed Object::GetOwnPropertyReturnMode to Object::PropertyKind
...
This enum will be used by iterators, so it makes sense to use a more
general name.
2020-07-11 18:54:13 +02:00
Peter Elliott
0fd31ef598
LibGUI: Ignore KeyUp events by default
...
fixed #2576
2020-07-11 18:51:41 +02:00
Linus Groh
7241b9ca0c
LibJS: Remove a few superfluous exception checks
...
We don't need to check for exceptions when defining properties on an
array we literally created ourselves a few lines earlier.
2020-07-11 18:38:51 +02:00
Tom
1c1ab71692
WindowServer/LibGUI: Add default menu items and allow default action for context menu
...
By specifying an optional Action for Menu::popup an application
can specify what item should be displayed as a default item.
2020-07-11 11:45:49 +02:00
Kevin Meyer
7b5ffe67cf
LibWeb: Check if layout node is still present after dispatch_event
...
Fixes https://github.com/SerenityOS/serenity/issues/2638
Dispatching an event can change the document. Therefore another check
for the layout_root needs to be done.
2020-07-11 11:34:59 +02:00
Kevin Meyer
821043d798
LibWeb: Remove some unnecessary casts
2020-07-11 11:34:59 +02:00
Kevin Meyer
d5d732cc87
LibWeb: Fix EVENT_DEBUG dump compilation
2020-07-11 11:34:59 +02:00
Peter Elliott
7a27fa3df8
LibC: Implement tcflush(3)
2020-07-11 11:33:33 +02:00
Andreas Kling
0cf7fd5268
UserspaceEmulator+LibX86: Implement all the forms of XOR
...
And they're all generic, which will make it easy to support more ops.
2020-07-10 20:20:27 +02:00
Andreas Kling
45bfdd0063
LibX86: Add a templatized way to resolve ModR/M memory references
...
Hopefully this will be flexible enough for our SoftCPU. :^)
2020-07-10 20:20:27 +02:00
Andreas Kling
3a1cf9505d
LibX86: Store Instruction's segment prefix as Optional<SegmentRegister>
...
Instead of having a dedicated enum value for the empty state.
2020-07-10 20:20:27 +02:00
thankyouverycool
deceb91c48
FileManager: Show an open folder icon for the selected directory
...
The currently selected directory now displays an open folder icon
in the directory tree.
2020-07-10 19:44:18 +02:00
thankyouverycool
e6ddc7e022
LibGUI: Add missing on_toggle hook to TreeView
...
Alt+arrow toggles are now captured.
2020-07-10 19:44:18 +02:00
Matthew Olsson
119386ffb0
LibJS: Add tests for symbol object integration
2020-07-09 23:33:00 +02:00
Matthew Olsson
7a1d485b19
LibJS: Integrate Symbols into objects as valid keys
...
This allows objects properties to be created for symbol keys in addition
to just plain strings/numbers
2020-07-09 23:33:00 +02:00
Matthew Olsson
9783a4936c
LibJS: Add test for well-known symbols
2020-07-09 23:29:28 +02:00
Matthew Olsson
ffb569fd5d
LibJS: Uncomment remaining symbol tests
2020-07-09 23:29:28 +02:00
Matthew Olsson
d9db6bec42
LibJS: Move global symbol map from SymbolObject to Interpreter
...
This allows different instances of the Interpreter to have their own
global symbols. Also makes Symbol non-copyable and non-moveable.
2020-07-09 23:29:28 +02:00
Andreas Kling
4d8683b632
UserspaceEmulator: Tidy up SoftCPU's general purpose registers
...
This patch adds a PartAddressableRegister type, which divides a 32-bit
value into separate parts needed for the EAX/AX/AL/AH register splits.
Clean up the code around register access to make it a little less
cumbersome to use.
2020-07-09 23:27:50 +02:00
Tom
6751d03ea7
LibCore: Add register_signal and unregister_signal to EventLoop
...
This allows safer asynchronous handling of signals. Signals are
dispatched with highest priority.
2020-07-09 21:58:07 +02:00
Tom
df54229954
LibVT: Set scrollbar page size
2020-07-09 21:56:45 +02:00