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

Make Array.apply an intrinsic #18537

Merged
merged 3 commits into from
Sep 21, 2023

Conversation

liufengyun
Copy link
Contributor

Make Array.apply an intrinsic

Copy link
Contributor

@olhotak olhotak left a comment

Choose a reason for hiding this comment

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

Othewise LGTM.

@@ -470,7 +470,7 @@ object Objects:

/** Store the heap as a mutable field to avoid threading it through the program. */
class MutableData(private[Heap] var heap: Data):
private[Heap] def update(addr: Addr, value: Value): Unit =
private[Heap] def writeUnion(addr: Addr, value: Value): Unit =
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder about the name change. Is the Union intended to convey that we update the heap with the join? In that case, I suggest writeJoin rather than writeUnion for consistency.

@@ -489,8 +489,8 @@ object Objects:
def read(addr: Addr)(using mutable: MutableData): Value =
mutable.heap(addr)

def write(addr: Addr, value: Value)(using mutable: MutableData): Unit =
mutable.update(addr, value)
def writeUnion(addr: Addr, value: Value)(using mutable: MutableData): Unit =
Copy link
Contributor

Choose a reason for hiding this comment

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

Without braces, it's hard to see which methods are part of class MutableData and which come after. Suggest an end line to indicate the end of MutableData.

@liufengyun liufengyun merged commit 3d539e6 into scala:main Sep 21, 2023
17 checks passed
@liufengyun liufengyun deleted the init-global-array-apply branch September 21, 2023 19:43
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
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.

3 participants