So I think this is going in the right direction. However, this should be split
into 3 patches. There are three independent optimizations at hand.

1) Inlining a constant when the holder (either receiver or a prototype up the
chain of the receiver) is an HConstant and the property is read-only
non-configurable, and
2) omitting the map-check for the holder if the holder is an HConstant and we're
emitting a map-check only as guard for a property load of a read-only,
non-configurable property.
3) What you suggested regarding the types in VisitCall: if the receiver is an
HConstant, we should adjust the types list accordingly.

Lets make 1) this patch, and figure out 2) in a separate patch; and land 3)
first to make sure that we don't have problems in 1).

My suggestions for the patches:

1) Move the code inlining the HConstant into BuildLoadNamedField if
checked_object->ActualValue()->IsConstant().

2) Don't delete nodes in place! Instead delay adding checks until they are
necessary:
- if the action is a load, delay the receiver mapcheck in BuildNamedAccess.
- in BuildMonomorphicAccess, add that map-check of the receiver if
info->has_holder(), but don't emit the map-check of the holder.
- in BuildLoadNamedField, emit the map-check of the incoming holder if the
holder is either not an HConstant (hence it's the receiver which is not an
HConstant), or the property is not read-only / non-configurable.

3) Update ComputeReceiverTypes to handle the case where receiver->IsConstant(). That could should either trim down the receiver maps to a transition from the
constant's map; or just add the constant's map as expected receiver type.

Does that sound reasonable?

Regards,
Toon

https://codereview.chromium.org/220163012/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to