Skip to content
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

[JSC] Some misc cleanup in new BBQ #10433

Conversation

Constellation
Copy link
Member

@Constellation Constellation commented Feb 21, 2023

2a0f7a0

[JSC] Some misc cleanup in new BBQ
https://bugs.webkit.org/show_bug.cgi?id=252654
rdar://105714823

Reviewed by Mark Lam.

This patch does some cleanups in new BBQ.

1. Dedup exception throwing code.
2. Define FPRInfo::nonPreservedNonArgumentFPR0 and use it for m_scratchFPR.
3. Add boundary offset only when boundary is non-zero.

* Source/JavaScriptCore/assembler/AbstractMacroAssembler.h:
* Source/JavaScriptCore/jit/FPRInfo.h:
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJIT::BBQJIT):
(JSC::Wasm::BBQJIT::addTableGet):
(JSC::Wasm::BBQJIT::addTableSet):
(JSC::Wasm::BBQJIT::addTableInit):
(JSC::Wasm::BBQJIT::addTableFill):
(JSC::Wasm::BBQJIT::addTableCopy):
(JSC::Wasm::BBQJIT::emitCheckAndPreparePointer):
(JSC::Wasm::BBQJIT::addMemoryFill):
(JSC::Wasm::BBQJIT::addMemoryCopy):
(JSC::Wasm::BBQJIT::addMemoryInit):
(JSC::Wasm::BBQJIT::emitAtomicLoadOp):
(JSC::Wasm::BBQJIT::emitAtomicStoreOp):
(JSC::Wasm::BBQJIT::emitAtomicBinaryRMWOp):
(JSC::Wasm::BBQJIT::emitAtomicCompareExchange):
(JSC::Wasm::BBQJIT::atomicWait):
(JSC::Wasm::BBQJIT::atomicNotify):
(JSC::Wasm::BBQJIT::truncTrapping):
(JSC::Wasm::BBQJIT::throwExceptionIf):
(JSC::Wasm::BBQJIT::emitModOrDiv):
(JSC::Wasm::BBQJIT::addRefAsNonNull):
(JSC::Wasm::BBQJIT::endTopLevel):
(JSC::Wasm::BBQJIT::addCallIndirect):
(JSC::Wasm::BBQJIT::addExceptionLateLinkTask): Deleted.
* Source/JavaScriptCore/wasm/WasmExceptionType.h:

Canonical link: https://commits.webkit.org/260597@main

796999f

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe   πŸ›  wincairo
βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ›  gtk
βœ… πŸ§ͺ webkitperl   πŸ§ͺ ios-wk2   πŸ§ͺ api-mac ⏳ πŸ§ͺ gtk-wk2
  πŸ§ͺ api-ios   πŸ§ͺ mac-wk1 ⏳ πŸ§ͺ api-gtk
  πŸ›  πŸ§ͺ jsc βœ… πŸ›  tv   πŸ§ͺ mac-wk2   πŸ›  jsc-armv7
βœ… πŸ›  πŸ§ͺ jsc-arm64 βœ… πŸ›  tv-sim   πŸ§ͺ mac-AS-debug-wk2   πŸ§ͺ jsc-armv7-tests
βœ… πŸ›  watch   πŸ§ͺ mac-wk2-stress βœ… πŸ›  jsc-mips
βœ… πŸ›  watch-sim   πŸ§ͺ jsc-mips-tests
βœ… πŸ›  πŸ§ͺ unsafe-merge

@Constellation Constellation requested a review from a team as a code owner February 21, 2023 07:49
@Constellation Constellation self-assigned this Feb 21, 2023
@Constellation Constellation added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Feb 21, 2023
Copy link

@MenloDorian MenloDorian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me with suggestion.

@@ -8372,6 +8377,8 @@ class BBQJIT {
RegisterSet m_callerSaves;

InternalFunction* m_compilation;

std::array<Vector<Jump>, numberOfExceptionTypes> m_exceptions { };

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use a JumpList instead of a Vector<Jump>?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, we should use JumpList. Changed.

@Constellation Constellation force-pushed the eng/JSC-Some-misc-cleanup-in-new-BBQ branch from 1a61345 to def1492 Compare February 21, 2023 08:06
@Constellation Constellation force-pushed the eng/JSC-Some-misc-cleanup-in-new-BBQ branch from def1492 to 796999f Compare February 21, 2023 08:07
@Constellation Constellation added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Feb 21, 2023
https://bugs.webkit.org/show_bug.cgi?id=252654
rdar://105714823

Reviewed by Mark Lam.

This patch does some cleanups in new BBQ.

1. Dedup exception throwing code.
2. Define FPRInfo::nonPreservedNonArgumentFPR0 and use it for m_scratchFPR.
3. Add boundary offset only when boundary is non-zero.

* Source/JavaScriptCore/assembler/AbstractMacroAssembler.h:
* Source/JavaScriptCore/jit/FPRInfo.h:
* Source/JavaScriptCore/wasm/WasmBBQJIT.cpp:
(JSC::Wasm::BBQJIT::BBQJIT):
(JSC::Wasm::BBQJIT::addTableGet):
(JSC::Wasm::BBQJIT::addTableSet):
(JSC::Wasm::BBQJIT::addTableInit):
(JSC::Wasm::BBQJIT::addTableFill):
(JSC::Wasm::BBQJIT::addTableCopy):
(JSC::Wasm::BBQJIT::emitCheckAndPreparePointer):
(JSC::Wasm::BBQJIT::addMemoryFill):
(JSC::Wasm::BBQJIT::addMemoryCopy):
(JSC::Wasm::BBQJIT::addMemoryInit):
(JSC::Wasm::BBQJIT::emitAtomicLoadOp):
(JSC::Wasm::BBQJIT::emitAtomicStoreOp):
(JSC::Wasm::BBQJIT::emitAtomicBinaryRMWOp):
(JSC::Wasm::BBQJIT::emitAtomicCompareExchange):
(JSC::Wasm::BBQJIT::atomicWait):
(JSC::Wasm::BBQJIT::atomicNotify):
(JSC::Wasm::BBQJIT::truncTrapping):
(JSC::Wasm::BBQJIT::throwExceptionIf):
(JSC::Wasm::BBQJIT::emitModOrDiv):
(JSC::Wasm::BBQJIT::addRefAsNonNull):
(JSC::Wasm::BBQJIT::endTopLevel):
(JSC::Wasm::BBQJIT::addCallIndirect):
(JSC::Wasm::BBQJIT::addExceptionLateLinkTask): Deleted.
* Source/JavaScriptCore/wasm/WasmExceptionType.h:

Canonical link: https://commits.webkit.org/260597@main
@webkit-commit-queue
Copy link
Collaborator

Committed 260597@main (2a0f7a0): https://commits.webkit.org/260597@main

Reviewed commits have been landed. Closing PR #10433 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues.
Projects
None yet
4 participants