After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 699818 - Split class definition from prototype lookups
Split class definition from prototype lookups
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2013-05-07 10:08 UTC by Giovanni Campagna
Modified: 2013-05-13 19:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
object: split class definition from prototype lookup (11.65 KB, patch)
2013-05-07 10:08 UTC, Giovanni Campagna
committed Details | Review
boxed, union, gerror: remove dead code (7.05 KB, patch)
2013-05-07 10:08 UTC, Giovanni Campagna
committed Details | Review
boxed, gerror, union, param, interface: apply the same cleanup as object (28.36 KB, patch)
2013-05-07 10:08 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2013-05-07 10:08:41 UTC
A code cleanup, mostly, but possibly a micro-optimization too.
Comment 1 Giovanni Campagna 2013-05-07 10:08:44 UTC
Created attachment 243462 [details] [review]
object: split class definition from prototype lookup

prototype lookup is a very hot path (it's involved in creating
JS objects from GObjects), while class definition is mostly
called when we know the property is not there, so we can avoid
the lookup.
Also, this is a general code cleanup.
Comment 2 Giovanni Campagna 2013-05-07 10:08:48 UTC
Created attachment 243463 [details] [review]
boxed, union, gerror: remove dead code
Comment 3 Giovanni Campagna 2013-05-07 10:08:53 UTC
Created attachment 243464 [details] [review]
boxed, gerror, union, param, interface: apply the same cleanup as object

Clearly distinguish class definition from prototype lookup, with
the added benefit that we don't need to create classes on the fly,
because if something is not introspectable we simply bail out.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-05-07 15:10:15 UTC
Review of attachment 243463 [details] [review]:

OK.
Comment 5 Giovanni Campagna 2013-05-07 15:56:11 UTC
Comment on attachment 243463 [details] [review]
boxed, union, gerror: remove dead code

Attachment 243463 [details] pushed as 0b3b913 - boxed, union, gerror: remove dead code
Comment 6 Colin Walters 2013-05-13 18:20:04 UTC
Review of attachment 243462 [details] [review]:

This is a difficult patch to review...if you're just moving things around, I'm fine with that.
Comment 7 Colin Walters 2013-05-13 18:22:49 UTC
Review of attachment 243464 [details] [review]:

This looks like a really nice cleanup.
Comment 8 Giovanni Campagna 2013-05-13 19:52:03 UTC
Attachment 243462 [details] pushed as fe33911 - object: split class definition from prototype lookup
Attachment 243464 [details] pushed as 52224e0 - boxed, gerror, union, param, interface: apply the same cleanup as object