Bug 221927 - BytecodeGenerator::fuseCompareAndJump() fails for some language constructs
Summary: BytecodeGenerator::fuseCompareAndJump() fails for some language constructs
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Minor
Assignee: Alexey Shvayka
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-15 14:42 PST by Alexey Shvayka
Modified: 2021-03-02 18:08 PST (History)
8 users (show)

See Also:


Attachments
Patch (18.64 KB, patch)
2021-02-15 14:45 PST, Alexey Shvayka
no flags Details | Formatted Diff | Diff
Patch for landing (20.25 KB, patch)
2021-03-01 06:00 PST, Alexey Shvayka
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Shvayka 2021-02-15 14:42:13 PST
BytecodeGenerator::fuseCompareAndJump() fails for some language constructs
Comment 1 Alexey Shvayka 2021-02-15 14:45:45 PST
Created attachment 420376 [details]
Patch
Comment 2 Yusuke Suzuki 2021-02-15 19:54:19 PST
Comment on attachment 420376 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=420376&action=review

r=me, awesome!

> Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp:5176
> +                emitJumpIfTrue(emitEqualityOp<OpBeloweq>(newTemporary(), context.completionTypeRegister(), emitLoad(nullptr, CompletionType::Throw)), isThrowOrNormalLabel.get());

I think emitEqualityOp is not correct for OpBeloweq (emitBinaryOp?).
Could you also insert static_assert for them in emitEqualityOp? (static_assert for EqOp is StrictEq etc.).
Comment 3 Radar WebKit Bug Importer 2021-02-22 14:43:12 PST
<rdar://problem/74614681>
Comment 4 Alexey Shvayka 2021-03-01 06:00:12 PST
Created attachment 421814 [details]
Patch for landing
Comment 5 Alexey Shvayka 2021-03-01 06:15:05 PST
(In reply to Yusuke Suzuki from comment #2)
> r=me, awesome!

I always appreciate your thorough reviews. Thanks Yusuke!

> I think emitEqualityOp is not correct for OpBeloweq (emitBinaryOp?).
> Could you also insert static_assert for them in emitEqualityOp?
> (static_assert for EqOp is StrictEq etc.).

Great catch!

I've added a static_assert only for op_eq / op_stricteq because op_neq / op_nstricteq are handled in BinaryOpNode::emitBytecode() and never get passed to emitEqualityOp().
Comment 6 EWS 2021-03-01 07:00:26 PST
Committed r273649: <https://commits.webkit.org/r273649>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 421814 [details].
Comment 7 Yusuke Suzuki 2021-03-02 18:08:16 PST
This improved JetStream2/Air by 5%. Awesome!