raw slot ref/set VOPs should be refactored

Bug #629221 reported by Nathan Froyd
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Invalid
Wishlist
Unassigned

Bug Description

Bug #629058 points out that we could do a better job of coalescing raw-slot slot calculations. This is hard, because each RAW-INSTANCE/* vop contains logic to:

- Pull the length out of the structure instance;
- Compute the offset of the raw slot;
- Access the member question.

An all-assembly CSE pass could do the necessary coalescing, but I hope you agree that'd be rather ugly.

The better solution is to refactor the raw-slot logic to DEFKNOWN functions suitable for doing the three steps above. So you'd end up with something like:

  (%RAW-INSTANCE-REF/WORD X (%RAW-SLOT-OFFSET (%INSTANCE-LENGTH X) **magic-index** 1#|nwords|#))

This is a tedious job, since it needs to be done across all backends, but it's quite straightforward and will make new ports somewhat easier. It also removes a good deal of OAOOM from */cell.lisp and might even give a nice place in *defstruct.lisp to document exactly how raw slots work.

Once the above is done, fixing Bug #629058 boils down to "just" implementing a basic-block value numbering pass or something similar on IR2.

Nathan Froyd (froydnj)
description: updated
description: updated
description: updated
description: updated
Revision history for this message
Douglas Katzman (dougk) wrote :

this bug is obsolete, there are not calculations involved in accessing a raw slot.

Changed in sbcl:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.