Commit Graph

33017 Commits

Author SHA1 Message Date
Timothy Flynn
bc719e7bac AK: Put an empty new line between function definitions in AK::Time
There was over 110 lines without a single line break, let's give our
eyes a break.
2022-01-19 21:20:41 +00:00
Linus Groh
7d521b7c7c LibJS: Implement Function.prototype.toString() according to the spec
That's an old yak :^)
No, past me, AST nodes do not need to learn to stringify themselves.
This is now massively simplified by using the [[SourceText]] internal
slot.

Also updates a bunch of tests that are incorrect due to the old
implementation not being spec compliant, and add plenty more.
2022-01-19 20:33:08 +00:00
Linus Groh
1ee7e97e24 LibJS: Pass source text to ECMAScriptFunctionObject::create() 2022-01-19 20:33:08 +00:00
Linus Groh
6e5097b201 LibJS: Let class_definition_evaluation() return a ESFnObject*, not Value
No need to hide this very specific Object type in a generic Value.
2022-01-19 20:33:08 +00:00
Linus Groh
531d1ac734 LibJS: Capture source text of FunctionNode and ClassExpression 2022-01-19 20:33:08 +00:00
Linus Groh
95a9f12b97 LibJS: Set Token's m_offset to the value's start index
This makes much more sense than the current way of setting it to the
Lexer's m_position after consuming the full value.
2022-01-19 20:33:08 +00:00
Liav A
c1d3b557d5 Kernel/PCI: Don't try to enumerate 255 functions on the host bridge
There can only be a limited number of functions (only 8).
Also, consider the start bus of the PCI domain when trying to enumerate
other host bridges on bus 0, device 0, functions 1-7 (function 0 is the
main host bridge).
2022-01-19 21:54:41 +02:00
Liav A
518473846a Kernel/PCI: Start enumeration in specified start bus of the PCI domain
Some devices, like the Intel Volume Management Device, might have bus
numbering restrictions (so numbers can be from 224 to 225, for example).
2022-01-19 21:54:41 +02:00
Liav A
0833ae0b36 Kernel/PCI: Don't hardcode Address domain to 0 when enumerating devices 2022-01-19 21:54:41 +02:00
Liav A
667a009cd7 Kernel/PCI: Don't cast a domain number to u16
Found by Tom (tomuta) during a debug session of these changes.
2022-01-19 21:54:41 +02:00
Linus Groh
b2c6206adb LibJS: Add missing definition of AsyncFunction.prototype.constructor
We also forgot to allocate an AsyncFunctionConstructor and assign it to
m_async_function_constructor during GlobalObject initialization, whoops!
2022-01-19 19:42:45 +00:00
Linus Groh
7d0782f308 LibJS: Remove duplicate definition of AsyncGeneratorFunction.prototype 2022-01-19 19:26:03 +00:00
Stephan Unverwerth
a5040ecdfc LibSoftGPU: Reduce number of samplers to 2
OpenGL mandates at least 2 texture units when multitexturing is
supported. This keeps our vertices lean and gives a nice speed
improvement in glquake. Until we support shaders this should be enough.
2022-01-19 19:57:49 +01:00
Stephan Unverwerth
12f63df329 LibGL+LibSoftGPU: Support generation of multiple texture coordinates 2022-01-19 19:57:49 +01:00
Stephan Unverwerth
bc17a87450 LibGL: Also track active texture unit index
In addition to tracking a pointer to the active texture unit we also
track its index in the array.
2022-01-19 19:57:49 +01:00
Stephan Unverwerth
9627576d9c LibGL: Track multiple current texture coordinates in GLContext
Previously we only had a single current texture coordinate, set by
the glTexCoord family of functions. Since we now can have multiple
texture coordinates we track a vector of current texture coordinates
and set the requested one in glMultiTexCoord(). glTexCoord() Always sets
the first texture coordinate.
2022-01-19 19:57:49 +01:00
Stephan Unverwerth
a2c771a913 LibGL: Handle multiple texture coordinates in client state
This now tracks one vertex attribute pointer per texture unit and calls
glMultiTexCoord() to set the texture coordinates for the correct texture
unit.
2022-01-19 19:57:49 +01:00
Stephan Unverwerth
7571ef0343 LibGL+LibSoftGPU: Add multiple texture coordinates to vertex struct
We now have one set of texture coordinates per texture unit.
Texture coordinate generation and texture coordinate assignment is
currently only stubbed. This will be rectified in another commit.
2022-01-19 19:57:49 +01:00
Stephan Unverwerth
044582b0ce LibGL: Add stubs for multitexturing and announce GL_ARB_multitexture
This makes glquake recognize multitexture support and choose the
multitexture rendering path.
2022-01-19 19:57:49 +01:00
Stephan Unverwerth
716b53e90f LibGL: Implement glActiveTextureARB()
This is the equivalent of glActiveTexture() before it got promoted to
the OpenGL core specification. It is needed by glquake to enable the
multitexturing render path.
2022-01-19 19:57:49 +01:00
Stephan Unverwerth
d3d12c2fe7 LibGL: Generate GL extension string dynamically during construction
LibGL will now generate the GL extension string in the constructor and
refer to it later on when the string is queried via glGetString().
Currently we only check whether the device supports non-power-of-two
textures and add GL_ARB_texture_non_power_of_two to the supported
extensions in that case.
2022-01-19 19:57:49 +01:00
Stephan Unverwerth
5505f353e8 LibSoftGPU: Announce NPOT texture support via DeviceInfo struct 2022-01-19 19:57:49 +01:00
Itamar
0367893e53 HackStudio: Change ProjectBuilder dependency declaration logic
Previously when generating the HackStudio CMake build file,
we used all dependency libraries that are specified in
target_link_libraries commands as the dependencies of a library.

The recent addition of LibCryptSHA2 broke things because that library
is not declared with serenity_lib like most other libraries
(it uses special linking properties).
This means that we don't declare it in the CMake file we generate.

To fix this, we now filter the dependencies and only include libraries
that we define in the build CMake file.
2022-01-19 19:57:31 +01:00
Idan Horowitz
404daa0e33 AK: Yield while waiting for another thread to create a strong ref 2022-01-19 01:28:13 +01:00
Idan Horowitz
aa29e38ad5 AK: Yield while waiting for another thread to initialize a Singleton 2022-01-19 01:28:13 +01:00
Lucas CHOLLET
b0d51a6f36 AK: Fix erroneous move operators for SinglyLinkedList
This patch provides a proper implementation of the move operator and
delete the move assignment operator.

Those operators were introduced in #11888
2022-01-19 00:13:56 +01:00
Lady Gegga
589ebbc24e Base: Add Cypriot Syllabary to font Katica Regular 10
10800-1083F https://www.unicode.org/charts/PDF/U10800.pdf
2022-01-18 22:29:14 +02:00
Idan Horowitz
3945e239e1 Kernel: Don't populate the ACPI SysFS directory with a disabled ACPI
This would cause a nullptr dereference on ACPI::Parser::the().
2022-01-18 21:00:46 +02:00
Idan Horowitz
57ba67ed2a Kernel: Create the time page region before initializing the timers
We were unconditionally trying to update it in the interrupt, which
would depend on the timer interrupt not being received too soon after
the timers are initialized (before the time page was initialized),
which was the case when using HPET timers via the ACPI tables, but not
when using the PIT when ACPI was disabled.
2022-01-18 21:00:46 +02:00
Nico Weber
e09f74903e LibCrypo: Simplify mixed-sign bitwise_or
No behavior change.
2022-01-18 20:04:06 +03:30
Nico Weber
2392f65345 LibCrypto: Remove some now-unused (and incorrect) methods
Removes the UnsignedBigInteger overloads of
SignedBigInteger::binary_{and,or,xor}(). They're now unused, and they
also didn't work when *this was negative.
2022-01-18 20:04:06 +03:30
Nico Weber
d9b6eb29bc LibCrypto+LibJS: Better bitwise binary_xor binop
We went through some trouble to make & and | work right. Reimplement ^
in terms of & and | to make ^ work right as well.

This is less fast than a direct implementation, but let's get things
working first.
2022-01-18 20:04:06 +03:30
Nico Weber
013799a4dd LibCrypto+LibJS: Better bigint bitwise_or binop
Similar to the bitwise_and change, but we have to be careful to
sign-extend two's complement numbers only up to the highest set bit
in the positive number.
2022-01-18 20:04:06 +03:30
Nico Weber
1f98639396 LibCrypto+LibJS: Better bigint bitwise_and binop
Bitwise and is defined in terms of two's complement, so some converting
needs to happen for SignedBigInteger's sign/magnitude representation to
work out.

UnsignedBigInteger::bitwise_not() is repurposed to convert all
high-order zero bits to ones up to a limit, for the two's complement
conversion to work.

Fixes test262/test/language/expressions/bitwise-and/bigint.js.
2022-01-18 20:04:06 +03:30
Nico Weber
945d962322 LibJS+LibCrypto: Fix SignedBitInteger::bitwise_not and use it in LibJS
Bitwise operators are defined on two's complement, but SignedBitInteger
uses sign-magnitude. Correctly convert between the two.

Let LibJS delegate to SignedBitInteger for bitwise_not, like it does
for all other bitwise_ operations on bigints.

No behavior change (LibJS is now the only client of
SignedBitInteger::bitwise_not()).
2022-01-18 20:04:06 +03:30
Nico Weber
ec37eadb39 LibCrypto: Add Formatter<SignedBigInteger>
Useful for seeing SignedBigInteger values in test failure messages.
2022-01-18 20:04:06 +03:30
Timothy Flynn
b87e517deb AK: Remove now-unused AK::UnicodeUtils methods 2022-01-18 15:13:25 +00:00
Timothy Flynn
d51d5f9591 FontEditor: Retrieve code point abbreviations from LibUnicode
Rather than using a hard-coded list from AK::UnicodeUtils, LibUnicode
contains the up-to-date official names and contains abbreviations for
more control code points.
2022-01-18 15:13:25 +00:00
Timothy Flynn
701b7810ba LibUnicode: Generate code point abbreviations 2022-01-18 15:13:25 +00:00
Timothy Flynn
444b2d9ec2 LibJS: Implement UTF-16 surrogate pair concatenation without iteration
Performance of string concatenation regressed in a57e2f9. That commit
iterates over the LHS string to find the last code unit, to check if it
is a high surrogate. Instead, first look at the 3rd-to-last byte in the
UTF-8 encoded string to check if it is a 3-byte code point; then decode
just those bytes to check if we have a high surrogate. Similarly, check
the first 3 bytes of the RHS string to check if we have a low surrogate.
2022-01-18 09:46:55 +00:00
Pankaj Raghav
567b3a4810 Kernel: Add individual struct definitions for NVMeSubmission
Only a generic struct definition was present for NVMeSubmission. To
improve type safety and clarity, added an union of NVMeSubmission
structs that are applicable to the command being submitted.
2022-01-18 11:37:04 +02:00
Pankaj Raghav
ba7846647c Kernel: Fix m_ready_timeout calculation in NVMe
The CAP.TO is 0 based. Even though I don't see that mentioned in the
spec explicitly, all major OSs such as Linux, FreeBSD add 1 to the
CAP.TO while calculating the timeout.
2022-01-18 11:37:04 +02:00
Pankaj Raghav
3441eac960 Kernel: Remove delay during NVMe reset and start controller
IO::delay was added as a lazy alternative to looping with a timeout
error if the condition was not satisfied. Now that we have the
wait_for_ready function, remove the delay in the reset and start
controller function.
2022-01-18 11:37:04 +02:00
Pankaj Raghav
31c4c9724b Kernel: Add UNMAP_AFTER_INIT to NVMe member functions
NVMeController, NVMeQueue and NVMeNameSpace had functions which are not
used after init. So add them to UNMAP_AFTER_INIT section.
2022-01-18 11:37:04 +02:00
Rummskartoffel
487377d1d7 disasm: Don't fail when trying to disassemble empty files
Given an empty file, disasm would try to create a zero-size memory
mapping of that file, which would fail with EINVAL.
2022-01-18 09:08:14 +01:00
Rummskartoffel
0aa5725f72 disasm: Convert to east-const and C++-style casts 2022-01-18 09:08:14 +01:00
Marcus Nilsson
28a2a01dc3 LibGUI: Use autoscroll from AbstractView when rubberbanding in IconView
We can re-use the logic used for automatic scrolling in AbstractView
when we're doing rubberband scrolling in IconView. This removes some
duplicated code.
2022-01-18 09:04:50 +01:00
Brian Gianforcaro
89592601b6 HackStudio: Hookup git commit message detection and highlighting 2022-01-18 09:01:16 +01:00
Brian Gianforcaro
974e36e7a9 TextEditor: Hookup git commit message detection and highlighting 2022-01-18 09:01:16 +01:00
Brian Gianforcaro
8e8d24fe29 LibGUI: Add a GitCommit SyntaxHighlighter implementation
This highlighter just syntax highlights the commented lines in your git
commit message. It could potentially be enhanced to handle the rebase
UI or other more advanced cases in the future.
2022-01-18 09:01:16 +01:00