Commit Graph

25759 Commits

Author SHA1 Message Date
Ali Mohammad Pur
2b35e9f9be LibWasm: Generate Value::type() on the fly instead of storing it
The variant member already contains enough information to give us the
type when needed, so remove the type member and synthesize it when
needed, this allows lots of optimisation opportunaties when copying and
moving Values around.
2021-08-12 21:03:53 +02:00
Ali Mohammad Pur
f0e7e5bbe8 Meta: Un-escape escaped strings when generating Wasm tests 2021-08-12 21:03:53 +02:00
Ali Mohammad Pur
4060f18d7e LibWasm: Replace memory write macros with templated functions 2021-08-12 21:03:53 +02:00
Ali Mohammad Pur
b6381f785d LibWasm: Make memory operation address calculation match the spec
...or rather, match what the spec _means_ to say, not what it actually
says.
2021-08-12 21:03:53 +02:00
Ali Mohammad Pur
ad3de4648a LibWasm: Replace memory read macros with templated functions 2021-08-12 21:03:53 +02:00
Ali Mohammad Pur
563b402f04 LibWasm: Replace the numeric operation macros with templated functions
This should make debugging and profiling much better, at little to no
runtime cost.
Also moves off the operator definitions to a separate header, so it
should also improve the editing experience quite a bit.
2021-08-12 21:03:53 +02:00
Ali Mohammad Pur
799471d16f Meta: Don't roundtrip floats for i64/i32 hex literals in wasm tests 2021-08-12 21:03:53 +02:00
Ali Mohammad Pur
c6a137dbac AK: Add a IsSpecializationOf<T, Template> type trait 2021-08-12 21:03:53 +02:00
Ali Mohammad Pur
dcf795085b AK: Don't zero Variant data in the move constructor
There's no reason to zero the data that will be immediately overwritten.
2021-08-12 21:03:53 +02:00
Liav A
7ba991dc37 Kernel: Steer away from heap allocations for ProcFS process data
Instead, use more static patterns to acquire that sort of data.
2021-08-12 20:57:32 +02:00
Liav A
bf1adc2d5d Kernel+LibC: Use 64 bit values for ino_t
Since the InodeIndex encapsulates a 64 bit value, it is correct to
ensure that the Kernel is exposing the entire value and the LibC is
aware of it.

This commit requires an entire re-compile because it's essentially a
change in the Kernel ABI, together with a corresponding change in LibC.
2021-08-12 20:57:32 +02:00
Liav A
04c2addaa8 Kernel: Fail process creating earlier if can't create AddressSpace
It makes more sense to fail the Process creation earlier if we can't
create an AddressSpace for the new Process.
2021-08-12 20:57:32 +02:00
Liav A
01b79910b3 Kernel/Process: Move protected values to the end of the object
The compiler can re-order the structure (class) members if that's
necessary, so if we make Process to inherit from ProcFSExposedComponent,
even if the declaration is to inherit first from ProcessBase, then from
ProcFSExposedComponent and last from Weakable<Process>, the members of
class ProcFSExposedComponent (including the Ref-counted parts) are the
first members of the Process class.

This problem made it impossible to safely use the current toggling
method with the write-protection bit on the ProcessBase members, so
instead of inheriting from it, we make its members the last ones in the
Process class so we can safely locate and modify the corresponding page
write protection bit of these values.

We make sure that the Process class doesn't expand beyond 8192 bytes and
the protected values are always aligned on a page boundary.
2021-08-12 20:57:32 +02:00
Stephan Unverwerth
e405f436b6 3DFileViewer: Allow zooming via mouse wheel 2021-08-12 20:57:19 +02:00
Stephan Unverwerth
3c509cf2f7 3DFileViewer: Add magnification filters to texture menu 2021-08-12 20:57:19 +02:00
Stephan Unverwerth
00d527bc25 LibGL: Implement GL_LINEAR texture filter 2021-08-12 20:57:19 +02:00
Andreas Kling
00603d9fd0 Revert "HackStudio: Remove noop code when opening the project"
This reverts commit 012fc3f923.
2021-08-12 20:56:54 +02:00
Stephan Unverwerth
75bc7be622 3DFileViewer: Add texture menu
This allows setting different texture wrap modes
and setting different texture coordinate scale factors.
2021-08-12 18:58:41 +02:00
Stephan Unverwerth
b9523e15df LibGL: Implement glTexParameter{i,f}
This currently only implements a subset of this function.
Namely setting wrap, mag and min modes for the GL_TETXURE_2D target.
2021-08-12 18:58:41 +02:00
Stephan Unverwerth
e0fef60241 LibGL: Implement "mirrored repeat" wrap mode 2021-08-12 18:58:41 +02:00
Stephan Unverwerth
8902efa52d LibGL: Implement "clamp" wrap mode 2021-08-12 18:58:41 +02:00
Stephan Unverwerth
12785849aa LibGL: Turn Sampler2D into an actual class
This extracts the sampler functionality into its own class.
Beginning with OpenGL 3 samplers are actual objects, separate
from textures. It makes sense to do this already as it also
cleans up code organization quite a bit.
2021-08-12 18:58:41 +02:00
TheFightingCatfish
fdde19d616 Utilities: Add option to control when to use colored output for grep
Fixes #9351.
2021-08-12 18:57:21 +02:00
Jean-Baptiste Boric
072961090f Ports: Add cc symlink to gcc port 2021-08-12 18:56:30 +02:00
Jean-Baptiste Boric
c9d287b226 Ports: Add awk symlink to mawk port 2021-08-12 18:56:30 +02:00
Jean-Baptiste Boric
2084289162 Userland: Fix PATH environment variable ordering 2021-08-12 18:56:30 +02:00
Jean-Baptiste Boric
b1add5860b Base: Make /bin/Shell the login shell by default 2021-08-12 18:56:30 +02:00
Jean-Baptiste Boric
62cd3af5a0 LibC: Add stub forwarders to LibRegex C API
The POSIX C regex functions are expected to live in the C standard
library, but Serenity split off its regex library into LibRegex. Make a
compromise by implementing stub forwarders for the C regex library that
load libregex.so and call the real implementation.

This is needed for ports that expect these C functions to be available
inside the standard C library without introducing a strong coupling
between LibC and LibDl or LibRegex. The non-standard Serenity C++ regex
API still lives inside LibRegex as before.
2021-08-12 18:56:30 +02:00
Karol Kosek
012fc3f923 HackStudio: Remove noop code when opening the project
28b1e66b51 made that
the m_all_editor_wrappers vector is cleared everytime a project path
is changed (the m_project if check is just for the app launch --
the vector is empty there anyway), making the code never execute.
2021-08-12 18:55:58 +02:00
Karol Kosek
a2cb5c862d HackStudio: Show the 'Save as...' dialog when saving uncreated file
Previously when user wanted to save an uncreated file, the program
would just quietly ignore the save request, without giving any message.
This can be seen when creating a new editor in split view mode.
2021-08-12 18:54:57 +02:00
Karol Kosek
8516b9532e HackStudio: Add 'Save as...' action
Not adding it to the toolbar, because it has the same icon as
a typical 'Save' action.
2021-08-12 18:54:57 +02:00
Karol Kosek
8a4bb581a2 HackStudio: Show text editor after starting the application
The user can now start typing text instead of creating a file first.

This also enables drag-and-dropping a file as soon as the application
starts.
2021-08-12 18:54:25 +02:00
Gunnar Beutner
e4f0795ae4 LibELF+LibTest: Fix incorrect #ifdef 2021-08-12 08:16:07 +02:00
sin-ack
a871a2040b Meta: Properly quote some CMake variables in serenity_component
This probably isn't all of them, because I'm no CMake expert. :^)
It does however allow "/bin/false" to build now.
2021-08-12 07:48:50 +02:00
Jean-Baptiste Boric
9b2cc9580b Userland: Add partial support for complex specifications to tr 2021-08-12 00:41:13 +02:00
Jean-Baptiste Boric
310eb72f72 Userland: Add support for --delete flag as alias of -d to tr 2021-08-12 00:41:13 +02:00
Jean-Baptiste Boric
89ba022ede Userland: Add support for -c/--complement flag to tr 2021-08-12 00:41:13 +02:00
Jean-Baptiste Boric
7f2d3df906 Userland: Add support for multiple character translations to tr 2021-08-12 00:41:13 +02:00
Jean-Baptiste Boric
7a9d05c24c AK: Add contains(char) method to String 2021-08-12 00:41:13 +02:00
Andreas Kling
a29788e58a Kernel: Don't record sys$perf_event() if profiling is not enabled
If you want to record perf events, just enable profiling. This allows us
to add random perf events to programs without littering the file system
with perfcore files.
2021-08-12 00:03:40 +02:00
Andreas Kling
0c39f8128d LibTest: Emit a profile signpost at the start of each test
This makes it super easy to see which test is which when browsing a
profile of the test runner. :^)
2021-08-12 00:03:39 +02:00
Andreas Kling
1e90a3a542 Kernel: Make sys$perf_register_string() generate the string ID's
Making userspace provide a global string ID was silly, and made the API
extremely difficult to use correctly in a global profiling context.

Instead, simply make the kernel do the string ID allocation for us.
This also allows us to convert the string storage to a Vector in the
kernel (and an array in the JSON profile data.)
2021-08-12 00:03:39 +02:00
Andreas Kling
56e84a63ca LibJS: Emit a profile signpost when starting a garbage collection 2021-08-12 00:03:39 +02:00
Andreas Kling
3ed6c137df Profiler: Parse and render signpost strings
The first perf_event argument to a PERF_EVENT_SIGNPOST is now
interpreted as a string ID (in the profile strings set.)

This allows us to generate signposts with custom strings. :^)
2021-08-12 00:03:39 +02:00
Andreas Kling
4657c79143 Kernel+LibC: Add sys$perf_register_string()
This syscall allows userspace to register a keyed string that appears in
a new "strings" JSON object in profile output.

This will be used to add custom strings to profile signposts. :^)
2021-08-12 00:03:39 +02:00
Andreas Kling
00b11d7577 Profiler: Parse and paint profile signpost events :^)
Signposts generated by perf_event(PERF_EVENT_SIGNPOST) now show up in
profile timelines, and if you hover them you get a tooltip with the two
arguments passed with the event.
2021-08-12 00:03:38 +02:00
Andreas Kling
9ae8cd823c profile: Always enable PERF_EVENT_SIGNPOST 2021-08-12 00:03:38 +02:00
Andreas Kling
0d997d48ea Kernel+LibC: Add PERF_EVENT_SIGNPOST
This event will be used by userspace programs wanting to mark
interesting high-level events in the profile. :^)
2021-08-12 00:03:38 +02:00
Linus Groh
84053816d5 LibJS: Use Checked<T> for offsets in the SetViewValue AO
Fixes #9338.
2021-08-11 22:56:58 +01:00
Linus Groh
6fc0b2a43d LibJS: Use Checked<T> for offsets in the GetViewValue AO
Fixes #9336.
2021-08-11 22:56:58 +01:00