Andreas Kling
298dfa96a4
LibJS: Remove unused members from EnterUnwindContext instruction
2023-11-12 14:21:41 +01:00
Andreas Kling
b6435ca280
LibJS: Unify bytecode instruction names with their helper names
2023-11-12 14:21:41 +01:00
Jesús (gsus) Lapastora
1850652881
LibJS/Bytecode: Check if eval function is a function
...
When overriding 'eval' to a non-function value, the interpreter would
crash. Now it handles this case swiftly, throwing a TypeError.
2023-11-11 08:56:12 +01:00
Idan Horowitz
e58209e5cf
LibJS: Skip an always-false branch in the JIT to_boolean slow case
2023-11-11 08:55:18 +01:00
Sönke Holz
6824d2a788
Userland+Tests: Add initial riscv64 support
2023-11-10 10:30:08 -07:00
Andreas Kling
2520c46224
LibJS/JIT: Resolve the GetCalleeAndThisFromEnvironment cache at JIT time
2023-11-10 14:49:25 +01:00
Simon Wanner
a3399fa13a
LibJS/JIT: Expand Mul
fast path to double & i32 combinations
...
Co-authored-by: Stephan Vedder <vedder@mbits.info>
2023-11-10 11:01:59 +01:00
Simon Wanner
867b8146cf
LibJS/JIT: Expand Sub
fast path to double & i32 combinations
...
Co-authored-by: Stephan Vedder <vedder@mbits.info>
2023-11-10 11:01:59 +01:00
Simon Wanner
5edab2679c
LibJS/JIT: Expand Add
fast path to double & i32 combinations
...
Co-authored-by: Stephan Vedder <vedder@mbits.info>
2023-11-10 11:01:59 +01:00
Simon Wanner
d91b376393
LibJS/JIT: Add helper for generating combined i32 & double fastpaths
...
Co-authored-by: Stephan Vedder <vedder@mbits.info>
2023-11-10 11:01:59 +01:00
iliadsh
94b47ff03b
LibJS: Add GetByValue fast path for simple array access
2023-11-10 08:22:44 +01:00
iliadsh
f91c3e9ac3
LibJS: Expose offset to m_indexed_properties
2023-11-10 08:22:44 +01:00
iliadsh
cb933a3e4a
LibJS: Expose offset of m_array_size
2023-11-10 08:22:44 +01:00
iliadsh
32364d66aa
LibJS: Expose offset of is_simple_storage
2023-11-10 08:22:44 +01:00
iliadsh
d9aebeb372
LibJS: Expose offset of elements in IndexedProperties
2023-11-10 08:22:44 +01:00
iliadsh
eb937631bb
LibJS: Expose offset of may_interfere_with_indexed_property_access
2023-11-10 08:22:44 +01:00
iliadsh
ee4948b9e7
LibJS: Devirtualize is_simple_storage()
2023-11-10 08:22:44 +01:00
iliadsh
89da731aa6
LibJS+LibWeb: Devirtualize may_interfere_with_indexed_property_access()
2023-11-10 08:22:44 +01:00
Andreas Kling
4f8e915ef8
LibJS: Remove accidentally-committed bytecode caching
...
This was a hack cache I got from Luke, not ready for prime-time :^)
2023-11-09 21:06:19 +01:00
Tim Schumacher
a2f60911fe
AK: Rename GenericTraits to DefaultTraits
...
This feels like a more fitting name for something that provides the
default values for Traits.
2023-11-09 10:05:51 -05:00
Andreas Kling
ac23ab42b3
LibJS/JIT: Add fast path for cached GetById
2023-11-09 16:02:14 +01:00
Andreas Kling
55e467c359
LibJS/JIT: Add fast path for cached PutById
2023-11-09 16:02:14 +01:00
Andreas Kling
b1b2ca1485
LibJS: Add basic monomorphic caching for PutById property access
...
This patch makes it possible for JS::Object::internal_set() to populate
a CacheablePropertyMetadata, and uses this to implement a basic
monomorphic cache for the most common form of property write access.
2023-11-09 16:02:14 +01:00
Todderod
bb9230bbcd
LibJS: Remove redundant Store op
...
If the property for GetByValue in Generator::load_from_reference
is a calculated value this would be stored in an allocated
register and returned from the function. Not all callers want
this information however, so now only give it out when asked for.
Reduced the instruction count for Kraken/ai-astar.js function
"neighbours" from 214 to 192.
2023-11-08 22:18:28 +01:00
Stephan Vedder
13726fd3b7
LibJS/JIT: Add fast path for decrement
...
Generate jitted code for the decrement opcode.
2023-11-08 21:09:44 +01:00
Stephan Vedder
0e69f744df
LibJS/JIT: Add increment instruction
...
Instead of using `Add` with an immediate of 1 use the `Inc` instruction
2023-11-08 21:09:44 +01:00
Sebastian Bernauer
8eb9c2dc54
LibJS/JIT: Add fast path for number comparisons
...
So far only less_than was using a fast path. This commits uses the same
path for less_than_equals, greater_than and greater_than_equals.
2023-11-08 14:11:51 +01:00
Aliaksandr Kalenik
c170dd323e
LibJS: Make eval() prevent GetGlobal usage less aggressively
...
Before usage of GetGlobal was prevented whenever eval() is present in
the scope chain.
With this change GetGlobal is emitted for `g` in the following program:
```js
function screw_everything_up() {
eval("");
}
var g;
g;
```
It makes Octane/mandreel.js benchmark run 2x faster :)
2023-11-08 10:07:56 +01:00
Sergey Bugaev
21b946791e
LibJS: Link with libatomic on i*86
...
Basically, this would be needed on any platform where the compiler
cannot tell at compile time whether or not some atomic size is
lock-free.
2023-11-08 09:29:59 +01:00
Sergey Bugaev
9c6c2284d9
LibJS: Fix build error when some atomics are not lock-free
...
Normally, we want to avoid accidentally using such atomics, since
they're much slower. In this case however, we're just implementing
another atomics API, it is then up to the JavaScript code to avoid
using the slow atomics.
2023-11-08 09:29:59 +01:00
Timothy Flynn
bf3fce1766
LibJS: Add Date.parse formats for the output of Date.prototype.to*String
...
We currently cannot parse the output of `toString` and `toUTCString`.
While the spec does not require such support, test262 expects it, and
all major engines support it.
2023-11-08 09:28:17 +01:00
Timothy Flynn
9d3f942d43
LibJS: Display example Date strings inline with their format strings
...
The current comment style feels a bit awkward to read.
2023-11-08 09:28:17 +01:00
iliadsh
aef654592f
LibJS/JIT: Bail in UnsignedRightShift fast path if result is negative
2023-11-07 21:59:03 +01:00
Simon Wanner
8eeb4e0aff
LibJS/JIT: Use mov8/mov32 for loads in compile_get_variable
2023-11-07 14:39:13 +01:00
Andreas Kling
1d8ec677a3
LibJS/JIT: Add fast path for cached GetVariable accesses
...
We can now stay in machine code for environment variable read accesses
as long as they are cached and initialized.
20% speed-up on Octane/zlib.js :^)
2023-11-07 11:33:04 +01:00
Andreas Kling
7826c006c1
LibJS/JIT: Don't crash when dissassembling an empty basic block
2023-11-07 11:33:04 +01:00
Andreas Kling
e1e7e696ac
LibJS/JIT: Store the running ExecutionContext& in a dedicated register
2023-11-07 11:33:04 +01:00
iliadsh
24d5070520
LibJS/JIT: Add fast path for UnsignedRightShift
2023-11-07 10:17:04 +01:00
iliadsh
c956316c98
LibJS/JIT: Add fast path for RightShift
2023-11-07 10:17:04 +01:00
iliadsh
1244e91481
LibJS/JIT: Add fast path for LeftShift
2023-11-07 10:17:04 +01:00
Timothy Flynn
38dd284915
LibLocale: Update to CLDR version 44.0.1
...
https://cldr.unicode.org/index/downloads/cldr-44
Notable changes that affect us include:
* The Islamic Calendar is now localized as the Hijri Calender (in en-US)
but has not been updated for all locales. So this patch updates tests
where possible and removes a few test cases that currently cannot be
localized.
* The und locale has received more likely subtag data (the und locale is
basically a pseudo-locale meaning "undetermined").
* The exponential symbol in the Arabic number system was changed from
U+0627 to U+0623.
2023-11-06 08:31:56 -05:00
Andreas Kling
536b9c29e4
LibJS/JIT: Resolve the EnvironmentVariableCache pointers at JIT time
2023-11-06 13:06:10 +01:00
Andreas Kling
a616a682fe
LibJS/JIT: Resolve the GlobalVariableCache pointers at JIT time
2023-11-06 13:06:10 +01:00
Andreas Kling
f03d4a1ffe
LibJS/JIT: Resolve the PropertyLookupCache pointers at JIT time
...
We know where the lookup cache is by the time we're jitting code, so
let's put the pointer directly into the instruction stream.
2023-11-06 13:06:10 +01:00
Andreas Kling
3b6b9b9f25
LibJS: Take VM instead of Interpreter in more common implementations
2023-11-06 13:06:10 +01:00
Andreas Kling
234ed2d466
LibJS/JIT: Resolve the GetGlobal identifier at JIT time
2023-11-06 13:06:10 +01:00
Andreas Kling
c92954db36
LibJS/JIT: Resolve the GetById property name at JIT time
...
We can resolve the IdentifierTableIndex to a DeprecatedFlyString& once
when jitting the code, instead of every time GetById executes.
2023-11-06 13:06:10 +01:00
Simon Wanner
7e3cfaf08c
LibJS/JIT: Include headers before they are used
...
JIT_ARCH_SUPPORTED is defined in LibJIT/Assembler.h, so we need to
include it first.
This change also moves the non-JIT headers outside the #ifdef
2023-11-06 10:28:05 +01:00
Nikodem Rabuliński
bacbd830fe
LibJIT: Make X86_64Assembler::native_call take u64 instead of void*
...
Now that x86-specific Assembler will be compiled on every architecture
we can't rely on void* being the right width.
It also fixes compilation on targets which have void*
be different length from u64 (WASM in particular).
2023-11-06 10:05:42 +01:00
Nikodem Rabuliński
8aa35f4fab
LibJIT+LibJS: Rename Assembler to X86_64Assembler
...
This is in preparation for making LibJIT support multiple architectures.
Assembler will now be typedefed to the specific assembler
for a particular architecture.
Additionally, there's now JIT_ARCH_SUPPORTED which is defined on
architectures which LibJIT supports.
2023-11-06 10:05:42 +01:00