summaryrefslogtreecommitdiff
path: root/Userland/Libraries
AgeCommit message (Collapse)Author
2021-08-10LibJS: Reduce copying of string data in RegExp.prototypeTimothy Flynn
In addition to invoking js_string() with existing UTF-16 strings when possible, RegExpExec now takes a Utf16String instead of a Utf16View. The view was previously fully copied into the returned result object, so this prevents potentially large copies of string data.
2021-08-10LibJS: Reduce copying of string data in String.prototypeTimothy Flynn
The primary themes here are invoking js_string() with existing instances of Utf16String when possible, and not creating entire UTF-8 copies when not needed.
2021-08-10LibJS: Replace Vector<u16> usage in PrimitiveString wth Utf16StringTimothy Flynn
This commit does not go out of its way to reduce copying of the string data yet, but is a minimum set of changes to compile LibJS after making PrimitiveString hold a Utf16String.
2021-08-10LibJS: Add a simple reference-counted UTF-16 stringTimothy Flynn
To help alleviate memory usage when creating and copying large strings, create a simple wrapper around a Vector<u16> to reference count UTF-16 strings.
2021-08-10LibGUI: Draw a focus rect over the row when sel. behavior is SelectRowssin-ack
2021-08-10LibGUI: Partially restore original TreeView column painting behaviorsin-ack
TreeView now prints columns mostly like it used to. The paddings are now properly applied, though. focus_rect drawing has been gated behind a selection_behavior() check to make sure we don't draw a focus rect around the column text when we're supposed to draw it over the entire row.
2021-08-10LibGUI: Default TreeView to SelectionBehavior::SelectItemssin-ack
AbstractTableView (which TreeView inherits from) sets the selection behavior of the view to SelectRows. This is not how TreeViews are used in most of the system, and TreeView::paint_event actually always draws with the assumption of selecting individual items. This commit defines the expected selection behavior for TreeViews. Users of TreeView can still override this via TreeView::set_selection_behavior.
2021-08-10Kernel: Add syscall performance event typeJean-Baptiste Boric
This allows tracing the syscalls made by a thread through the kernel's performance event framework, which is similar in principle to strace. Currently, this merely logs a stack backtrace to the current thread's performance event buffer whenever a syscall is made, if profiling is enabled. Future improvements could include tracing the arguments and the return value, for example.
2021-08-10LibC: Use CLOCK_REALTIME_COARSE for gettimeofday()Andreas Kling
This doesn't need to use our highest-precision timestamp.
2021-08-10Kernel+LibC: Allow clock_gettime() to run without syscallsAndreas Kling
This patch adds a vDSO-like mechanism for exposing the current time as an array of per-clock-source timestamps. LibC's clock_gettime() calls sys$map_time_page() to map the kernel's "time page" into the process address space (at a random address, ofc.) This is only done on first call, and from then on the timestamps are fetched from the time page. This first patch only adds support for CLOCK_REALTIME, but eventually we should be able to support all clock sources this way and get rid of sys$clock_gettime() in the kernel entirely. :^) Accesses are synchronized using two atomic integers that are incremented at the start and finish of the kernel's time page update cycle.
2021-08-10LibC+Kernel: Use an enum for clockid_t valuesAndreas Kling
2021-08-10LibC: Implement gettimeofday() in terms of clock_gettime(CLOCK_REALTIME)Andreas Kling
2021-08-10UserspaceEmulator+LibC: Add support for Region-of-Interest profilingAli Mohammad Pur
2021-08-09LibELF: Remove `(FlatPtr)something.as_ptr()` idiomDaniel Bertalan
This is equivalent to `something.get()`, but more verbose.
2021-08-09LibELF: Fix 'applying offset produced null pointer' UBSAN failureDaniel Bertalan
These integer => pointer => integer conversions were technically prone to UB, since they were used as offsets (which are perfectly fine to be zero), but we calculated them with pointer arithmetic. This made Clang insert pointer overflow UBSAN checks, which trigger in case of a zero result.
2021-08-09Everywhere: Use tobyase@serenityos.org for my copyright headersTobias Christiansen
2021-08-09LibJS: Fix this values in arrow functionsdavidot
Also added a large this value test (and strict variant) to ensure this values have no regressions.
2021-08-09LibJS: Move Object::invoke to Value::invoke and fix it for primitivesdavidot
This is a tiny difference and only changes anything for primitives in strict mode. However this is tested in test262 and can be noticed by overriding toString of primitive values. This does now require one to wrap an object in a Value to call invoke but all code using invoke has been migrated.
2021-08-08LibJS+Spreadsheet: Use js_string(VM&, ...) overload moreLinus Groh
2021-08-08LibJS: Implement Intl[@@toStringTag]Linus Groh
2021-08-08LibJS: Add preparation for Intl constructors and prototypesLinus Groh
Add a JS_ENUMERATE_INTL_OBJECTS macro and use it to generate: - Forward declarations - CommonPropertyNames class name members - Constructor and prototype GlobalObject members, getters, visitors, and initialize_constructor() calls
2021-08-08LibJS: Add the Intl namespace object :^)Linus Groh
This is the start of implementing ECMA-402 in LibJS, better known as the ECMAScript Internationalization API. Much like Temporal this gets its own subdirectory (Runtime/Intl/) as well as a new C++ namespace (JS::Intl) so we don't have to prefix all the files and classes with "Intl". https://tc39.es/ecma402/
2021-08-08LibJS: Implement Temporal.PlainYearMonth.prototype.getISOFields()Linus Groh
2021-08-08LibJS: Implement Temporal.PlainYearMonth.prototype.valueOf()Linus Groh
2021-08-08LibJS: Implement Temporal.PlainYearMonth.prototype.inLeapYearLinus Groh
2021-08-08LibJS: Implement Temporal.PlainYearMonth.prototype.monthsInYearLinus Groh
2021-08-08LibJS: Implement Temporal.PlainYearMonth.prototype.daysInMonthLinus Groh
2021-08-08LibJS: Implement Temporal.PlainYearMonth.prototype.daysInYearLinus Groh
2021-08-08LibJS: Implement Temporal.PlainYearMonth.prototype.monthCodeLinus Groh
2021-08-08LibJS: Implement Temporal.PlainYearMonth.prototype.monthLinus Groh
2021-08-08LibJS: Implement Temporal.PlainYearMonth.prototype.yearLinus Groh
2021-08-08LibJS: Implement Temporal.PlainYearMonth.prototype.calendarLinus Groh
2021-08-08LibJS: Implement Temporal.PlainYearMonth.prototype[@@toStringTag]Linus Groh
2021-08-08LibJS: Handle PlainYearMonth in the Calendar.prototype gettersLinus Groh
2021-08-08LibJS: Handle PlainYearMonth in ISO{Year,Month,MonthCode,Day}Linus Groh
2021-08-08LibJS: Handle PlainYearMonth in GetTemporalCalendarWithISODefaultLinus Groh
2021-08-08LibJS: Handle PlainYearMonth in ToTemporalCalendarLinus Groh
2021-08-08LibJS: Start implementing Temporal.PlainYearMonthLinus Groh
This commit adds the PlainYearMonth object itself, its constructor and prototype (currently empty), and the CreateTemporalYearMonth and ISOYearMonthWithinLimits abstract operations.
2021-08-08LibJS: Fix Vector<Value> => MarkedValueList in calendar_fields()Linus Groh
We need to ensure the temporary PrimitiveString cells don't get GC'd.
2021-08-08LibJS: Mark getters of more Temporal objects [[nodiscard]]Linus Groh
PlainDate, PlainTime, and PlainDateTime already do this. All the others should as well.
2021-08-08LibGUI: Implement granular updates for FileSystemModelsin-ack
FileSystemModel will now react to specific events from Core::FileWatcher in order to granularly update its data based on addition or removal of files from the tree. Metadata changes are currently not handled, but in the future they can be used to re-stat() a file to get its updated statistics.
2021-08-08LibGUI: Prefix some private FileSystemModel::Node members with m_sin-ack
This commit has no functional changes.
2021-08-08LibGUI: Resize the mapping rows during sortsin-ack
SortingProxyModel always expected the source model to have the same number of rows as long as it has not been invalidated. Now that we have granular updates, this assumption is no longer true, and we need to resize the source/proxy_rows vectors to the new size. This is safe since the values in the vector are overwritten right afterwards.
2021-08-08LibGUI: Implement granular operations for Model subclassessin-ack
These can be used by Model subclasses to signal the exact operations that happened to a model, so that persistent model indices in that area are not invalidated.
2021-08-08LibGUI: Implement persistent indices for modelssin-ack
This patch adds persistent indices to models. A PersistentModelIndex is a ModelIndex that will survive most model updates (provided that the data the PersistentModelIndex points to has not been removed by the model's data store). PersistentModelIndex objects can be safely held by objects outside the model they originated from.
2021-08-08LibGUI: Do not allow tree column to shrink beyond indent and iconsin-ack
We always display the tree indent and the icon, so we shouldn't allow the tree column to shrink beyond that size.
2021-08-08LibGUI: Let the table view tell HeaderView about the min. section sizesin-ack
Previously HeaderView would just assume that each column or row could have a minimum size of 2. This makes it so that AbstractTableView subclasses can provide a new minimum value for a specific column.
2021-08-08LibGUI: Correctly call update() in ProcessChoosersin-ack
After the update -> invalidate change a couple places broke when update() was supposed to be manually called. This instance was not marked virtual or override, which made it hard to detect. This commit makes sure that update() on the original model is called when the RunningProcessesModel needs an update.
2021-08-08LibJS: Add missing spec linksLinus Groh
2021-08-08LibJS: Don't overflow size_t in `Value::to_length()`Daniel Bertalan
Although this is not spec-compliant, we don't have a way to represent objects larger than `NumericLimits<size_t>::max()`. Since this abstract operation is only used when dealing with object size, we don't lose any functionality by taking that limit into account too. This fixes a UBSAN error when compiling with Clang.