diff options
author | syber <syber@crazypanda.ru> | 2014-09-04 22:08:59 +0400 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2014-10-03 13:40:54 +0100 |
commit | b46e009d94293e069270690750f6c669c6d0ce22 (patch) | |
tree | c335154dccea12b391db6aaf7cac73db22e08f43 /embed.fnc | |
parent | df968918245d10232f955ab0965da7f8d6297a29 (diff) | |
download | perl-b46e009d94293e069270690750f6c669c6d0ce22.tar.gz |
Make OP_METHOD* to be of new class METHOP
Introduce a new opcode class, METHOP, which will hold class/method related
info needed at runtime to improve performance of class/object method
calls, then change OP_METHOD and OP_METHOD_NAMED from being UNOP/SVOP to
being METHOP.
Note that because OP_METHOD is a UNOP with an op_first, while
OP_METHOD_NAMED is an SVOP, the first field of the METHOP structure
is a union holding either op_first or op_sv. This was seen as less messy
than having to introduce two new op classes.
The new op class's character is '.'
Nothing has changed in functionality and/or performance by this commit.
It just introduces new structure which will be extended with extra
fields and used in later commits.
Added METHOP constructors:
- newMETHOP() for method ops with dynamic method names.
The only optype for this op is OP_METHOD.
- newMETHOP_named() for method ops with constant method names.
Optypes for this op are: OP_METHOD_NAMED (currently) and (later)
OP_METHOD_SUPER, OP_METHOD_REDIR, OP_METHOD_NEXT, OP_METHOD_NEXTCAN,
OP_METHOD_MAYBENEXT
(This commit includes fixups by davem)
Diffstat (limited to 'embed.fnc')
-rw-r--r-- | embed.fnc | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -471,6 +471,11 @@ p |char* |find_script |NN const char *scriptname|bool dosearch \ s |OP* |force_list |NULLOK OP* arg|bool nullit i |OP* |op_integerize |NN OP *o i |OP* |op_std_init |NN OP *o +#if defined(USE_ITHREADS) +i |void |op_relocate_sv |NN SV** svp|NN PADOFFSET* targp +#endif +i |OP* |newMETHOP_internal |I32 type|I32 flags|NULLOK OP* dynamic_meth \ + |NULLOK SV* const_meth : FIXME s |OP* |fold_constants |NN OP *o #endif @@ -1029,6 +1034,8 @@ Apda |OP* |newWHENOP |NULLOK OP* cond|NN OP* block Apda |OP* |newWHILEOP |I32 flags|I32 debuggable|NULLOK LOOP* loop \ |NULLOK OP* expr|NULLOK OP* block|NULLOK OP* cont \ |I32 has_my +Apda |OP* |newMETHOP |I32 type|I32 flags|NN OP* dynamic_meth +Apda |OP* |newMETHOP_named|I32 type|I32 flags|NN SV* const_meth Apd |CV* |rv2cv_op_cv |NN OP *cvop|U32 flags Apd |OP* |ck_entersub_args_list|NN OP *entersubop Apd |OP* |ck_entersub_args_proto|NN OP *entersubop|NN GV *namegv|NN SV *protosv |