Commit Graph

17932 Commits

Author SHA1 Message Date
Linus Groh
f9287fca1e LibJS: Don't try to derive function source from ProxyObject
There are three JS::Function types that are not ScriptFunction:
NativeFunction, BoundFunction and ProxyObject. We were only checking for
the first two when determining whether to reconstruct the function's
source code, which was leading to a bad cast to ScriptFunction.

Since only ScriptFunction has the [[SourceText]] internal slot, I simply
swapped the branches here.

Fixes #5775.
2021-03-14 19:22:16 +01:00
Idan Horowitz
02b4cb96f8 LibCompress: Decrease CanonicalCode's size on stack
This commit stores the bit codes as u16s instead of u32s as the
maximum code bit length in DEFLATE is 15.
2021-03-14 14:52:21 +01:00
Brendan Coles
ab9f66a069 UserspaceEmulator: Increase stack size from 64 * KiB to 1 * MiB 2021-03-14 13:55:29 +01:00
Brendan Coles
6bc01909b7 readelf: Add support for core notes and relocations 2021-03-14 13:55:07 +01:00
Linus Groh
304e193836 LibJS: Fix some issues in RegExp.prototype[@@match]
- We were not passing the to_string()'d argument to the exec function
  but the original argument
- We were leaking an empty value in two cases, which almost certainly
  will crash something down the line
- We were not checking for exceptions after to_string() and get(), which
  both may throw. If the getter is an accessor, it'll assert upon being
  called with the VM already storing an exception.
2021-03-14 12:24:57 +01:00
Linus Groh
b68509569e LibJS: Fix String.prototype.match() for non-string argument
This is supposed to pass the to_string()'d argument to @@match, not the
this value.
2021-03-14 12:24:57 +01:00
Linus Groh
32052b3198 LibJS: Fix flags check in regexp_create()
We need to check for undefined, not empty - otherwise it will literally
use "undefined" as the flags, which will fail (Invalid RegExp flag 'n').
2021-03-14 12:24:57 +01:00
Linus Groh
6d2d8d091f LibJS: Add the same Object::invoke() overloads as VM::call() 2021-03-14 12:24:57 +01:00
Ben Wiederhake
6cf8e3c980 Ports: Make gnuplot build fail later 2021-03-14 11:30:38 +01:00
Ben Wiederhake
430e7fb181 LibC: Rename feclearexcept{s,}
This will also help with making ports compile again :D
https://github.com/SerenityOS/serenity/pull/5762#issuecomment-798779561
2021-03-14 11:30:38 +01:00
Ben Wiederhake
60b458f5b3 Ports: Fix 'bc' port
Previously, these features were apparently auto-disabled, because we do not yet
support and never did support translations or the FIONREAD ioctl.
2021-03-14 11:30:38 +01:00
Ben Wiederhake
071b31338a Ports: Remove ever-broken 'editline' build
I'm sorry @The-King-of-Toasters, but it never worked and apparently noone uses/fixes it,
so let's remove it? Alternatively, see discussion in #2677.
2021-03-14 11:30:38 +01:00
Ben Wiederhake
4100aa52d9 Ports: Fix cross-compiling git for serenity
No idea how this is supposed to work, because git's buildscripts execute
'uname -S' to determine which functions are available - and that's not how
cross-compilation works.
2021-03-14 11:30:38 +01:00
Ben Wiederhake
e23fc195e7 Ports: Fix package.sh executable bits 2021-03-14 11:30:38 +01:00
Luke
c983e42e8c Lagom/Fuzzers: Add fuzzers for the new Gzip and Deflate compressors 2021-03-14 11:28:12 +01:00
Luke
d27e6f0961 Lagom/Fuzzers: Add fuzzers for Latin 1, Latin 2 and UTF16-BE
No fuzzer for UTF-8 as it (currently) just returns the input.
2021-03-14 11:27:52 +01:00
Luke
7427e3a8a6 LibTextCodec: Fix IBM666 => IBM866 typo 2021-03-14 11:27:52 +01:00
Idan Horowitz
7e587a615e LibCompress: Handle literal only lz77 streams in DeflateCompressor
Very incompressible data could sometimes produce no backreferences
which would result in no distance huffman code being created (as it
was not needed), so VERIFY the code exists only if it is actually
needed for writing the stream.
2021-03-14 11:05:35 +01:00
Andreas Kling
1db943e146 LibJS: Implement (mostly) String.prototype.match
JavaScript has a couple of different ways to run a regular expression
on a string. This adds support for one more. :^)
2021-03-14 11:04:50 +01:00
Brendan Coles
2c24c0e451 UserspaceEmulator: SoftCPU: Add support for FPTAN instruction 2021-03-14 09:45:22 +01:00
Idan Horowitz
b1e3176f9f LibCompress: Replace goto with simple recursion in DeflateCompressor
This is just a bit easier on the eyes :^)
2021-03-13 23:50:07 +01:00
Idan Horowitz
1b7b503bae AK: Add fast paths for aligned bit writes in BitOutputStream
If the bit write is aligned (or has been aligned during the write) we can
write in multiples of 32/16/8 bits for increased performance.
2021-03-13 23:50:07 +01:00
Idan Horowitz
3c7aa56ae8 AK: Store BinaryHeap key-value pairs together for efficient swaps
The 2 seperate key and value arrays are replaced with a single struct pair
array that allows for a 2x reduction in loads/stores during element swaps
in the common case of same-sized keys and values.
2021-03-13 23:50:07 +01:00
Linus Groh
161b36bb09 Ports: Update c-ray patches 2021-03-13 22:44:16 +01:00
Linus Groh
caa8f3d3bf LibM: Implement tanf() in terms of tan() with casts
Lazy, but it works for now. :^)
2021-03-13 22:44:16 +01:00
Ben Wiederhake
115e8f5977 Meta: Make GA logs less misleading
If the job fails early (e.g. during linting), the 'cat debug.log' step would *also* fail.
This would confuse GA into thinking that this is the crucial thing and highlights it.
This misleads the user into looking at the wrong thing.
2021-03-13 22:42:20 +01:00
Ben Wiederhake
100ce8fc1f Toolchain: Always strip compiler, not just on CI 2021-03-13 22:42:20 +01:00
Andreas Kling
33e3f0c71f LibWeb: Expose barebones CSSStyleDeclaration to JavaScript
You can now access an element's inline style via Element.style.
The interface is not very capable yet though. :^)
2021-03-13 22:41:32 +01:00
Andreas Kling
0759f54bd3 LibWeb: Rename StyleDeclaration => CSSStyleDeclaration to match CSSOM 2021-03-13 22:41:32 +01:00
Andreas Kling
e44fbbe5c0 Base: Remove ANSI color ladybug text file
This was part of a neofetch-like program we had a long time ago,
but has long since been removed.
2021-03-13 22:41:32 +01:00
Idan Horowitz
b3b920eddc tar: Implement tar archive creation
This completes our tar utility by implementing the -c option
for archive creation using TarOutputStream and optionally
GzipCompressor for compression via the -z option.
2021-03-13 20:07:25 +01:00
Idan Horowitz
7eab20bad0 LibTar: Implement TarOutputStream
This output stream creates gnu format tar archives
and currently only supports files and directories.
2021-03-13 20:07:25 +01:00
Idan Horowitz
6c1322bdc7 LibTar: Support ustar tar format
Since we ignore both the ustar prefix field and the gnu extended
header right now anyways, we can just accept both formats as the
rest of the header is exactly the same.
2021-03-13 20:07:25 +01:00
Idan Horowitz
512431a228 test-compress: Add GZip compression tests 2021-03-13 20:07:25 +01:00
Idan Horowitz
135751c3a2 LibCompress: Implement GZip compression
This commit implements a stream compressor for the gzip
specification (RFC 1952), which is essentially a thin
wrapper around the DEFLATE compression format.
2021-03-13 20:07:25 +01:00
Idan Horowitz
02569bec11 test-compress: Add DEFLATE compression tests 2021-03-13 20:07:25 +01:00
Idan Horowitz
bcbfa7db62 LibCompress: Implement DEFLATE compression
This commit adds a fully functional DEFLATE compression
implementation that can be used to implement compression
for higher level formats like gzip, zlib or zip.

A large part of this commit is based on Hans Wennborg's
great article about the DEFLATE and zip specifications:
https://www.hanshq.net/zip.html
2021-03-13 20:07:25 +01:00
Idan Horowitz
168cf6fac9 AK: Implement minimum BinaryHeap
This enables efficient implementations of priority queues,
and will also be used in LibCompress for efficient huffman
tree generation.
2021-03-13 20:07:25 +01:00
Idan Horowitz
0ddc0e45ae AK: Add OutputBitStream class
This will be used in the deflate compressor.
2021-03-13 20:07:25 +01:00
AnotherTest
5a0ebdb109 LibLine: Treat DEL as backspace by default
This can come in handy when telneting in.
2021-03-13 19:34:25 +01:00
AnotherTest
745b0800be LibLine: Don't try to print chars larger than 63 in caret form
Instead, mask them as `\xbb` so that e.g. DEL becomes `\x7f`.
Fixes #5752.
2021-03-13 19:34:25 +01:00
Linus Groh
4b65ba27ec Terminal: Create config file parent directories before unveil()'ing
Otherwise unveil() will fail, as even with "c" permissions the file's
parent directory must exist.

Fixes #5651.
2021-03-13 18:48:37 +01:00
Linus Groh
5e4808878d Ports: Fix klong's package.sh 2021-03-13 13:35:24 +01:00
Linus Groh
15a820e9ad Ports: Use SERENITY_ARCH in .port_include.sh if already defined
Instead of always hardcoding i686, only use it as fallback value as we
already do in other scripts.
2021-03-13 13:13:03 +01:00
Linus Groh
4c497228a9 Ports: Use SERENITY_ARCH in --target/--host
Recent ports already do this, let's update the others as well. One step
closer to multi-arch support for ports! :^)
2021-03-13 13:13:03 +01:00
Linus Groh
7cb9237be9 Ports: Remove/replace hardcoded i686-pc-serenity-{gcc,g++,ar,ranlib}
Except in the Lua port's Makefile patch, I couldn't figure this out...
2021-03-13 13:13:03 +01:00
Linus Groh
f9cf6bfce1 Ports: Remove redundant 'workdir' entries 2021-03-13 13:13:03 +01:00
Linus Groh
37f837bde7 Ports: Replace hardcoded versions in 'files' URLs
Let's just use $version everywhere (we already do this for most ports).
2021-03-13 13:13:03 +01:00
Ben Wiederhake
81079ae616 AK: Fix some overflows/underflows that weren't properly handled
Based on #5699. Closes #5699.
2021-03-13 10:17:28 +01:00
Tom
8a8bdb2cd7 AK: Add decrement operator to Checked 2021-03-13 10:17:28 +01:00