Bug 1659133 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

With the previous patch most we usually still have the following code:

```
18:guardobjectgroup (6:newobject (5:constant object 1fa0a9888160 (Object)))
19:objectstaticproto (18:guardobjectgroup (6:newobject))
20:guardshape (19:objectstaticproto (18:guardobjectgroup))
21:postwritebarrier (18:guardobjectgroup (6:newobject)) (17:constant 0x4)
22:box (17:constant 0x4)
23:allocateandstoreslot (18:guardobjectgroup (6:newobject)) (22:box (17:constant 0x4))
```

First we are guarding on the group of the object. Then we load the object's proto and shape check it. We can't move those instructions across `allocateandstoreslot` instructions because they all use the ObjectFields alias set. So we could either split the alias set into group/shape/proto, which would be potentially error prone.
So instead we manually tell MGuardObjectGroup, MObjectStaticProto etc. that `MAddAndStoreSlot` don't modify the group or proto using the `mightAlias` method.

Finally we just have the 20:guardshape for the proto left. This is kind of hard to eliminate, because we would have to make sure the addandstoreslot instructions are definitely not changing the shape of the proto.

At least for objects with a null proto we don't have any extra instructions besides the postbarrier and addslot :)
With the previous patch we usually still have the following code:

```
18:guardobjectgroup (6:newobject (5:constant object 1fa0a9888160 (Object)))
19:objectstaticproto (18:guardobjectgroup (6:newobject))
20:guardshape (19:objectstaticproto (18:guardobjectgroup))
21:postwritebarrier (18:guardobjectgroup (6:newobject)) (17:constant 0x4)
22:box (17:constant 0x4)
23:allocateandstoreslot (18:guardobjectgroup (6:newobject)) (22:box (17:constant 0x4))
```

First we are guarding on the group of the object. Then we load the object's proto and shape check it. We can't move those instructions across `allocateandstoreslot` instructions because they all use the ObjectFields alias set. So we could either split the alias set into group/shape/proto, which would be potentially error prone.
So instead we manually tell MGuardObjectGroup, MObjectStaticProto etc. that `MAddAndStoreSlot` don't modify the group or proto using the `mightAlias` method.

Finally we just have the 20:guardshape for the proto left. This is kind of hard to eliminate, because we would have to make sure the addandstoreslot instructions are definitely not changing the shape of the proto.

At least for objects with a null proto we don't have any extra instructions besides the postbarrier and addslot :)
With the previous patch we usually still have the following code:

```
18:guardobjectgroup (6:newobject (5:constant object 1fa0a9888160 (Object)))
19:objectstaticproto (18:guardobjectgroup (6:newobject))
20:guardshape (19:objectstaticproto (18:guardobjectgroup))
21:postwritebarrier (18:guardobjectgroup (6:newobject)) (17:constant 0x4)
22:box (17:constant 0x4)
23:allocateandstoreslot (18:guardobjectgroup (6:newobject)) (22:box (17:constant 0x4))
```

First we are guarding on the group of the object. Then we load the object's proto and shape check it. We can't move those instructions across `allocateandstoreslot` instructions because they all use the ObjectFields alias set. We could split the alias set into group/shape/proto, which would be potentially error prone.
So instead we manually tell MGuardObjectGroup, MObjectStaticProto etc. that `MAddAndStoreSlot` don't modify the group or proto using the `mightAlias` method.

Finally we just have the 20:guardshape for the proto left. This is kind of hard to eliminate, because we would have to make sure the addandstoreslot instructions are definitely not changing the shape of the proto.

At least for objects with a null proto we don't have any extra instructions besides the postbarrier and addslot :)
With the previous patch we usually still have the following code:

```
18:guardobjectgroup (6:newobject (5:constant object 1fa0a9888160 (Object)))
19:objectstaticproto (18:guardobjectgroup (6:newobject))
20:guardshape (19:objectstaticproto (18:guardobjectgroup))
21:postwritebarrier (18:guardobjectgroup (6:newobject)) (17:constant 0x4)
22:box (17:constant 0x4)
23:allocateandstoreslot (18:guardobjectgroup (6:newobject)) (22:box (17:constant 0x4))
```

First we are guarding on the group of the object. Then we load the object's proto and shape check it. We can't move those instructions across `allocateandstoreslot` instructions because they all use the ObjectFields alias set. We could split the alias set into group/shape/proto, which would be potentially error prone.
So instead we manually tell MGuardObjectGroup, MObjectStaticProto etc. that M(Add|Allocate)AndStoreSlot don't modify the group or proto using the `mightAlias` method.

Finally we just have the 20:guardshape for the proto left. This is kind of hard to eliminate, because we would have to make sure the addandstoreslot instructions are definitely not changing the shape of the proto.

At least for objects with a null proto we don't have any extra instructions besides the postbarrier and addslot :)

Back to Bug 1659133 Comment 3