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

Apply more constexpr for offsetOf #29841

Conversation

Constellation
Copy link
Member

@Constellation Constellation commented Jun 14, 2024

51b187d

Apply more constexpr for offsetOf
https://bugs.webkit.org/show_bug.cgi?id=275512
rdar://129874627

Reviewed by Yijia Huang.

More expansion of constexpr OBJECT_OFFSETOF. And changing some more ASSERT with static_assert.

* Source/JavaScriptCore/bytecode/InternalFunctionAllocationProfile.h:
(JSC::InternalFunctionAllocationProfile::offsetOfStructureID):
* Source/JavaScriptCore/dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::linkOSRExits):
* Source/JavaScriptCore/heap/FreeList.h:
(JSC::FreeCell::offsetOfScrambledBits):
* Source/JavaScriptCore/jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::loadMegamorphicProperty):
* Source/JavaScriptCore/runtime/FunctionExecutable.h:
* Source/JavaScriptCore/runtime/FunctionRareData.h:
* Source/JavaScriptCore/runtime/JSBigInt.h:
* Source/JavaScriptCore/runtime/JSCallee.h:
(JSC::JSCallee::offsetOfScopeChain):
* Source/JavaScriptCore/runtime/JSFunction.h:
(JSC::JSFunction::offsetOfExecutableOrRareData):
* Source/JavaScriptCore/runtime/JSObject.h:
(JSC::JSObject::offsetOfInlineStorage):
(JSC::indexRelativeToBase):
* Source/JavaScriptCore/runtime/NativeExecutable.h:
* Source/WTF/wtf/WeakRandom.h:
* Source/WTF/wtf/text/StringImpl.h:
(WTF::StringImpl::flagsOffset):
(WTF::StringImpl::dataOffset):
(WTF::StringImpl::headerSize):
(WTF::StringImpl::tailOffset):
* Source/WTF/wtf/text/SymbolImpl.h:
(WTF::SymbolImpl::SymbolImpl):

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

ab5b153

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

@Constellation Constellation requested a review from a team as a code owner June 14, 2024 21:31
@Constellation Constellation self-assigned this Jun 14, 2024
@Constellation Constellation added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Jun 14, 2024
Copy link
Contributor

@hyjorc1 hyjorc1 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

@@ -33,7 +33,7 @@ namespace JSC {

class InternalFunctionAllocationProfile {
public:
static inline ptrdiff_t offsetOfStructureID() { return OBJECT_OFFSETOF(InternalFunctionAllocationProfile, m_structureID); }
static constexpr ptrdiff_t offsetOfStructureID() { return OBJECT_OFFSETOF(InternalFunctionAllocationProfile, m_structureID); }

Choose a reason for hiding this comment

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

I wonder if consteval would be good in these cases

@Constellation Constellation added the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Jun 15, 2024
https://bugs.webkit.org/show_bug.cgi?id=275512
rdar://129874627

Reviewed by Yijia Huang.

More expansion of constexpr OBJECT_OFFSETOF. And changing some more ASSERT with static_assert.

* Source/JavaScriptCore/bytecode/InternalFunctionAllocationProfile.h:
(JSC::InternalFunctionAllocationProfile::offsetOfStructureID):
* Source/JavaScriptCore/dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::linkOSRExits):
* Source/JavaScriptCore/heap/FreeList.h:
(JSC::FreeCell::offsetOfScrambledBits):
* Source/JavaScriptCore/jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::loadMegamorphicProperty):
* Source/JavaScriptCore/runtime/FunctionExecutable.h:
* Source/JavaScriptCore/runtime/FunctionRareData.h:
* Source/JavaScriptCore/runtime/JSBigInt.h:
* Source/JavaScriptCore/runtime/JSCallee.h:
(JSC::JSCallee::offsetOfScopeChain):
* Source/JavaScriptCore/runtime/JSFunction.h:
(JSC::JSFunction::offsetOfExecutableOrRareData):
* Source/JavaScriptCore/runtime/JSObject.h:
(JSC::JSObject::offsetOfInlineStorage):
(JSC::indexRelativeToBase):
* Source/JavaScriptCore/runtime/NativeExecutable.h:
* Source/WTF/wtf/WeakRandom.h:
* Source/WTF/wtf/text/StringImpl.h:
(WTF::StringImpl::flagsOffset):
(WTF::StringImpl::dataOffset):
(WTF::StringImpl::headerSize):
(WTF::StringImpl::tailOffset):
* Source/WTF/wtf/text/SymbolImpl.h:
(WTF::SymbolImpl::SymbolImpl):

Canonical link: https://commits.webkit.org/280046@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Apply-more-constexpr-for-offsetOf branch from ab5b153 to 51b187d Compare June 15, 2024 00:23
@webkit-commit-queue
Copy link
Collaborator

Committed 280046@main (51b187d): https://commits.webkit.org/280046@main

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

@webkit-commit-queue webkit-commit-queue merged commit 51b187d into WebKit:main Jun 15, 2024
@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 Jun 15, 2024
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
5 participants