From: gfx Date: Mon, 31 Aug 2009 07:34:13 +0000 (+0900) Subject: Rebase origin and fix miss-merged segments X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=daf9799bc493c6746efae7f68e1fcada1c98e989;p=gitmo%2FClass-MOP.git Rebase origin and fix miss-merged segments --- diff --git a/lib/Class/MOP/Method/Accessor.pm b/lib/Class/MOP/Method/Accessor.pm index 6138e0b..1c7b8cd 100644 --- a/lib/Class/MOP/Method/Accessor.pm +++ b/lib/Class/MOP/Method/Accessor.pm @@ -159,12 +159,6 @@ sub _generate_predicate_method { ## basic generators -sub generate_accessor_method { - Carp::cluck('The generate_accessor_method method has been made private.' - . " The public version is deprecated and will be removed in a future release.\n"); - shift->_generate_accessor_method_basic; -} - sub _generate_accessor_method_basic { my $attr = (shift)->associated_attribute; return sub { @@ -173,12 +167,6 @@ sub _generate_accessor_method_basic { }; } -sub generate_reader_method { - Carp::cluck('The generate_reader_method method has been made private.' - . " The public version is deprecated and will be removed in a future release.\n"); - shift->_generate_reader_method_basic; -} - sub _generate_reader_method_basic { my $attr = (shift)->associated_attribute; return sub { @@ -187,12 +175,6 @@ sub _generate_reader_method_basic { }; } -sub generate_writer_method { - Carp::cluck('The generate_writer_method method has been made private.' - . " The public version is deprecated and will be removed in a future release.\n"); - shift->_generate_writer_method_basic; -} - sub _generate_writer_method_basic { my $attr = (shift)->associated_attribute; return sub { @@ -200,12 +182,6 @@ sub _generate_writer_method_basic { }; } -sub generate_predicate_method { - Carp::cluck('The generate_predicate_method method has been made private.' - . " The public version is deprecated and will be removed in a future release.\n"); - shift->_generate_predicate_method_basic; -} - sub _generate_predicate_method_basic { my $attr = (shift)->associated_attribute; return sub { @@ -213,12 +189,6 @@ sub _generate_predicate_method_basic { }; } -sub generate_clearer_method { - Carp::cluck('The generate_clearer_method method has been made private.' - . " The public version is deprecated and will be removed in a future release.\n"); - shift->_generate_clearer_method_basic; -} - sub _generate_clearer_method_basic { my $attr = (shift)->associated_attribute; return sub { diff --git a/lib/Class/MOP/Method/Constructor.pm b/lib/Class/MOP/Method/Constructor.pm index 333f00d..9706e3e 100644 --- a/lib/Class/MOP/Method/Constructor.pm +++ b/lib/Class/MOP/Method/Constructor.pm @@ -85,13 +85,6 @@ sub _initialize_body { $self->{'body'} = $self->_generate_constructor_method(); } - -sub generate_constructor_method { - Carp::cluck('The generate_constructor_method method has been made private.' - . " The public version is deprecated and will be removed in a future release.\n"); - shift->_generate_constructor_method; -} - sub _generate_constructor_method { my ($self) = @_; diff --git a/mop.h b/mop.h index dd13848..7ac9de4 100644 --- a/mop.h +++ b/mop.h @@ -28,6 +28,7 @@ XS(mop_xs_simple_clearer); extern SV *mop_method_metaclass; extern SV *mop_associated_metaclass; +extern SV *mop_associated_attribute; extern SV *mop_wrap; extern SV *mop_methods; extern SV *mop_name; diff --git a/xs/Class.xs b/xs/Class.xs index b964d30..6cfb5bc 100644 --- a/xs/Class.xs +++ b/xs/Class.xs @@ -7,10 +7,7 @@ VERSIONCHECK: DISABLE BOOT: INSTALL_SIMPLE_READER_WITH_KEY(Class, get_attribute_map, attributes); - /* INSTALL_SIMPLE_READER_WITH_KEY(Class, _method_map, methods); */ INSTALL_SIMPLE_READER(Class, attribute_metaclass); - INSTALL_SIMPLE_READER(Class, method_metaclass); - INSTALL_SIMPLE_READER(Class, wrapped_method_metaclass); INSTALL_SIMPLE_READER(Class, instance_metaclass); INSTALL_SIMPLE_READER(Class, immutable_trait); INSTALL_SIMPLE_READER(Class, constructor_name); diff --git a/xs/MOP.xs b/xs/MOP.xs index e58d8a7..14efa49 100644 --- a/xs/MOP.xs +++ b/xs/MOP.xs @@ -2,6 +2,7 @@ SV *mop_method_metaclass; SV *mop_associated_metaclass; +SV *mop_associated_attribute; SV *mop_wrap; SV *mop_methods; SV *mop_name; @@ -96,9 +97,10 @@ mop_is_class_loaded(pTHX_ SV * const klass){ } EXTERN_C XS(boot_Class__MOP__Package); +EXTERN_C XS(boot_Class__MOP__Class); EXTERN_C XS(boot_Class__MOP__Attribute); -EXTERN_C XS(boot_Class__MOP__Method); EXTERN_C XS(boot_Class__MOP__Instance); +EXTERN_C XS(boot_Class__MOP__Method); EXTERN_C XS(boot_Class__MOP__Method__Accessor); EXTERN_C XS(boot_Class__MOP__Method__Constructor); @@ -108,8 +110,9 @@ PROTOTYPES: DISABLE BOOT: mop_method_metaclass = MAKE_KEYSV(method_metaclass); - mop_wrap = MAKE_KEYSV(wrap); mop_associated_metaclass = MAKE_KEYSV(associated_metaclass); + mop_associated_attribute = MAKE_KEYSV(associated_attribute); + mop_wrap = MAKE_KEYSV(wrap); mop_methods = MAKE_KEYSV(methods); mop_name = MAKE_KEYSV(name); mop_body = MAKE_KEYSV(body); @@ -124,6 +127,7 @@ BOOT: mop_can = MAKE_KEYSV(can); MOP_CALL_BOOT (boot_Class__MOP__Package); + MOP_CALL_BOOT (boot_Class__MOP__Class); MOP_CALL_BOOT (boot_Class__MOP__Attribute); MOP_CALL_BOOT (boot_Class__MOP__Instance); MOP_CALL_BOOT (boot_Class__MOP__Method); diff --git a/xs/Package.xs b/xs/Package.xs index 662f854..5765778 100644 --- a/xs/Package.xs +++ b/xs/Package.xs @@ -34,7 +34,7 @@ mop_update_method_map(pTHX_ SV *const self, SV *const class_name, HV *const stas method_slot = *hv_fetch(map, method_name, method_name_len, TRUE); if ( SvOK(method_slot) ) { - SV *const body = mop_call0(aTHX_ method_slot, KEY_FOR(body)); /* $method_object->body() */ + SV *const body = mop_call0(aTHX_ method_slot, mop_body); /* $method_object->body() */ if ( SvROK(body) && ((CV *) SvRV(body)) == cv ) { continue; } @@ -59,9 +59,9 @@ mop_update_method_map(pTHX_ SV *const self, SV *const class_name, HV *const stas mPUSHs(newRV_inc((SV *)cv)); PUSHs(mop_associated_metaclass); PUSHs(self); - PUSHs(KEY_FOR(package_name)); + PUSHs(mop_package_name); PUSHs(class_name); - PUSHs(KEY_FOR(name)); + PUSHs(mop_name); mPUSHs(newSVpv(method_name, method_name_len)); PUTBACK; @@ -125,7 +125,7 @@ get_method_map(self) SV *self PREINIT: HV *const obj = (HV *)SvRV(self); - SV *const class_name = HeVAL( hv_fetch_ent(obj, KEY_FOR(package), 0, HASH_FOR(package)) ); + SV *const class_name = HeVAL( hv_fetch_ent(obj, mop_package, 0, 0U) ); HV *const stash = gv_stashsv(class_name, 0); UV current; SV *cache_flag; @@ -137,8 +137,8 @@ get_method_map(self) } current = mop_check_package_cache_flag(aTHX_ stash); - cache_flag = HeVAL( hv_fetch_ent(obj, KEY_FOR(package_cache_flag), TRUE, HASH_FOR(package_cache_flag))); - map_ref = HeVAL( hv_fetch_ent(obj, KEY_FOR(methods), TRUE, HASH_FOR(methods))); + cache_flag = HeVAL( hv_fetch_ent(obj, mop_package_cache_flag, TRUE, 0U)); + map_ref = HeVAL( hv_fetch_ent(obj, mop_methods, TRUE, 0U)); /* $self->{methods} does not yet exist (or got deleted) */ if ( !SvROK(map_ref) || SvTYPE(SvRV(map_ref)) != SVt_PVHV ) {