Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001020 [Squeak Packages] WriteBarrier minor always 03-30-05 01:46 03-30-05 01:46
Reporter KenCausey View Status public  
Assigned To
Priority normal Resolution open  
Status new  
Summary 0001020: [BUG][FIX] WriteBarrier at:put: fix for variable classes
Description Chris Muller <chris@funkyobjects.org> writes:

"The WriteBarrier class-comment states:

- any methods that potentially modify instance variables will be overriden in
this new class. The overridden method stores the original values of the
instance variable in temps, then calls the super method, and then compares the
current inst var values with the originals.
- If the instance variable values have changed, the WriteBarrier will be
notified with a send to #modified:, with the object that was modified as the
single argument.
- For variably-sized classes, #at:put: is also overridden to provide the same
notification.

While integrating WriteBarrier into Magma, I noticed my Array test was actually
slower than without WriteBarrier. The problem is in
WBClassBuilder>>installAtPutOverrides, which do not check whether the value is
changed, it signals #modified no matter what.

To demonstrate this:

| a wb |
a _ Array with: true.
wb _ DirtySetWriteBarrier new.
wb add: a.
a at: 1 put: true.
wb dirtySet includes: a

This script should return false. After loading the attached fix, it will.

Also, I have a question. Are there any caveats to overriding instVarAt:put: to
check for a new value as well? The same class-comment says:

- The WriteBarrier is semi-permeable: if you want to modify an object directly
without triggering notifications, you can use #instVarAt:put: and
#basicAt:put:.

This reduces transparency albeit just a little; and this same permeability
could be achieved by temporarily removing from the WriteBarrier. Is there any
reason not to do it?"
Additional Information
Attached Files  WriteBarrierAtPutOverrideFix.1.cs.gz [^] (329 bytes) 03-30-05 01:46

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
03-30-05 01:46 KenCausey New Issue
03-30-05 01:46 KenCausey File Added: WriteBarrierAtPutOverrideFix.1.cs.gz


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
29 total queries executed.
24 unique queries executed.
Powered by Mantis Bugtracker