Commit graph

21891 commits

Author SHA1 Message Date
Itamar
8f074222e8 LibCpp: Make 'bool' a Token::Type::KnownType 2021-06-09 22:26:46 +02:00
Gunnar Beutner
9dc9ddbf82 LibJS: Fix evaluation order for tagged template literals
This ensures that the tag function is evaluated first.
2021-06-09 22:26:27 +02:00
Gunnar Beutner
2d48fe894f LibJS: Generate bytecode for tagged template literals 2021-06-09 21:54:31 +02:00
Gunnar Beutner
25ab31219c LibJS: Fix the return value for TemplateLiteral
This ensures that the bytecode generated for TemplateLiterals returns
the correct value.
2021-06-09 21:50:39 +02:00
Tobias Christiansen
6d3361f077 LibWeb: Fix logic issue when parsing CSS custom properties
With best wishes from De Morgan, this is the correct way to check
whether the string isn't of the form "var(...)".
2021-06-09 21:50:22 +02:00
Liav A
b54bfdd696 Kernel/PCI: Remove UNMAP_AFTER_INIT from a few methods
This fixes #7942.

We can't unmap these methods because they can be called after the boot
process from lspci(8) utility, or by using the SystemMonitor program
(and looking into the "PCI devices" tab).
2021-06-09 20:15:14 +01:00
Andreas Kling
d69cd3f5bf LibJS: Don't create lexical environment for native (C++) function calls
This was creating a ton of pointless busywork for the garbage collector
and can be avoided simply by tolerating that the current call frame has
a null scope object for the duration of a NativeFunction activation.
2021-06-09 20:54:01 +02:00
Thiago Henrique Hupner
d0bed24ca1 Ports: Add ZSH port 2021-06-09 19:41:23 +01:00
Thiago Henrique Hupner
4850cf9069 LibC: Add stub implementation for sigsuspend
Currently, ZSH tries to call this function and it always asserts,
so adding a stub to allow ZSH at least open.
2021-06-09 19:41:23 +01:00
Thiago Henrique Hupner
0f5a23d082 LibC: Make tgetnum() return -1 if capability is not available 2021-06-09 19:41:23 +01:00
Ali Mohammad Pur
aa2916c21b LibWasm: ALWAYS_INLINE some very hot functions
These function couldn't be inlined before because the compiler would've
started flagging invalid paths in Variant as maybe-uninitialized.
2021-06-09 23:05:32 +04:30
Ali Mohammad Pur
d3db45c60b AK: Make Vector::take_last() ALWAYS_INLINE
This function doesn't do a whole lot, but is called quite a bit.
2021-06-09 23:05:32 +04:30
Ali Mohammad Pur
8410d6aadb AK: Make a bunch of Variant methods ALWAYS_INLINE 2021-06-09 23:05:32 +04:30
Ali Mohammad Pur
50349de38c Meta: Disable -Wmaybe-uninitialized
It's prone to finding "technically uninitialized but can never happen"
cases, particularly in Optional<T> and Variant<Ts...>.
The general case seems to be that it cannot infer the dependency
between Variant's index (or Optional's boolean state) and a particular
alternative (or Optional's buffer) being untouched.
So it can flag cases like this:
```c++
if (index == StaticIndexForF)
    new (new_buffer) F(move(*bit_cast<F*>(old_buffer)));
```
The code in that branch can _technically_ make a partially initialized
`F`, but that path can never be taken since the buffer holding an
object of type `F` and the condition being true are correlated, and so
will never be taken _unless_ the buffer holds an object of type `F`.

This commit also removed the various 'diagnostic ignored' pragmas used
to work around this warning, as they no longer do anything.
2021-06-09 23:05:32 +04:30
Ali Mohammad Pur
45710d0724 LibWasm: Implement saturating float truncation instructions
With these, the only remaining unimplemented instructions are the
following:
- memory.init
- data.drop
- memory.copy
- memory.fill
- table.init
- elem.drop
- table.copy
- table.grow
- table.size
- table.fill
2021-06-09 23:05:32 +04:30
Ali Mohammad Pur
3a44011cd4 LibWasm: Implement sign extension instructions 2021-06-09 23:05:32 +04:30
Ali Mohammad Pur
a4c4dd928b LibWasm: Implement spec-compliant float min/max ops 2021-06-09 23:05:32 +04:30
Ali Mohammad Pur
ccc79149d4 wasm: Add a help command to the shell mode and start it on --shell 2021-06-09 23:05:32 +04:30
Nick Miller
2b789adc16 LibAudio: Add support for WAVE_FORMAT_EXTENSIBLE
This enables support for playing float32 and float64
WAVE_FORMAT_EXTENSIBLE files.

The PCM data format is encoded in the
first two bytes of the SubFormat GUID inside of the
WAVE_FORMAT_EXTENSIBLE `fmt` chunk.

Also, fixed the RIFF header size check to allow up to
maximum_wav_size (currently defined as 1 GiB).
The RIFF header size is the size of the entire
file, so it should be checked against the largest Wave size.
2021-06-09 22:58:44 +04:30
Liav A
d183f4b03f Documentation: Add a list of supported network cards 2021-06-09 22:44:09 +04:30
Liav A
84b2dc0fb8 Meta: Use Intel 82574 instead of Intel 82540 in the run script 2021-06-09 22:44:09 +04:30
Liav A
c6480a0426 Kernel/Net: Support Intel 82574 adapter
We call it E1000E, because the layout for these cards is somewhat not
the same like E1000 supported cards.

Also, this card supports advanced features that are not supported on
8254x cards.
2021-06-09 22:44:09 +04:30
Liav A
2e2201e8e1 Kernel/CommandLine: Add option to disable physical networking hardware
This is useful for debugging sessions mostly.
2021-06-09 22:44:09 +04:30
Liav A
1c94b5e8eb Kernel: Introduce the NetworkingManagement singleton
Instead of initializing network adapters in init.cpp, let's move that
logic into a separate class to handle this.
Also, it seems like a good idea to shift responsiblity on enumeration
of network adapters after the boot process, so this singleton will take
care of finding the appropriate network adapter when asked to with an
IPv4 address or interface name.

With this change being merged, we simplify the creation logic of
NetworkAdapter derived classes, so we enumerate the PCI bus only once,
searching for driver candidates when doing so, and we let each driver
to test if it is resposible for the specified PCI device.
2021-06-09 22:44:09 +04:30
Jelle Raaijmakers
8b1d4d1b8e Ports: Build an .so file for SQLite 2021-06-09 20:04:25 +02:00
Jelle Raaijmakers
832127121b Ports: Update SQLite to version 3.35.5 2021-06-09 20:04:25 +02:00
Gunnar Beutner
6af7e74a25 LibJS: Don't generate code after we've encountered a terminating op 2021-06-09 20:04:11 +02:00
Gunnar Beutner
d198e41f74 LibJS: Stop bytecode execution after we've encountered an exception 2021-06-09 20:04:11 +02:00
Gunnar Beutner
b78f1c1261 LibJS: Generate bytecode for throw statements 2021-06-09 20:04:11 +02:00
Timothy
e9bafd768d Browser: Fix crash on download
This will unveil the portal for RequestServer which is used to
download files in the Browser.
2021-06-09 18:10:27 +01:00
Sam Atkins
a8946eb888 LibMarkdown: Wrap non-inline code blocks in <pre>
This fixes #7131

The parser already distinguishes between inline code (handled in
Text.cpp) and triple-tick code blocks, so only
CodeBlock::render_to_html() needed to change. Blank lines within
a code block still cause issues, but that's an HTML issue. (#7121)
2021-06-09 18:06:54 +01:00
Idan Horowitz
f437793788 LibJS: Stop inheriting from Set in SetPrototype
This makes sure that is<Set> checks done on the Set prototype instead of
on Set instances return false, thereby emulating the behaviour of the
RequireInternalSlot abstract operation.
2021-06-09 18:01:19 +01:00
Apoorv Mishra
5d57384bc4 Meta: Check installed QEMU version
`ninja install` fails with a clueless error message if the installed
QEMU version is less than 5.0.
2021-06-09 18:53:32 +02:00
Jelle Raaijmakers
340f6cde2d Ports: Use shared icon logic for ScummVM 2021-06-09 18:53:21 +02:00
Sam Atkins
6f92d1e639 LibGUI: Set TextEditor to unmodified after saving size=0 files
This fixes #7946

Previously, TextEditor::write_to_file() would not mark its document
as unmodified if the file size was 0. This caused a desync in the
Text Editor app between the window's is_modified state and the
TextEditor's. It's already noted in the comments of the app's
save action code that propagating the modified state automatically
would be good, and it would solve issues like this, but I'm not yet
familiar enough with the code to try a change like that.
2021-06-09 18:53:13 +02:00
Andreas Kling
5b47e9b39a Meta: Remove references to the abandoned IRC channel 2021-06-09 18:38:25 +02:00
Idan Horowitz
ad0e3c0e54 LibJS: Mark heap cell values stored in Set instances
This makes sure they dont get garbage collected while stored in a Set.
2021-06-09 17:05:53 +01:00
Gunnar Beutner
6a0d1fa259 LibJS: Store strings in a string table
Instead of using Strings in the bytecode ops this adds a global string
table to the Executable struct which individual operations can refer
to using indices. This brings bytecode ops one step closer to being
pointer free.
2021-06-09 17:42:52 +02:00
Max Wipfli
4efccbd030 LookupServer: Watch /etc/hosts for changes during runtime
This adds a FileWatcher to the LookupServer which watches '/etc/hosts'
for changes during runtime and reloads its contents. If the file is
deleted, m_etc_hosts will be cleared.

Since we now need to access '/etc/hosts' later during runtime, it needs
to be unveiled with read permissions.
2021-06-09 17:43:32 +04:30
Max Wipfli
7b39db3bf4 LookupServer: Check for hostname after /etc/hosts
If the hostname is not in /etc/hosts, looking it up should return
127.0.0.1.
2021-06-09 17:43:32 +04:30
Max Wipfli
12feb79cef LookupServer: Make DNSName::operator== ignore case 2021-06-09 17:43:32 +04:30
Max Wipfli
95d4d36b5c LookupServer: Modernize load_etc_hosts()
This reworks the LookupServer::load_etc_hosts() method to use the
IPv4Address APIs instead of trying to parse an IPv4 address itself.

It also adds a few error checks for invalid entries in /etc/hosts,
trims away leading and trailing whitespace from lines and tries to use
StringView over String.
2021-06-09 17:43:32 +04:30
Max Wipfli
d1dae5f4d1 AK: Implement IPv4Address::to_string_reversed() 2021-06-09 17:43:32 +04:30
Gunnar Beutner
a4d5745e2f Ports: Remove checksum for the stpuzzles port
The Git repository is hosted on GitHub and is owned by the SerenityOS
GitHub organization which means our root of trust is GitHub anyway
(where did you get _this_ repository from?) So let's remove the
checksum.
2021-06-09 17:39:00 +04:30
Gunnar Beutner
a5e6a373cc Ports: Embed icons for the stpuzzles port 2021-06-09 17:39:00 +04:30
Max Trussell
b889bfe0f6 Ports: .port_include.sh add install_icon function 2021-06-09 17:37:56 +04:30
Nick Miller
23d5b99fbf LibAudio: Make Loader::seek() treat its input as a sample index
This fixes a bug where if you try to play a Wave file a second
time (or loop with `aplay -l`), the second time will be pure
noise.

The function `Audio::Loader::seek` is meant to seek to a specific
audio sample, e.g. seek(0) should go to the first audio sample.
However, WavLoader was interpreting seek(0) as the beginning
of the file or stream, which contains non-audio header data.

This fixes the bug by capturing the byte offset of the start of the
audio data, and offseting the raw file/stream seek by that amount.
2021-06-09 17:30:08 +04:30
Idan Horowitz
2a3090d292 LibJS: Add the SetIterator built-in and Set.prototype.{values, entries}
While this implementation should be complete it is based on HashTable's
iterator, which currently follows bucket-order instead of the required
insertion order. This can be simply fixed by replacing the underlying
HashTable member in Set with an enhanced one that maintains a linked
list in insertion order.
2021-06-09 11:48:04 +01:00
Idan Horowitz
0b0f1eda05 LibJS: Add most of the Set.prototype methods
Specifically all aside from "values" and "entries" which require an
implementation of the SetIterator object.
2021-06-09 11:48:04 +01:00
Idan Horowitz
670be04c81 LibJS: Add the Set built-in object 2021-06-09 11:48:04 +01:00