Refactored native trait accessors so they are done entirely in roles.
authorDave Rolsky <autarch@urth.org>
Sun, 26 Sep 2010 19:12:22 +0000 (14:12 -0500)
committerJesse Luehrs <doy@tozt.net>
Mon, 27 Sep 2010 00:41:28 +0000 (19:41 -0500)
commit8b9641b857cdd065a68f9b74ad072b1d58fcd4e1
treea43af42030667af2f28a76eb4a335b50fbcb8935
parentbb7ba2b1f98cca141da13c8300f36bf425a78b61
Refactored native trait accessors so they are done entirely in roles.

The class to do the inlining is generated based on the attribute's accessor &
delegation metaclasses, which means this works even when the attribute changes
those classes.

Added code to check if the attr's slot access can be inlined, and to use a
slower but working code path if it can't (see MX::AttributeTree for an example
of why this might be needed).
82 files changed:
lib/Moose/Meta/Attribute/Native/Trait.pm
lib/Moose/Meta/Method/Accessor/Native.pm
lib/Moose/Meta/Method/Accessor/Native/Array.pm
lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm
lib/Moose/Meta/Method/Accessor/Native/Array/accessor.pm
lib/Moose/Meta/Method/Accessor/Native/Array/clear.pm
lib/Moose/Meta/Method/Accessor/Native/Array/count.pm
lib/Moose/Meta/Method/Accessor/Native/Array/delete.pm
lib/Moose/Meta/Method/Accessor/Native/Array/elements.pm
lib/Moose/Meta/Method/Accessor/Native/Array/first.pm
lib/Moose/Meta/Method/Accessor/Native/Array/get.pm
lib/Moose/Meta/Method/Accessor/Native/Array/grep.pm
lib/Moose/Meta/Method/Accessor/Native/Array/insert.pm
lib/Moose/Meta/Method/Accessor/Native/Array/is_empty.pm
lib/Moose/Meta/Method/Accessor/Native/Array/join.pm
lib/Moose/Meta/Method/Accessor/Native/Array/map.pm
lib/Moose/Meta/Method/Accessor/Native/Array/natatime.pm
lib/Moose/Meta/Method/Accessor/Native/Array/pop.pm
lib/Moose/Meta/Method/Accessor/Native/Array/push.pm
lib/Moose/Meta/Method/Accessor/Native/Array/reduce.pm
lib/Moose/Meta/Method/Accessor/Native/Array/set.pm
lib/Moose/Meta/Method/Accessor/Native/Array/shift.pm
lib/Moose/Meta/Method/Accessor/Native/Array/shuffle.pm
lib/Moose/Meta/Method/Accessor/Native/Array/sort.pm
lib/Moose/Meta/Method/Accessor/Native/Array/sort_in_place.pm
lib/Moose/Meta/Method/Accessor/Native/Array/splice.pm
lib/Moose/Meta/Method/Accessor/Native/Array/uniq.pm
lib/Moose/Meta/Method/Accessor/Native/Array/unshift.pm
lib/Moose/Meta/Method/Accessor/Native/Bool/not.pm
lib/Moose/Meta/Method/Accessor/Native/Bool/set.pm
lib/Moose/Meta/Method/Accessor/Native/Bool/toggle.pm
lib/Moose/Meta/Method/Accessor/Native/Bool/unset.pm
lib/Moose/Meta/Method/Accessor/Native/Code/execute.pm
lib/Moose/Meta/Method/Accessor/Native/Code/execute_method.pm
lib/Moose/Meta/Method/Accessor/Native/Collection.pm
lib/Moose/Meta/Method/Accessor/Native/Counter/Writer.pm
lib/Moose/Meta/Method/Accessor/Native/Counter/dec.pm
lib/Moose/Meta/Method/Accessor/Native/Counter/inc.pm
lib/Moose/Meta/Method/Accessor/Native/Counter/reset.pm
lib/Moose/Meta/Method/Accessor/Native/Counter/set.pm
lib/Moose/Meta/Method/Accessor/Native/Hash.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/Writer.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/clear.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/count.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/defined.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/delete.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/elements.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/exists.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/get.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/is_empty.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/keys.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/kv.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/set.pm
lib/Moose/Meta/Method/Accessor/Native/Hash/values.pm
lib/Moose/Meta/Method/Accessor/Native/Number/abs.pm
lib/Moose/Meta/Method/Accessor/Native/Number/add.pm
lib/Moose/Meta/Method/Accessor/Native/Number/div.pm
lib/Moose/Meta/Method/Accessor/Native/Number/mod.pm
lib/Moose/Meta/Method/Accessor/Native/Number/mul.pm
lib/Moose/Meta/Method/Accessor/Native/Number/set.pm
lib/Moose/Meta/Method/Accessor/Native/Number/sub.pm
lib/Moose/Meta/Method/Accessor/Native/Reader.pm
lib/Moose/Meta/Method/Accessor/Native/String/append.pm
lib/Moose/Meta/Method/Accessor/Native/String/chomp.pm
lib/Moose/Meta/Method/Accessor/Native/String/chop.pm
lib/Moose/Meta/Method/Accessor/Native/String/clear.pm
lib/Moose/Meta/Method/Accessor/Native/String/inc.pm
lib/Moose/Meta/Method/Accessor/Native/String/length.pm
lib/Moose/Meta/Method/Accessor/Native/String/match.pm
lib/Moose/Meta/Method/Accessor/Native/String/prepend.pm
lib/Moose/Meta/Method/Accessor/Native/String/replace.pm
lib/Moose/Meta/Method/Accessor/Native/String/substr.pm
lib/Moose/Meta/Method/Accessor/Native/Writer.pm
t/070_native_traits/010_trait_array.t
t/070_native_traits/020_trait_bool.t
t/070_native_traits/030_trait_code.t
t/070_native_traits/040_trait_counter.t
t/070_native_traits/050_trait_hash.t
t/070_native_traits/060_trait_number.t
t/070_native_traits/070_trait_string.t
t/lib/NoInlineAttribute.pm [new file with mode: 0644]