-
-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Function
#626
Refactor Function
#626
Conversation
Codecov Report
@@ Coverage Diff @@
## master #626 +/- ##
==========================================
+ Coverage 72.64% 72.91% +0.26%
==========================================
Files 179 178 -1
Lines 13275 13226 -49
==========================================
Hits 9644 9644
+ Misses 3631 3582 -49
Continue to review full report at Codecov.
|
Benchmark for d5a603eClick to view benchmark
|
Benchmark for 05430fcClick to view benchmark
|
If I'm not mistaken, this would de facto close #387 and give a nice solution to #363 (comment), right? |
I guess so, forgot there was an PR to fix it. This PR only removes it but there will also be PR to add |
Looks good so far from what i can see. |
No. Not necessarily. They accomplish different goals. This PR does some prepwork for the new function design, and #627 ( |
ab6fb6f
to
2c382c9
Compare
Benchmark for ec33490Click to view benchmark
|
- Added call to js object - Removed Function::call - Removed `Function::construct` and added `GcObject::construct` - Made Function an enum - Made the Function into an enum - Removed `InternalState` - Removed `internal_state.rs` file
2c382c9
to
2c14dca
Compare
Benchmark for c3b857cClick to view benchmark
|
Co-authored-by: Iban Eguia <razican@protonmail.ch>
Benchmark for 1686cd4Click to view benchmark
|
This PR is a preparation for the function design discussed in #445
It changes the following:
Function::call()
=>GcObject::call()
this is done because we need the object that is being called to be garbage collected, because we put it in the environment. This was awkward before since we pass a clone of object and the access theFunction
and call it and pass the function object.Function::construct()
=>GcObject::construct()
same asFunction::call()
Function
be an enum since many fields that are for ordinary functions where there for builtins.InternalState
since we will replace it with aNativeObject
.RegExp
in box because it was really big (136 bytes)Interpreter::create_builtin_function(name, length, function pointer) -> GcObject
Interpreter::register_global_function(name, length, function pointer)
Function
from56
bytes to48
bytesObjectData
from144
bytes to80
bytesObject
from272
bytes to192
bytes