Commit Graph

7454 Commits

Author SHA1 Message Date
howar6hill
1c83c5ed08 LibJS: Implement While statements 2020-03-09 10:13:27 +01:00
Mr.doob
4dee1ec0be
js: Fixed program comment (#1391) 2020-03-09 07:33:39 +01:00
Stephan Unverwerth
1207187e97 LibJS: GC: Remove clear_all_mark_bits()
Clearing all marked flags has been integrated into the sweep function,
saving an additional full iteration over the heap.
2020-03-09 07:32:09 +01:00
Andreas Kling
b956e2d939 AK: Remove all the AK .host.o files on "make clean" in AK/Tests
This is a bit hackish, but sometimes these files stick around and mess
up rebuilds.
2020-03-08 21:40:40 +01:00
Andreas Kling
d9126b1ad5 js: Exercise the garbage collector a little bit 2020-03-08 19:59:59 +01:00
Andreas Kling
63e4b744ed LibJS: Add a basic mark&sweep garbage collector :^)
Objects can now be allocated via the interpreter's heap. Objects that
are allocated in this way will need to be provably reachable from at
least one of the known object graph roots.

The roots are currently determined by Heap::collect_roots().

Anything that wants be collectable garbage should inherit from Cell,
the fundamental atom of the GC heap.

This is pretty neat! :^)
2020-03-08 19:23:58 +01:00
howar6hill
6da131d5db AK: Reduce code duplication in StringBuilder 2020-03-08 17:08:18 +01:00
howar6hill
d8df9c510c AK: Improve the API of StringBuilder 2020-03-08 17:08:18 +01:00
Liav A
0433c0780d AK: Use default constructor of Optional if an unset bit is not found 2020-03-08 14:13:30 +01:00
Liav A
4479e874da Kernel: Ensure RTL8139NetworkAdapter uses virtual memory correctly 2020-03-08 14:13:30 +01:00
Liav A
9dbc273675 Kernel: Ensure E1000NetworkAdapter uses virtual memory correctly 2020-03-08 14:13:30 +01:00
Liav A
d6e122fd3a Kernel: Allow contiguous allocations in physical memory
For that, we have a new type of VMObject, called
ContiguousVMObject, that is responsible for allocating contiguous
physical pages.
2020-03-08 14:13:30 +01:00
Ben Wiederhake
b066586355 Kernel: Fix race in waitid
This is similar to 28e1da344d
and 4dd4dd2f3c.

The crux is that wait verifies that the outvalue (siginfo* infop)
is writable *before* waiting, and writes to it *after* waiting.
In the meantime, a concurrent thread can make the output region
unwritable, e.g. by deallocating it.
2020-03-08 14:12:12 +01:00
Ben Wiederhake
d8cd4e4902 Kernel: Fix race in select
This is similar to 28e1da344d
and 4dd4dd2f3c.

The crux is that select verifies that the filedescriptor sets
are writable *before* blocking, and writes to them *after* blocking.
In the meantime, a concurrent thread can make the output buffer
unwritable, e.g. by deallocating it.
2020-03-08 14:12:12 +01:00
Ben Wiederhake
36ba0a35ee Travis: Cache toolchain
This should give a significant boost to Travis speeds, because most of the
compile time is spent building the toolchain over and over again.
However, the toolchain (or libc or libm) changes only rarely,
so most rebuilds can skip this step.

The hashing has been put into a separate file to keep it
as decoupled as possible from BuiltIt.sh.
2020-03-08 14:09:08 +01:00
Ben Wiederhake
0edae63cc0 Kernel: Fix inconsistent inclusion style
This also makes it easier to automatically parse the dependency tree.
Thankfully, this is the only place where a change was necessary.
2020-03-08 14:09:08 +01:00
howar6hill
e72fb8f594 LibC: Fix a bug involving miscalculating week counts of last year 2020-03-08 13:56:01 +01:00
howar6hill
df40847c52 LibC: Reimplement asctime() in terms of strftime() 2020-03-08 13:56:01 +01:00
Andreas Kling
32f15f3c45 AK: Remove unused InlineLRUCache template
This was not used by anyone. If we ever need it, we can bring it back.
2020-03-08 13:13:34 +01:00
Andreas Kling
900f51ccd0 AK: Move memory stuff (fast memcpy, etc) to a separate header
Move the "fast memcpy" stuff out of StdLibExtras.h and into Memory.h.
This will break a ton of things that were relying on StdLibExtras.h
to include a bunch of other headers. Fix will follow immediately after.

This makes it possible to include StdLibExtras.h from Types.h, which is
the main point of this exercise.
2020-03-08 13:06:51 +01:00
Andreas Kling
fa9fba6901 Kernel: Add missing #includes now that <AK/StdLibExtras.h> is smaller 2020-03-08 13:06:51 +01:00
Andreas Kling
37fc6c117c Userspace: Add missing #includes now that AK/StdLibExtras.h is smaller 2020-03-08 13:06:51 +01:00
Andreas Kling
35d88f536c AK: Use __builtin_memset() and such to reduce header dependencies
We can use __builtin_memset() without including <string.h>.
This is pretty neat, as it will allow us to reduce the header deps
of AK templates a bit, if applied consistently.

Note that this is an enabling change for an upcoming #include removal.
2020-03-08 13:06:51 +01:00
Andreas Kling
b1058b33fb AK: Add global FlatPtr typedef. It's u32 or u64, based on sizeof(void*)
Use this instead of uintptr_t throughout the codebase. This makes it
possible to pass a FlatPtr to something that has u32 and u64 overloads.
2020-03-08 13:06:51 +01:00
Andreas Kling
b98d8ad5b0 AK: Add a Conditional<condition, TrueType, FalseType> template
This allows you to select a type based on a compile-time condition.
2020-03-08 13:06:51 +01:00
howar6hill
10e0d4a196
LibCore: Add format option for DateTime::to_string() (#1358) 2020-03-08 11:35:26 +01:00
0xtechnobabble
b6307beb6e LibJS: Implement if statements
If statements execute a certain action or an alternative one depending
on whether the tested condition is true or false, this commit helps
establish basic control flow capabilities in the AST.
2020-03-08 11:15:07 +01:00
0xtechnobabble
a96bf2c22e LibJS: Implement logical expressions
Logical expressions are expressions which can return either true or
false according to a provided condition.
2020-03-08 11:15:07 +01:00
0xtechnobabble
4e62dcd6e6 LibJS: Add typed comparison operator
The `===` operator allows us to compare two values while taking their
type into consideration.
2020-03-08 11:15:07 +01:00
0xtechnobabble
3fb0ff102c LibJS: Allow the dumping of literals that aren't numbers 2020-03-08 11:15:07 +01:00
Tibor Nagy
0d17e3bfa6 LibGUI: Fix null-termination of TextDocumentLine 2020-03-08 10:31:48 +01:00
Andreas Kling
0c7058aaa0 LibJS: Include the operator in BinaryExpression dumps 2020-03-07 23:17:07 +01:00
Andreas Kling
1611071ac7 LibJS: Flesh out JS::Value a little bit more 2020-03-07 23:17:07 +01:00
Andreas Kling
d52130836e LibJS: Simplify LogStream::operator<<(JS::Value) and move to .cpp file 2020-03-07 23:17:07 +01:00
Elisée Maurer
cbe0053a97 LibJS: Fix string representation for value of type undefined 2020-03-07 23:15:36 +01:00
Andreas Kling
f5476be702 LibJS: Start building a JavaScript engine for SerenityOS :^)
I always tell people to start building things by working on the thing
that seems the most interesting right now. The most interesting thing
here was an AST + simple interpreter, so that's where we start!

There is no lexer or parser yet, we build an AST directly and then
execute it in the interpreter, producing a return value.

This seems like the start of something interesting. :^)
2020-03-07 19:42:11 +01:00
Andreas Kling
f2f16e1c24 IPv4: Keep IPv4 socket locked during receive operations
We unlock/relock around blocking, but outside of that we now keep the
socket locked.

This fixes an intermittent ASSERT(m_can_read) failure.
2020-03-07 11:27:55 +01:00
Andreas Kling
7a9cb2dfca LibWeb: Cache the <body background> style image value
This way we don't refetch the background image every time style is
recomputed (e.g when hovering different elements.)
2020-03-07 11:17:18 +01:00
Andreas Kling
8f25dbf394 Shell: Fix silly stack overflow in 'cd' builtin
Let's write in C++ and we won't have as many C problems. :^)
2020-03-07 11:02:11 +01:00
Andreas Kling
830a57c6b2 LibWeb: Rename directory LibHTML => LibWeb
Let's rename this to LibWeb since it aims to provide more parts of the
web platform than just HTML. :^)
2020-03-07 10:32:51 +01:00
Andreas Kling
7a6c4a72d5 LibWeb: Move everything into the Web namespace 2020-03-07 10:27:02 +01:00
Shannon Booth
6a3b12664a LibGUI: Move Icon and FontDatabase into the GUI namespace
We also clean up some old references to the old G prefixed GUI classes

This also fixes a potential bug with using: C_OBJECT_ABSTRACT(GAbstractButton)
instead of C_OBJECT_ABSTRACT(AbstractButton)
2020-03-07 01:33:53 +01:00
Shannon Booth
57f1c919df LibCore: Remove all remaining C prefix references
LibCore's GZip is also moved into the Core namespace with this change.
2020-03-07 01:33:53 +01:00
Andreas Kling
4a271430f8 Shell: Set up the PWD environment variable early
This ensures that PWD is set when running "sh -c something"
2020-03-07 00:25:30 +01:00
Shannon Booth
d7cfe61fe4 Userland: Use ArgsParser in crash 2020-03-06 22:46:17 +01:00
Liav A
f3f8b88d8f Kernel: Fix syntax error in FIFO_DEBUG 2020-03-06 22:29:24 +01:00
Tibor Nagy
30152b6c88 Kernel: Fix syntax errors in PS2MOUSE_DEBUG
Found with Cppcheck.
2020-03-06 22:20:53 +01:00
rhin123
72ef3e529a TerminalWidget: Implement ALT selection
When holding ALT & selecting text, the terminal now forms a rectangle
selection similar to other terminal behaviors.
2020-03-06 20:20:02 +01:00
howar6hill
4ba206b7e5 LibC: Fix a indentation problem in time.cpp 2020-03-06 20:15:07 +01:00
Liav A
a6c53cadc8 Meta: Claim copyright on PCI files 2020-03-06 16:03:58 +01:00