CARVIEW |
Select Language
HTTP/2 301
date: Tue, 22 Jul 2025 08:39:28 GMT
content-length: 0
location: https://github.com/chakra-core/ChakraCore/pull/2372
server-timing: nginx;desc="NGINX";dur=1.349852,glb;desc="GLB";dur=108.395918
x-voltron-version: fd8fbbc
vary: Accept-Encoding, Accept, X-Requested-With
server: github.com
x-frame-options: DENY
strict-transport-security: max-age=31536000; includeSubDomains; preload
set-cookie: _gh_sess=tv6kx0W9%2F96jBXOGnIx2OZ5weF1hDckpN8P7%2FATDWneBAhMmc0FAKOG8G8z3MqJcRWgt%2Fj%2FPDuX%2F6e1Xl4%2FHBYeGG5x8mh%2F7SxlHvJqZuC6BAj5GDSJelBPk8lsxJ%2B8QetL%2FmQxnuX2APSqlrJgUh8QldCDQ21I8bxGulE12Alvtj3UlH%2B%2B%2FQ0%2F1yP%2FaZ1Z44FIm7whfXG%2BQ1xj51XkG%2FriqkCKzDHV1Lk7PxTdXIwhu%2Bgf0u8H8QSnddLxTsofR2uCWU%2BW634oJpbH6AQINQw%3D%3D--AGOp31cijwPC698c--70EH7RvVhOgpiIN4752A%2Bg%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.2142228641.1753173568; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 08:39:28 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 08:39:28 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: E628:23C3D6:3A4E0D:411B1A:687F4E40
HTTP/2 200
date: Tue, 22 Jul 2025 08:39:30 GMT
content-type: text/html; charset=utf-8
cache-control: no-cache
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
referrer-policy: no-referrer-when-downgrade
server-timing: pull_request_layout-fragment;desc="pull_request_layout fragment";dur=581.587892,conversation_content-fragment;desc="conversation_content fragment";dur=1392.050158,conversation_sidebar-fragment;desc="conversation_sidebar fragment";dur=560.25424,nginx;desc="NGINX";dur=0.859273,glb;desc="GLB";dur=102.37633
strict-transport-security: max-age=31536000; includeSubdomains; preload
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-content-type-options: nosniff
x-frame-options: deny
x-voltron-version: fd8fbbc
x-xss-protection: 0
server: github.com
content-encoding: gzip
accept-ranges: bytes
x-github-request-id: E628:23C3D6:3A4E47:411B85:687F4E40
Broadly enable software write barrier by leirocks · Pull Request #2372 · chakra-core/ChakraCore · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Broadly enable software write barrier #2372
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prototype support for software write barrier in the JIT- every move to an indir that's unknown target, with a pointer source, can trigger the write barrier for that target
…r or not trying pass by reference instead of pointer, we might be able to disable addressof(&) operator in write barrier wrapper
trying to avoid using WriteBarrierPtr<T> as function argument
Revert enabling GLOBAL_FORCE_USE_WRITE_BARRIER on Windows. That should be a test feature and also not ready to turn on. `template<ObjectInfoBits>` does not accept `library->Enum...` for instantiation. Should use `JavascriptLibrary::Enum...`. Fix a few assertions. Fix one case of `insertBeforeInstr/assignInstr` name regression.
Also fix tab check.
Enable build.sh to run write-barrier check/analyze: ``` build.sh -n -d --wb-check lib/Runtime/Base/FunctionBody.cpp ```
AsmJsModule.cpp calls TypedArray<..., true>::Create and results in link error because the implementation is in cpp file and no explicit instantiation. Also it would miss constructor implementation for the same reason. Fixed by moving both constructor and Create template implementations to header file.
…ze from build.sh Merge pull request chakra-core#1735 from jianchun:swbscript Enable build.sh to run write-barrier check/analyze: ``` build.sh -n -d --wb-check lib/Runtime/Base/FunctionBody.cpp ``` Also fix some build breaks and failures/assertions, fix copyright headers and tabs.
Fix NoWriteBarrierPtr::operator= signature. Annotate `PointerNoBarrier(void) m_dynamicInterpreterThunk`. Fix related usages.
…Thunk Merge pull request chakra-core#1756 from jianchun:swbfix1 Fix NoWriteBarrierPtr::operator= signature. Annotate `PointerNoBarrier(void) m_dynamicInterpreterThunk`. Fix related usages.
For any write barrier allocations, the allocated type declaration should be write-barrier decorated. Otherwise we'd see it in "pointerClasses" and print an error on this type. Move "RecyclerPointers.h" header file include location earlier to start examing more GC types.
…ed type Merge pull request chakra-core#1775 from jianchun:ubtype For any write barrier allocations, the allocated type declaration should be write-barrier decorated. Otherwise we'd see it in "pointerClasses" and print an error on this type. Move "RecyclerPointers.h" header file include location earlier to start examing more GC types.
Expand `Pointer` macro to choose `WriteBarrierPtr/NoWriteBarrierPtr` based on optional `Allocator` type using `WriteBarrierPtrTraits`. (E.g. pointer fields but using with Arena, choose NoWriteBarrierPtr.) Add `WriteBarrier` function to trigger write barrier on array content when needed. Added `CopyArray` function to copy array data. Triggers write barrier on the array content when needed. By default only pointer types, WriteBarrierPtr wrapper, or explicit _write_barrier_policy trigger write barrier (when using Recycler). Users can also use template instantiation to alter custom allocator/type write barrier policy. This change does not handle individual `Item` write barrier yet.
…ial) Merge pull request chakra-core#1797 from jianchun:wballoc Expand `Pointer` macro to choose `WriteBarrierPtr/NoWriteBarrierPtr` based on optional `Allocator` type using `WriteBarrierPtrTraits`. (E.g. pointer fields but using with Arena, choose NoWriteBarrierPtr.) Add `WriteBarrier` function to trigger write barrier on array content when needed. Added `CopyArray` function to copy array data. Triggers write barrier on the array content when needed. By default only pointer types, WriteBarrierPtr wrapper, or explicit _write_barrier_policy trigger write barrier (when using Recycler). Users can also use template instantiation to alter custom allocator/type write barrier policy. This change does not handle individual `Item` write barrier yet.
BaseDictionary Key or Value can be of GC pointer type, potentially needs write barrier on each entry item. Use macro and template type traits to replace underlying entry Key/Value type with WriteBarrierPtr when Key or Value is pointer type and used with recycler allocators. BaseDictionary methods still use original Key/Value types. Only the underlying EntryType may contain swapped type. Most methods are not affected. However, when WriteBarrierPtr is used, only immutable TryGetReference should be used. (We cannot get a mutable reference and possibly change the pointer underneath WriteBarrierPtr.) Allow WriteBarrierPtr to take immutable address to support TryGetReference (used a lot). Fixed a bunch of incorrect `const` usage.
Apply template traits to field types to simplify write barrier field annotations. Now most annotations are Field or FieldNoBarrier (for pointers known not needing write barrier). Replaced `WB_ITEM_TYPE` with `Field`.
… items Merge pull request chakra-core#1819 from jianchun:wbdict BaseDictionary Key or Value can be of GC pointer type, potentially needs write barrier on each entry item. Use macro and template type traits to replace underlying entry Key/Value type with WriteBarrierPtr when Key or Value is pointer type and used with recycler allocators. BaseDictionary methods still use original Key/Value types. Only the underlying EntryType may contain swapped type. Most methods are not affected. However, when WriteBarrierPtr is used, only immutable TryGetReference should be used. (We cannot get a mutable reference and possibly change the pointer underneath WriteBarrierPtr.) Allow WriteBarrierPtr to take immutable address to support TryGetReference (used a lot). Fixed a bunch of incorrect `const` usage. Update: Apply template traits to field types to simplify write barrier field annotations. Now most annotations are Field or FieldNoBarrier (for pointers known not needing write barrier).
Merge pull request chakra-core#1833 from jianchun:swbfi
Make the clang plugin work on OSX. OSX note: Must run the same clang binary for which the plugin was built for. e.g.: ``` ./build.sh -n -d --icu=/usr/local/opt/icu4c/include/ \ --cxx=/usr/local/opt/llvm/bin/clang++ \ --cc=/usr/local/opt/llvm/bin/clang \ --wb-check lib/Runtime/Base/FunctionBody.cpp ``` Clean up plugin build script and sources. Add plugin arguments support. Arguments can be directly passed from top level "build.sh". Changed --wb-check default output to "ERROR" only. To output verbose, use plugin argument "-verbose": ``` build.sh -n -d --wb-check lib/Runtime/Base/FunctionBody.cpp \ --wb-args=-verbose ``````
…nd plugin arguments Merge pull request chakra-core#1847 from jianchun:wbarg Make the clang plugin work on OSX. OSX note: Must run the same clang binary for which the plugin was built for. e.g.: ``` ./build.sh -n -d --icu=/usr/local/opt/icu4c/include/ \ --cxx=/usr/local/opt/llvm/bin/clang++ \ --cc=/usr/local/opt/llvm/bin/clang \ --wb-check lib/Runtime/Base/FunctionBody.cpp ``` Clean up plugin build script and sources. Add plugin arguments support. Arguments can be directly passed from top level "build.sh". Changed --wb-check default output to "ERROR" only. To output verbose, use plugin argument "-verbose": ``` build.sh -n -d --wb-check lib/Runtime/Base/FunctionBody.cpp \ --wb-args=-verbose ```
there's functioninfo array using copy constructor to initialize
…ftware writebarrier
Merge pull request chakra-core#2293 from leirocks:wb3 - false poisitive on EntryPointInfo->jsMethod after native address reuse in recycler - false poisitive in arena allocator cacheBlockEnd reused in leaf block in recycler (sharing same page allocator) - overload ChangeToAssign in JIT code, check all posible assign for write barrier - missing barriers in various location
while etw rundown, this can happen in another thread which does not have card table initialized for its stack
Merge pull request chakra-core#2351 from leirocks:wbmerge
Annotate "Arguments" fields with FieldNoBarrier, so that the plugin checker is happy. Revert a JavascriptGenerator change Lei accidentally removed (credit to Lei). One StackTrace test config seems incorrect. It contained 2 "compile-flags" and the 2nd overrided 1st, making the test exactly the same as a previous one.
Merge pull request chakra-core#2355 from jianchun:swbtouchup Annotate "Arguments" fields with FieldNoBarrier, so that the plugin checker is happy. Revert a JavascriptGenerator change Lei accidentally removed (credit to Lei). One StackTrace test config seems incorrect. It contained 2 "compile-flags" and the 2nd overrided 1st, making the test exactly the same as a previous one.
On Linux static builds ch uses overrided "operator delete" which uses HeapAllocator. This runs into a possible destructor order problem. Global moduleRecordMap (std::map) destructor may use global HeapAllocator::Instance and must run after HeapAllocator Instance destructor. To workaround without touching global init/destructor order, manually clear moduleRecordMap at end of RunScript().
Merge pull request chakra-core#2360 from jianchun:swbfi
OP_StModuleSlot was changing slot without write barrier. Annotate all related code. (Credit to Lei for finding it is module namespace related.)
This reverts commit c49e4af. It should now work after Oguz removed wchar_t redef from PAL.
Found under stress unit testing. Debugger::m_context was not pinned and could be GC collected when not in use.
the padding causes mismatch between the runtime and marshalling layer
…, Debugger) Merge pull request chakra-core#2364 from jianchun:swbmodule ### swb: fix module namespace annotation OP_StModuleSlot was changing slot without write barrier. Annotate all related code. (Credit to Lei for finding it is module namespace related.) ### Revert "fix a pal build issue on my machine" This reverts commit c49e4af. It should now work after Oguz removed wchar_t redef from PAL. ### pin Debugger::m_context Found under stress unit testing. Debugger::m_context was not pinned and could be GC collected when not in use.
Merge pull request chakra-core#2366 from leirocks:wboopjitfix the padding causes mismatch between the runtime and marshalling layer
This reverts commit d665119. Updated toolset should have this issue fixed.
…sis tool bug" Merge pull request chakra-core#2369 from jianchun:revcodeanalysis This reverts commit d665119. Updated toolset should have this issue fixed.
only build the verification related code when GLOBAL_ENABLE_WRITE_BARRIER is on
…cation Merge pull request chakra-core#2370 from leirocks:wbrecyclerfix only build the verification related code when GLOBAL_ENABLE_WRITE_BARRIER is on
# Conflicts: # lib/Common/Memory/Recycler.h # lib/Common/Memory/Recycler.cpp # lib/Runtime/Library/JavascriptLibrary.h
@dotnet-bot test OSX osx_osx_test_static please |
chakrabot
pushed a commit
that referenced
this pull request
Jan 13, 2017
Merge pull request #2372 from leirocks:swb This is to enable concurrent GC on non-Win32 platform. On Windows we dependend on both software write barrier and hardware write barrier(aka WriteWatch) to do concurrent GC. On Linux the write watch is not supported. This change is to make software write barrier globaly enabled for recycler allocated stcutures and hence enable concurrent GC on Linux.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You can’t perform that action at this time.
This is to enable concurrent GC on non-Win32 platform.
On Windows we dependend on both software write barrier and hardware write barrier(aka WriteWatch) to do concurrent GC.
On Linux the write watch is not supported.
This change is to make software write barrier gloably enabled for recycler allocated stcutures and hence enable concurrent GC on Linux.