-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
There was a problem hiding this 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 = |
There was a problem hiding this comment.
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 = |
There was a problem hiding this comment.
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
.
a911d54
to
9e80e94
Compare
Make
Array.apply
an intrinsic