-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
[Merged by Bors] - Avoid creating prototype
property on methods
#2553
Conversation
Test262 conformance changes
Fixed tests (10):
|
Codecov Report
@@ Coverage Diff @@
## main #2553 +/- ##
==========================================
+ Coverage 49.99% 50.21% +0.22%
==========================================
Files 379 376 -3
Lines 37642 37478 -164
==========================================
+ Hits 18819 18821 +2
+ Misses 18823 18657 -166
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -138,6 +138,7 @@ impl ByteCompiler<'_, '_> { | |||
let index = self.code_block.functions.len() as u32; | |||
self.code_block.functions.push(code); | |||
self.emit(Opcode::GetFunction, &[index]); | |||
self.emit_u8(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on creating an emit
method like emit_with_opcode_and_u8
(maybe not the best name) to bind the pushing of the two operands together?
Edit: maybe even better emit_opcode_with_operand_and_bool
, it's a long name, but then you can feed index and true/false as the arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could maybe generate emit
functions for every opcode via a macro e.g. Opcode::GetFunction::emit
. These functions could then automatically take the correct arguments.
Do we want to create a dedicated issue for making bytecode generation more typesafe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that would make sense to me. Submitted an issue #2561 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest looks good to me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
bors r+ |
This Pull Request changes the following: - Stop creating a `prototype` property on class methods by passing a flag to the relevant opcodes.
Pull request successfully merged into main. Build succeeded: |
prototype
property on methodsprototype
property on methods
This Pull Request changes the following:
prototype
property on class methods by passing a flag to the relevant opcodes.