summaryrefslogtreecommitdiff
path: root/Userland
AgeCommit message (Collapse)Author
2021-10-24LibJS: Add the "fast non-local access" optimization to the bytecode VMAndreas Kling
The GetVariable bytecode op now caches environment coordinates for fast cross-scope variable lookup.
2021-10-24LibJS: Add a separate "identifier table" to bytecode executablesAndreas Kling
This is a specialized string table for storing identifiers only. Identifiers are always FlyStrings, which makes many common operations faster by allowing O(1) comparison.
2021-10-24LibJS: Use String and move semantics in Bytecode::StringTableAndreas Kling
Avoid creating new AK::String objects when we already have one.
2021-10-24LibJS: Implement 'this' in the bytecode VMAndreas Kling
ThisExpression now emits a "ResolveThisBinding" bytecode op, which simply loads the VM's current 'this' binding into the accumulator.
2021-10-24LibJS: Alphabetize the bytecode opcode listAndreas Kling
2021-10-24LibJS: Include executable name in bytecode dumpsAndreas Kling
2021-10-24LibJS: Move global "should dump bytecode" flag into LibJSAndreas Kling
This will allow us to trigger bytecode executable dumps when generating bytecode inside LibJS as well, not just in clients like js and test-js.
2021-10-24LibJS: Add Bytecode::Executable::dump()Andreas Kling
Let's have a helper for producing a consistent executable dump instead of repeating the logic in multiple places.
2021-10-24PixelPaint: Move Mask::{get, set, to_index} to the header fileIdan Horowitz
They were previously taking up 9% of samples in a profile of PixelPaint while selecting a mask, and as a result of moving them to the header they were inlined, which effectively eliminated them from the profile.
2021-10-24LibJS: Don't VERIFY that a function is Regular when executing in ASTdavidot
By replacing this VERIFY with a thrown Error we no longer crash when calling a generator function in the AST interpreter. This allows us to more gracefully handle situation which have not been implemented yet. In particular this helps the libjs-test262-runner since it can now continue on to the next tests instead of having the entire process end.
2021-10-23LibC: Use a sensible `MB_CUR_MAX` valueDaniel Bertalan
We always use UTF-8, meaning that a single `wchar_t` might be converted into up to 4 `char`s. This would cause a buffer overflow if something actually relied on this being the right value.
2021-10-23LibC: Define locale categories (LC_*) as macrosDaniel Bertalan
The C standard states that these symbols should be declared as macros, not as emum variants as we were doing previously. This is used in some ports (e.g. bash) to conditionally compile locale-dependent functionality. We now use the same trick here as with the errno constants. We keep the enum, but also create macros that defer to the enum variants.
2021-10-24LibCore: Pop the main Core::EventLoop off the stack when destroyedAndreas Kling
The main event loop pushes itself onto the event loop stack, and so it should also pop itself when destroyed. This will surface attempts to use the event loop stack after the main event loop has been destroyed.
2021-10-24LibIPC: Use a zero-delay timer for message processingAndreas Kling
This lets us avoid using Core::deferred_invoke() which is not usable during application teardown (as there is no event loop to push the deferred invocation onto.) (Not that there is an event loop to fire the processing timer during teardown *either*, but at least we can exit gracefully with pending timers, unlike deferred invocations, which hang the process. This is an area where more improvements are definitely needed!)
2021-10-24LibIPC: Store local endpoint magic in a ConnectionBase memberAndreas Kling
This simplifies some of the code, since it's no longer necessary for the templated code to pass LocalEndpoint::static_magic() everywhere.
2021-10-24LibIPC: Move waiting for synchronous responses to ConnectionBaseAndreas Kling
2021-10-24LibIPC: Move more of IPC::Connection to ConnectionBaseAndreas Kling
This patch moves the templated message parsing code to a virtual try_parse_messages() helper. By doing that, we can move the rest of the socket draining code up to ConnectionBase and keep it out of line.
2021-10-24LibIPC: Move non-templated parts of IPC::Connection out of lineAndreas Kling
This patch splits IPC::Connection into Connection and ConnectionBase. ConnectionBase moves into Connection.cpp so we don't have to inline it for every single templated subclass.
2021-10-24LibIPC: Add missing <signal.h> includeAndreas Kling
2021-10-24LibIPC: Add IPC::Stub to forwarding headerAndreas Kling
2021-10-23Shell: Prevent exponential explosion around '$(('Ben Wiederhake
When parse_expression looks at '$((', there are two ways it can end up in parse_expression again, three consumed characters later. All these ways fail, so what happened was that the parser tried all possible combinations, hence taking potentially an exponential amount of time. 1. parse_evaluate swallows the '$(', a new invocation of parse_expression swallows the other '(', and through parse_list_expression we're at another parse_expression. 2. parse_evaluate swallows the '$(', but returns a SyntaxError. parse_expression used to not recognize the error, and treated it as a regular AST node, calling into read_concat, then a new invocation of parse_expression swallows the other '(', and through parse_list_expression we're at another parse_expression. Fixes #10561. Found by OSS Fuzz, long-standing issue https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28113
2021-10-23LibJS: Convert a few TRYs to MUST in RegExp.prototypeTimothy Flynn
These are marked with ! in the spec. This also adds assertions above a couple of these operations to be extra sure (the spec also indicates we should make these assertions).
2021-10-23AK+Everywhere: Make Base64 decoding fallibleBen Wiederhake
2021-10-23LibJS: Convert Atomics functions to ThrowCompletionOrTimothy Flynn
2021-10-23LibJS: Convert typed_array_from to ThrowCompletionOrTimothy Flynn
2021-10-23AK: Prevent accidental misuse of BumpAllocatorBen Wiederhake
In particular, we implicitly required that the caller initializes the returned instances themselves (solved by making UniformBumpAllocator::allocate call the constructor), and BumpAllocator itself cannot handle classes that are not trivially deconstructible (solved by deleting the method). Co-authored-by: Ali Mohammad Pur <ali.mpfard@gmail.com>
2021-10-23HackStudio: Add syntax-highlighting for CSS filesSam Atkins
2021-10-23TextEditor: Add syntax-highlighting for CSS filesSam Atkins
2021-10-23LibWeb: Syntax-highlight CSS within HTML :^)Sam Atkins
2021-10-23LibWeb: Implement first draft of CSS syntax highlighting :^)Sam Atkins
This works at the Token level, which is quick and easy but has drawbacks: We don't know when something is a property name or a value, or if something is part of a selector. But, this works for now.
2021-10-23LibWeb: Record position information in CSS TokensSam Atkins
This is a requirement to be able to use the Tokens for syntax highlighting.
2021-10-23LibWeb: Add CSS Tokenizer::consume_as_much_whitespace_as_possible()Sam Atkins
This is a step in the spec in 3 places, and we had it implemented differently in each one. This unifies them and makes it clearer what we're doing.
2021-10-23LibWeb: Add spec links to CSS TokenizerSam Atkins
Also renamed `starts_with_a_number()` -> `would_start_a_number()` to better match spec terminology.
2021-10-23LibWeb: Implement hashless hex color quirkSam Atkins
https://quirks.spec.whatwg.org/#the-hashless-hex-color-quirk The CSS parser should now be completely quirky! :^) The code is a bit awkward, especially the prepending-0s step, but at least it won't be running too often.
2021-10-23LibWeb: Explicitly cast parameters to Color::from_hsl/hsla()Sam Atkins
CLion was giving me the angry red underlines about this.
2021-10-23LibGfx+LibWeb: Move "transparent" keyword into Color::from_string()Sam Atkins
It seemed odd to have this one color handled separately, when `Color::from_string()` implements all other CSS colors.
2021-10-23LibJS: Convert RegExpStringIteratorPrototype to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert RegExpPrototype functions to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert the RegExpExec AO to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert the RegExpBuiltinExec AO to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert the MakeIndicesArray AO to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert RegExpConstructor functions to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert the RegExpCreate AO to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert the RegExpInitialize AO to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert PromisePrototype functions to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert PromiseConstructor functions to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert the PromiseResolve AO to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert the NewPromiseCapability AO to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert DatePrototype functions to ThrowCompletionOrIdan Horowitz
2021-10-23LibJS: Convert DateConstructor functions to ThrowCompletionOrIdan Horowitz