Commit graph

34082 commits

Author SHA1 Message Date
Timothy Flynn
d9055de7ea LibSQL: Add a new Result class to replace SQLResult
The existing SQLResult class predates our TRY semantics. As a result, in
the AST execution methods, there is a lot of is_error checking on values
that could instead be wrapped with TRY. This new class will allow such
semantics, and is also stack allocated (no need to be a RefPtr). It is
heavily based on LibJS's completion class.
2022-02-10 12:20:35 +00:00
Timothy Flynn
f2fae3a21c LibSQL: Do not return copies of vectors from table/index definitions 2022-02-10 12:20:35 +00:00
kleines Filmröllchen
70cdd05172 Base: Add a quote to the fortunes database 2022-02-10 11:14:27 +00:00
Lenny Maiorani
2e436129b0 LibSoftGPU: Dispatch based on ClipPlane enum at compile-time
The `ClipPlane` enum is being looped over at run-time performing
run-time dispatch to determine the comparison operation in
`point_within_clip_plane`.

Change this `for` loop to be linear code which dispatches using a
template parameter. This allows for the `point_within_clip_plane`
function to do compile-time dispatch.

Note: This linear code can become a compile-time loop when static
reflection lands in C++2[y|z] allowing looping over the reflected
`enum class`.
2022-02-10 10:33:31 +00:00
electrikmilk
3c11dc5bd3 Base+HackStudio: Add or insert missing icons
Insert or add icons where they are missing.
2022-02-10 10:27:26 +00:00
Timothy Flynn
19d4f52a9e js: Add a command line argument to evaluate a string as a script
For example:

    $ js -c "console.log(42)"
    42
2022-02-10 10:26:12 +00:00
Ryan Chandler
65de0d2910 Utilities: Port realpath to LibMain 2022-02-10 10:25:36 +00:00
Lenny Maiorani
2e87a5b7eb Applications: Port Spreadsheet to LibMain 2022-02-10 10:24:18 +00:00
Lenny Maiorani
4b18a25e22 Applications: Port SpaceAnalyzer to LibMain 2022-02-10 10:23:51 +00:00
Lenny Maiorani
ed971f1134 Applications: Port Debugger to LibMain 2022-02-10 10:23:26 +00:00
Lenny Maiorani
e5d178528d AK: Change static base36 character map to function-local constexpr
Static variables consume memory and can be subject to less
optimization. This variable is only used in 1 place and can be moved
into the function and make it non-static.
2022-02-10 10:22:54 +00:00
electrikmilk
7be79eeb5e Base: Add pastel color palette
Add pastel color palette for PixelPaint.
2022-02-10 10:22:17 +00:00
Lady Gegga
c9ce73ffaa Base: Add Ol Chiki characters to font Katica Regular 10
1C50, 1C51, 1C5A-1C67, 1C6A-1C70, 1C73-1C7C, 1C7E, 1C7F
https://www.unicode.org/charts/PDF/U1C50.pdf
2022-02-10 08:48:43 +00:00
Lady Gegga
b11c22e564 Base: Add Lycian characters to font Katica Regular 10
10280-1029C https://www.unicode.org/charts/PDF/U10280.pdf
2022-02-10 08:48:43 +00:00
Lady Gegga
ce0df575a3 Base: Add Carian characters to font Katica Regular 10
102A0-102D0 https://www.unicode.org/charts/PDF/U102A0.pdf
2022-02-10 08:48:43 +00:00
Luke Wilde
1bfbc0b6af LibJS: Don't coerce this value to an object in Function.prototype.call 2022-02-10 08:45:03 +00:00
Luke Wilde
12231068bd LibJS: Don't coerce this value to an object in Function.prototype.apply 2022-02-10 08:45:03 +00:00
Linus Groh
898ad7c682 LibJS: Implement Function.prototype.bind() according to the spec :^) 2022-02-09 23:31:34 +00:00
Linus Groh
87b9fa2636 LibJS: Add FunctionObject constructor allowing null prototype
This just calls through to the Object constructor added in the previous
commit.
2022-02-09 23:31:34 +00:00
Linus Groh
368af9ad6e LibJS: Add Object constructor allowing null prototype 2022-02-09 23:31:34 +00:00
Linus Groh
f663c7d6da LibJS: Remove unused BoundFunction::m_constructor_prototype
This was not being used anywhere, and the way we determined it was not
matching the spec at all, so let's remove it and do it properly.
2022-02-09 23:31:34 +00:00
Liav A
c6c3e2a7fd Kernel: Instantiate a TextModeConsole early on if there's no framebuffer
If the bootloader that loaded us is providing a framebuffer details from
the Multiboot protocol then we can instantiate a framebuffer console.
Otherwise, we should use a text mode console, assuming that the BIOS and
the bootloader didn't try to modeset the screen resolution so we have is
a VGA 80x25 text mode being displayed on screen.

Since "boot_framebuffer_console" is no longer a good representative as a
global variable name, it's changed to g_boot_console to match the fact
that it can be assigned with a text mode console and not framebuffer
console if needed.
2022-02-09 21:05:48 +00:00
Liav A
278b0aa629 Kernel/Graphics: Don't assert when disabling TextModeConsole
Not sure how it's useful to do so, let's not assert if something tries
to disable it. If we will use TextModeConsole as a boot console, that
console will be disabled after loading an appropriate console to replace
it.
2022-02-09 21:05:48 +00:00
Liav A
90a194377c Kernel/Graphics: Untie Text mode console from VGACompatibleAdapter class
Instead, we can construct this type of object without having to
instantiate a VGACompatibleAdapter object first.
This can help instantiate such console very early on boot to aid debug
issues on bare metal hardware.
2022-02-09 21:05:48 +00:00
Lenny Maiorani
c6acf64558 Kernel: Change static constexpr variables to constexpr where possible
Function-local `static constexpr` variables can be `constexpr`. This
can reduce memory consumption, binary size, and offer additional
compiler optimizations.

These changes result in a stripped x86_64 kernel binary size reduction
of 592 bytes.
2022-02-09 21:04:51 +00:00
Ali Mohammad Pur
6a4c8a66ae LibRegex: Only skip full instructions when optimizing alternations
It makes no sense to skip half of an instruction, so make sure to skip
only full instructions!
2022-02-09 21:02:24 +00:00
Lenny Maiorani
f0d2489254 Applications: Port Assistant to LibMain 2022-02-09 21:01:52 +00:00
electrikmilk
133a30c8b7 Base+Browser: Add browser icons
Add local storage and style sheet icons. I also noticed the name of the
DOM tree icon needed updated (tree => dom_tree).
2022-02-09 21:00:37 +00:00
Ali Mohammad Pur
3bfcd7b52d LibJS: Implement Sets using Maps
This implements ordered sets using Maps with a sentinel value, and
includes some extra set tests.
Fixes #11004.

Co-Authored-By: davidot <davidot@serenityos.org>
2022-02-09 20:57:41 +00:00
Ali Mohammad Pur
4a73ec07c5 LibJS: Make Map iterators independent of the underlying hashmap
This implements ordered maps as a pair of an RBTree for key order, and
an underlying unordered hash map for storage.
Fixes (part of) #11004.
2022-02-09 20:57:41 +00:00
Ali Mohammad Pur
e7dea10381 AK: Add RBTree::find_smallest_above_iterator(Key) 2022-02-09 20:57:41 +00:00
Ali Mohammad Pur
9ff22ac7e0 LibHTTP: Skip the body when response code is 204
...even if the headers claim that there's some data in the form of
Content-Length.
This finally fixes loading Discord with RequestServer ConnectionCache
on :^)
2022-02-09 21:23:25 +01:00
Ali Mohammad Pur
cb7becb067 LibTLS+RequestServer: Add an option to dump TLS keys to a log file
This file allows us to decrypt TLS messages in wireshark, which can help
immensely in debugging network stuff :^)
2022-02-09 21:23:25 +01:00
Sam Atkins
a796207b9f LibWeb: Paint box-shadows more efficiently
Our previous code roughly did this:

1. Generate a bitmap as large as the shadow would end up.
2. Paint a rectangle onto it.
3. Blur the whole bitmap.
4. Split it up and render each section.

This patch takes advantage of the fact that (aside from corners) each
horizontal or vertical strip of a box-shadow is identical to the
others, to generate and blur a much smaller bitmap - only large enough
for the four corners and 1px of central "side" in each direction. This
greatly reduces the memory footprint, and should also speed things up,
since there is much less to blur.
2022-02-09 19:36:26 +01:00
Andreas Kling
3ec71e1400 LibC: Remove debug spam in getaddrinfo() 2022-02-09 19:36:15 +01:00
Daste
a22323ecce Browser: Make underlined shortcuts in "Debug" menu unique 2022-02-09 19:33:51 +01:00
electrikmilk
1d8b213b5b Base+Browser: Add browser icons folder
Move browser specific icons to their own folder in /res/icons/
2022-02-09 19:33:28 +01:00
Lenny Maiorani
138d54e595 AK+Kernel: Alphabetize debug macros
This is not ASCII-betical because `_` comes after all the uppercase
characters. Treating `_` as a ` ` (space character), these lists are
now alphabetical.
2022-02-09 17:59:19 +00:00
Andrew Kaster
820e99f97d LibWeb: Add initial implementation for WorkerGlobalScope
This initial implementation stubs out the WorkerGlobalScope,
WorkerLocation and WorkerNavigator classes. It doesn't take into account
all the things that actually need passed into the constructors for these
objects, nor the extra abstract operations that need to be performed on
them by the rest of the Browser infrastructure. However, it does create
bindings that compile and link :^)
2022-02-09 17:21:05 +01:00
Daniel van Gerpen
8b38df72a3 LibSQL: Update list of expected statements
Add an entry for the DESCRIBE TABLE statement and add an Oxford comma.
2022-02-09 15:35:37 +00:00
Brian Gianforcaro
2e81990a3c LibWeb: Do not set Content-Length headers twice for POST requests
While trying to get http://lite.duckduckgo.com to work in the Browser I
noticed that we kept on getting 400 (Bad Request) errors when you click
the "Search" button for a request.

After turning on `JOB_DEBUG` to see what headers we were sending it
turned out that we were actually setting `Content-Length` twice once
in LibWeb, and again when the request is handled by LibHTTP.

Since LibHTTP transparently handles this now, we can avoid it in LibWeb.
2022-02-09 14:05:07 +00:00
electrikmilk
72e0d3d20b Base: Enlarge globe in CSS file icon
Make globe in CSS file icon more visible.
2022-02-09 13:54:14 +00:00
Andreas Kling
0ba2a3ff30 LibWeb: Don't fill or stroke SVG <path> with transparent color
Before this, we were filling and stroking every <path>, whether they had
a fill/stroke color or not. We can avoid a bunch of unnecessary work by
checking if the color is transparent (also the case if unset) before
doing the painting work.

If there is no fill color, we also avoid making a copy of the path to
ensure that it's closed.
2022-02-09 13:44:00 +01:00
Linus Groh
7676b1b925 LibJS: Remove MarkedValueList in favor of MarkedVector<Value> :^) 2022-02-09 12:25:27 +00:00
Linus Groh
6508ff5bbd LibWeb: Stop using MVL for sequence storage in WrapperGenerator
Use MarkedVector<Value> instead.
2022-02-09 12:25:27 +00:00
Linus Groh
bc183dbbcb LibJS: Replace uses of MarkedValueList with MarkedVector<Value>
This is effectively a drop-in replacement.
2022-02-09 12:25:27 +00:00
Linus Groh
1d32ac7b8b LibJS: Convert get_iana_time_zone_epoch_value() to MarkedVector<BigInt*> 2022-02-09 12:25:27 +00:00
Linus Groh
af7003ebd2 LibJS: Convert 'possible instants' AOs to MarkedVector<Instant*>
Resolve TODOs suggesting the use of a strongly typed MarkedValueList
(a.k.a. MarkedVector<T>) in the following AOs:

- get_possible_instants_for()
- disambiguate_possible_instants()
2022-02-09 12:25:27 +00:00
Linus Groh
a863363b06 LibJS: Let MarkedVector<T> inherit from Vector and handle Cell* + Value
Note: MarkedVector is still relatively new and has zero users right now,
so these changes don't affect any code other than the class itself.

Reasons for this are the rather limited API:

- Despite the name and unlike MarkedValueList, MarkedVector isn't
  actually a Vector, it *wraps* a Vector. This means that plenty of
  convenient APIs are unavailable and have to be exported on the class
  separately and forwarded to the internal Vector, or need to go through
  the exposed Span - both not great options.
- Exposing append(Cell*) and prepend(Cell*) on the base class means that
  it was possible to append any Cell type, not just T! All the strong
  typing guarantees are basically gone, and MarkedVector doesn't do much
  more than casting Cells to the appropriate type through the exposed
  Span.

All of this combined means that MarkedVector - in its current form -
doesn't provide much value over MarkedValueList, and that we have to
maintain two separate, yet almost identical classes.

Let's fix this!

The updated MarkedVector steals various concepts from the existing
MarkedValueList, especially the ability to copy. On the other hand, it
remains generic enough to handle both Cell* and Value for T, making
MarkedValueList effectively redundant :^)

Additionally, by inheriting from Vector we get all the current and
future APIs without having to select and expose them separately.

MarkedVectorBase remains and takes care of communicating creation and
destruction of the class to the heap. Visiting the contained values is
handled via a pure virtual method gather_roots(), which is being called
by the Heap's function of the same name; much like the VM has one.
From there, values are added to the roots HashTable if they are cells
for T = Value, and unconditionally for any other T.

As a small additional improvement the template now also takes an
inline_capacity parameter, defaulting to 32, and forwards it to the
Vector template; allowing for possible future optimizations of current
uses of MarkedValueList, which hard-codes it to 32.
2022-02-09 12:25:27 +00:00
Timothy Flynn
3c88749800 CI: Bundle and upload a js(1) release package
To include Serenity's LibJS on test262.report, we will need to integrate
with esvu. Create a .tar.gz with js(1) binary and the Lagom libraries it
it needs to run, and upload that package as a build artifact.
2022-02-09 12:19:56 +03:30