call to __Value methods can't pass fields as arguments

Frederic Parain frederic.parain at
Fri Mar 24 15:37:53 UTC 2017


Let’s go with T_OBJECT right now (with a comment please).

Could the calling convention be revisited later?
  1 - to have T_VALUETYPE being a real reference to a standalone
       value (and then could be used in the case we are discussing)
  2 - to add a special delimiter type instead of overloading T_VALUETYPE

I’m concerned that the overloaded meaning T_VALUETYPE could strike us
back later.


> On Mar 24, 2017, at 11:28, Roland Westrelin <rwestrel at> wrote:
>> Cannot we use T_VALUETYPE instead of T_OBJECT?
> That list already includes T_VALUETYPE elements for another
> purpose. collect_fields() has a comment that explains why.
> // Value type arguments are not passed by reference, instead each
> // field of the value type is passed as an argument. This helper
> // function collects the fields of the value types (including embedded
> // value type's fields) in a list. Included with the field's type is
> // the offset of each field in the value type: i2c and c2i adapters
> // need that to load or store fields. Finally, the list of fields is
> // sorted in order of increasing offsets: the adapters and the
> // compiled code need and agreed upon order of fields.
> //
> // The list of basic types that is returned starts with a T_VALUETYPE
> // and ends with an extra T_VOID. T_VALUETYPE/T_VOID are used as
> // delimiters. Every entry between the two is a field of the value
> // type. If there's an embedded value type in the list, it also starts
> // with a T_VALUETYPE and ends with a T_VOID. This is so we can
> // generate a unique fingerprint for the method's adapters and we can
> // generate the list of basic types from the interpreter point of view
> // (value types passed as reference: iterate on the list until a
> // T_VALUETYPE, drop everything until and including the closing
> // T_VOID) or the compiler point of view (each field of the value
> // types is an argument: drop all T_VALUETYPE/T_VOID from the list).
> Roland.

More information about the valhalla-dev mailing list