Skip to content

[Serialization] Refactor subset of ModuleFile into ModuleFileCore #32470

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 1 commit into from
Jul 7, 2020

Conversation

akyrtzi
Copy link
Contributor

@akyrtzi akyrtzi commented Jun 19, 2020

The difference with ModuleFile is that ModuleFileCore provides immutable data and is independent of a particular ASTContext.
It is designed to be able to be shared across multiple ModuleFiles of different ASTContexts in a thread-safe manner.

@akyrtzi akyrtzi requested review from DougGregor, xymus and nkcsgexi June 19, 2020 18:35
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jun 19, 2020

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 2cb895dc00f2eca58adf0d062d135e6ea5de9685

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jun 19, 2020

@swift-ci Please test

@swiftlang swiftlang deleted a comment from swift-ci Jun 19, 2020
@swiftlang swiftlang deleted a comment from swift-ci Jun 19, 2020
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jun 19, 2020

@swift-ci test OS X platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - bc25088cdef26a74e969fc2da93ea2e9b43c2c32

@slavapestov
Copy link
Contributor

Perhaps we can come up with a different, more descriptive name? ASTModuleFile vs ModuleFile or something?

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jun 23, 2020

Perhaps we can come up with a different, more descriptive name? ASTModuleFile vs ModuleFile or something?

@slavapestov what do you think about:

  • ModuleFile (immutable/sharable state)
  • ModuleFileContext (mutable, tied to an ASTContext, contains AST decls)?

Copy link
Contributor

@xymus xymus left a comment

Choose a reason for hiding this comment

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

LGTM and the performance opportunity here is impressive.

I don't mind much about the names but if we are to change them my tendency would be to make it clear that ModuleFileCore is immutable and shared so maybe something like ModuleFileSharedCore.

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

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

LGTM. The change is huge and I didn't get a chance to review every detail, but a brief glancing convinced me this is a great design choice.

…dCore`

The difference with `ModuleFile` is that `ModuleFileSharedCore` provides immutable data and is independent of a particular ASTContext.
It is designed to be able to be shared across multiple `ModuleFile`s of different `ASTContext`s in a thread-safe manner.
@akyrtzi akyrtzi force-pushed the refactor-modulefile branch from bc25088 to 99c2914 Compare July 6, 2020 07:52
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 6, 2020

@swift-ci Please test

@swiftlang swiftlang deleted a comment from swift-ci Jul 6, 2020
@swiftlang swiftlang deleted a comment from swift-ci Jul 6, 2020
@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 6, 2020

@swift-ci Please test

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 6, 2020

I took the suggestion by @xymus for naming.

@swift-ci
Copy link
Contributor

swift-ci commented Jul 6, 2020

Build failed
Swift Test OS X Platform
Git Sha - 99c2914

@akyrtzi
Copy link
Contributor Author

akyrtzi commented Jul 7, 2020

@swift-ci test OS X platform

@akyrtzi akyrtzi merged commit 09ddd29 into swiftlang:master Jul 7, 2020
@akyrtzi akyrtzi deleted the refactor-modulefile branch July 7, 2020 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants