GObject: substantially rework g_object_new()
GObject: substantially rework g_object_new()

Make a number of improvements to g_object_new():

 - instead of looking up the GParamSpec for the named property once in
   g_object_new() (in order to collect) and then again in g_object_newv
   (when actually setting the property), g_object_new_internal() is a
   new function that takes the GParamSpec on the interface to avoid the
   second lookup

 - in the case that ->constructor() is not set, we need not waste time
   creating an array of GObjectConstructParam to pass in.  Just directly
   iterate the list of parameters, calling set_property() on each.

 - instead of playing with linked lists to keep track of the construct
   properties, realise that the number of construct properties that we
   will set is exactly equal to the length of the construct_properties
   list on GObjectClass and the only thing that may change is where the
   value comes from (in the case that it was passed in)

   This assumption was already implicit in the existing code and can be
   seen from the sizing of the array used to hold the construct
   properties, but it wasn't taken advantage of to make things simpler.

 - instead of allocating and filling a separate array of the
   non-construct properties just re-iterate the passed-in list and set
   all properties that were not marked G_PARAM_CONSTRUCT (since the ones
   that were construct params were already used during construction)

 - use the new g_param_spec_get_default_value() API instead of
   allocating and setting the GValue for each construct property that
   wasn't passed from the user

Because we are now iterating the linked list of properties in-order we
need to append to that list during class initialising instead of
prepending.

These changes show a very small improvement on the simple-construction
performance testcase (probably just noise) and they improve the
complex-construction case by ~30%.

Thanks to Alex Larsson for reviews and fixes.

https://bugzilla.gnome.org/show_bug.cgi?id=698056

endlessm/glib,MathieuDuponchelle/glib,ieei/glib,cosimoc/glib,Distrotech/glib,Distrotech/glib,lukasz-skalski/glib,krichter722/glib,MathieuDuponchelle/glib,gale320/glib,johne53/MB3Glib,cosimoc/glib,cention-sany/glib,johne53/MB3Glib,cention-sany/glib,gale320/glib,Distrotech/glib,johne53/MB3Glib,tchakabam/glib,krichter722/glib,mzabaluev/glib,ieei/glib,endlessm/glib,cosimoc/glib,lukasz-skalski/glib,endlessm/glib,tchakabam/glib,tamaskenez/glib,cention-sany/glib,krichter722/glib,mzabaluev/glib,krichter722/glib,cention-sany/glib,ieei/glib,tamaskenez/glib,johne53/MB3Glib,endlessm/glib,ieei/glib,tchakabam/glib,lukasz-skalski/glib,gale320/glib,MathieuDuponchelle/glib,tamaskenez/glib,MathieuDuponchelle/glib,mzabaluev/glib,gale320/glib,johne53/MB3Glib,MathieuDuponchelle/glib,tamaskenez/glib,tamaskenez/glib,mzabaluev/glib,gale320/glib,cosimoc/glib,mzabaluev/glib,cention-sany/glib,lukasz-skalski/glib,johne53/MB3Glib,tchakabam/glib,Distrotech/glib,ieei/glib,lukasz-skalski/glib,krichter722/glib,Distrotech/glib,endlessm/glib,cosimoc/glib,tchakabam/glib