Commit graph

38 commits

Author SHA1 Message Date
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
Andreas Kling
2520c46224 LibJS/JIT: Resolve the GetCalleeAndThisFromEnvironment cache at JIT time 2023-11-10 14:49:25 +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
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
eaf8c2e398 LibJS: Improve error messages for primitive strict mode property access
Using ErrorType::ReferencePrimitiveSetProperty the errors for primitives
now look like "Cannot set property 'foo' of number '123'".

The strict-mode-errors test has been adjusted and re-enabled.
2023-11-05 18:44:48 +01:00
Idan Horowitz
38f3b78a1d LibJS: Store the bytecode accumulator in a dedicated physical register
We now use a dedicated physical register to store the bytecode
accumulator, instead of loading and storing it to the memory everytime.
2023-11-02 22:35:35 +01:00
Simon Wanner
ad81bf47bb LibJS: Move GetObjectPropertyIterator impl to CommonImplementations 2023-10-29 22:57:19 +01:00
Jakub Berkop
6a7b9b85a4 LibJS/JIT: Compile the DeleteByValueWithThis instruction 2023-10-29 21:51:46 +01:00
Jakub Berkop
0776404e03 LibJS/JIT: Compile the DeleteByValue instruction 2023-10-29 21:51:46 +01:00
Jakub Berkop
f5fcd4596c LibJS/JIT: Compile the DeleteById instruction 2023-10-29 21:51:46 +01:00
Simon Wanner
516bb01082 LibJS/Bytecode: Move Append impl to CommonImplementations 2023-10-29 17:36:09 +01:00
Simon Wanner
5179ff5fc9 LibJS/Bytecode: Move IteratorToArray impl to CommonImplementations 2023-10-29 17:36:09 +01:00
Simon Wanner
661dbbc83d LibJS/Bytecode: Move object_to_iterator to CommonImplementations 2023-10-29 17:36:09 +01:00
Simon Wanner
d416cef9bb LibJS/Bytecode: Move iterator_to_object to CommonImplementations 2023-10-29 17:36:09 +01:00
Simon Wanner
1eee110575 LibJS: Move SuperCallWithArgumentArray impl to CommonImplementations 2023-10-29 17:36:09 +01:00
Simon Wanner
f9fbb8cff2 LibJS/Bytecode: Move NewClass impl to CommonImplementations 2023-10-29 07:44:11 +01:00
Simon Wanner
54f1f7a51b LibJS/Bytecode: Move CreateVariable impl to CommonImplementations 2023-10-29 07:44:11 +01:00
Idan Horowitz
b2d8d0c270 LibJS: Compile the CallWithArgumentArray bytecode instruction 2023-10-28 20:27:16 +02:00
Andreas Kling
c1551a64dc LibJS/JIT: Compile the NewRegExp bytecode instruction 2023-10-27 19:07:22 +02:00
Andreas Kling
935d67cfcf LibJS/JIT: Compile the GetCalleeAndThisFromEnvironment instruction 2023-10-27 19:07:22 +02:00
Andreas Kling
dabaaabfc0 LibJS/JIT: Support the GetVariable bytecode instruction 2023-10-27 19:07:22 +02:00
Andreas Kling
bcf7cdb679 LibJS/Bytecode: Un-templatize throw_if_needed_for_call() 2023-10-27 19:07:22 +02:00
Andreas Kling
c2aad0f573 LibJS/Bytecode: Move PutByValue impl to CommonImplementations 2023-10-27 19:07:22 +02:00
Andreas Kling
9f61cda27e LibJS/Bytecode: Move NewFunction impl into CommonImplementations 2023-10-27 19:07:22 +02:00
Andreas Kling
393d90abe1 LibJS/Bytecode: Move SetVariable implementation to CommonImplementations 2023-10-27 19:07:22 +02:00
Andreas Kling
d368dc5d25 LibJS/Bytecode: Move TypeofVariable impl to CommonImplementations 2023-10-27 19:07:22 +02:00
Andreas Kling
640455b1d2 LibJS/JIT: Compile the Call bytecode instruction
I've left a FIXME about dealing with some throwsy cases.
2023-10-27 19:07:22 +02:00
Andreas Kling
7fc35fde09 LibJS/Bytecode: Move throw_if_needed_for_call to CommonImplementations 2023-10-27 19:07:22 +02:00
Andreas Kling
b56ecc7e34 LibJS/Bytecode: Move perform_call helper to CommonImplementations 2023-10-27 19:07:22 +02:00
Andreas Kling
580249d650 LibJS/JIT: Compile the PutById bytecode instruction 2023-10-27 19:07:22 +02:00
Andreas Kling
3974ce2069 LibJS/JIT: Compile the GetGlobal bytecode instruction 2023-10-27 19:07:22 +02:00
Andreas Kling
e8190105db LibJS/Bytecode: Move GetByValue implementation to CommonImplementations 2023-10-27 19:07:22 +02:00
Andreas Kling
8905682a16 LibJS/Bytecode: Begin moving shareable (JIT+Interpreter) stuff somewhere
There are a lot of native C++ functions that will be used by both the
bytecode interpreter and jitted code. Let's put them in their own file
instead of having them in Interpreter.cpp.
2023-10-27 19:07:22 +02:00