Idan Horowitz
f1e215ea3e
LibJS: Convert MapIteratorPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
dab0a92c19
LibJS: Convert MapPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
8ff152ec5c
LibJS: Convert MapConstructor functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
23ea1f1a3e
LibJS: Convert MathObject functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
b184e872e4
LibJS: Convert ReflectObject functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
4c3ea0bb91
LibJS: Convert StringIteratorPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
720bb21ee2
LibJS: Convert ArrayBufferPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
ffa58184d2
LibJS: Convert ArrayBufferConstructor functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
70cbd43718
LibJS: Convert DataViewPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
9d3348d8da
LibJS: Convert the SetViewValue AO to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
fca05f835f
LibJS: Convert the GetViewValue AO to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
7f3fa7d7e0
LibJS: Convert NumberPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
2c6955462e
LibJS: Convert NumberConstructor functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
08fb31087b
LibJS: Convert BooleanPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
2a0c51149d
LibJS: Convert FunctionPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
c0bb456fd2
LibJS: Convert the CreateDynamicFunction AO to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
47f762ab42
LibJS: Convert ErrorPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
c815519a65
LibJS: Convert WeakRefPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
719d1b48ac
LibJS: Convert ArrayIteratorPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
d1d4ee699b
LibJS: Convert ConsoleObject functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
e7a134a346
LibJS: Convert JSONObject functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
6b954b9e76
LibJS: Convert SetIteratorPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
d46d8c9016
LibJS: Convert SetPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
c2e0753d8a
LibJS: Convert SetConstructor functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
7c96ed8cf3
LibJS: Convert SymbolPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
294f244745
LibJS: Convert SymbolConstructor functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
87ff51fa67
LibJS: Convert BigIntPrototype functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Idan Horowitz
4128f95903
LibJS: Convert BigIntConstructor functions to ThrowCompletionOr
2021-10-29 21:29:24 +03:00
Linus Groh
09d1db5afd
LibJS: Clarify mathematical types in Temporal AOs and functions
...
This is an editorial change in the Temporal spec.
See: e480d40
2021-10-26 23:10:11 +02:00
Andreas Kling
5599d22744
LibJS: Support calling result of a computed MemberExpression in bytecode
...
This patch adds support for calls of the form o.f[expr]()
2021-10-25 16:05:04 +02:00
Andreas Kling
a2a8b97c11
LibJS: Simplify MemberExpression::generate_bytecode()
...
Use the get-from-reference helper in BytecodeGenerator.
2021-10-25 16:04:31 +02:00
Andreas Kling
72cd31d033
LibJS: Tweak Value::to_property_key() fast path for Int32
...
Move the check for Int32 *before* we call to_primitive().
2021-10-25 15:37:28 +02:00
Andreas Kling
cfbb69a9cd
LibJS: Support more assignment expressions in the bytecode VM
...
Use the new reference get/put helpers in BytecodeGenerator to support
assignment expressions other than just plain assignment.
2021-10-25 15:29:52 +02:00
Andreas Kling
72736f9e93
LibJS: Generate bytecode for UpdateExpression with MemberExpression arg
2021-10-25 15:17:41 +02:00
Andreas Kling
1dc60b028f
LibJS: Add BytecodeGenerator helpers for reference get/put
...
This allows code sharing between all AST nodes that want to get and/or
put through a reference.
2021-10-25 15:16:22 +02:00
Andreas Kling
b63d17e2f8
LibJS: Add fast paths for <, >, <=, and >= with Int32 on both sides
...
This gives us a ~5% speed-up on Kraken's ai-astar.js
2021-10-25 14:35:23 +02:00
Andreas Kling
d203a86900
LibJS: Always inline the bytecode instruction iterator's operator++
2021-10-25 13:37:02 +02:00
Andreas Kling
a97d75bb63
LibJS: Add default constructor for PrivateName
...
This avoids a round-trip through FlyString("") for every Reference.
2021-10-25 13:29:44 +02:00
Andreas Kling
3618ca2420
LibJS: Propagate exceptions across bytecode executable boundaries
...
To support situations like this:
function foo() { throw 1; }
try {
foo();
} catch (e) {
}
Each unwind context now keeps track of its origin executable.
When an exception is thrown, we return from run() immediately if the
nearest unwind context isn't in the current executable.
This causes a natural unwind to the point where we find the
catch/finally block(s) to jump into.
2021-10-25 12:57:21 +02:00
Andreas Kling
5a099b98cd
LibJS: Make eval() code run in the bytecode VM
...
If we have an active bytecode interpreter, let's make eval() use it.
2021-10-25 12:57:21 +02:00
Andreas Kling
049b755123
LibJS: Make bytecode interpreter leave unwind context immediately
...
We were missing some "break" statements, causing us to actually finish
executing everything within "try" blocks before actually jumping to the
"catch" and/or "finally" blocks.
2021-10-25 12:57:21 +02:00
Andreas Kling
a831cd9cc7
LibJS: Make bytecode VM throw TypeError on attempt to call non-callable
...
This isn't perfect, but allows us to progress instead of crashing in
the TODO().
2021-10-25 12:57:21 +02:00
Andreas Kling
6fc3c14b7a
LibJS: Fix bogus bytecode codegen for "catch" parameters
...
Add a missing '!' so that catch clauses with a named parameter actually
generate a SetVariable opcode.
2021-10-25 12:57:21 +02:00
Andreas Kling
b138b4c83f
LibJS: Optimize Value::to_property_key() for numeric property names
...
If the Value is a non-negative Int32, create a numeric PropertyKey
instead of making a string key.
This makes "ai-astar" test from the Kraken benchmark run in 30 seconds,
down from 42 seconds. :^)
2021-10-24 17:18:09 +02:00
Andreas Kling
65a7296b8f
LibJS: Make Value::to_property_key() return a JS::PropertyKey
...
Instead of returning JS::StringOrSymbol, which is a space-optimized type
used in Shape property tables, this now returns JS::PropertyKey which is
*not* space-optimized, but has other niceties like optimized storage of
numeric ("indexed") properties.
2021-10-24 17:18:09 +02:00
Andreas Kling
7ccb8c8609
LibJS: Provide default hash traits for JS::PropertyKey
...
Let's not require people to use PropertyNameTraits everywhere when we
can just specialize AK::Traits<JS::PropertyKey> instead. :^)
2021-10-24 17:18:09 +02:00
Andreas Kling
c02e992de2
LibJS: Use PropertyKey in MemberExpression::to_reference()
2021-10-24 17:18:09 +02:00
Andreas Kling
75f2510de9
LibJS: Make make_super_property_reference() take a PropertyKey
...
Let's get rid of StringOrSymbol usage outside of Shape.
2021-10-24 17:18:08 +02:00
Andreas Kling
398c181c79
LibJS: Rename PropertyName to PropertyKey
...
Let's use the same name as the spec. :^)
2021-10-24 17:18:07 +02:00
Andreas Kling
715e7fada8
LibJS: Add the "fast non-local access" optimization to the bytecode VM
...
The GetVariable bytecode op now caches environment coordinates for fast
cross-scope variable lookup.
2021-10-24 17:18:07 +02:00