Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature.*: allow cop_feature to expand #22824

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions cop.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,15 @@ the octets.

#include "mydtrace.h"

/* keep in sync with feature.h (which will complain if this is out of sync)
*/
#define COP_FEATURE_SIZE 1

/* make this a struct so we can copy the feature bits with assignment */
struct cop_feature_t {
U32 bits[COP_FEATURE_SIZE];
};

struct cop {
BASEOP
/* On LP64 putting this here takes advantage of the fact that BASEOP isn't
Expand All @@ -460,12 +469,11 @@ struct cop {
/* compile time state of %^H. See the comment in op.c for how this is
used to recreate a hash to return from caller. */
COPHH * cop_hints_hash;
/* for now just a bitmask stored here.
If we get sufficient features this may become a pointer.
/*
How these flags are stored is subject to change without
notice. Use the macros to test for features.
*/
U32 cop_features;
struct cop_feature_t cop_features;
};

/*
Expand Down
8 changes: 6 additions & 2 deletions dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#define PERL_IN_DUMP_C
#include "perl.h"
#include "regcomp.h"
#include "feature.h"

static const char* const svtypenames[SVt_LAST] = {
"NULL",
Expand Down Expand Up @@ -1414,8 +1415,11 @@ S_do_op_dump_bar(pTHX_ I32 level, UV bar, PerlIO *file, const OP *o)
/* add hints and features if set */
if (cCOPo->cop_hints)
S_opdump_indent(aTHX_ o, level, bar, file, "HINTS = %08x\n",cCOPo->cop_hints);
if (cCOPo->cop_features)
S_opdump_indent(aTHX_ o, level, bar, file, "FEATS = %08x\n",cCOPo->cop_features);
if (ANY_FEATURE_BITS_SET(cCOPo)) {
S_opdump_indent(aTHX_ o, level, bar, file, "FEATS = ");
DUMP_FEATURE_BITS(file, cCOPo);
PerlIO_puts(file, "\n");
}

S_opdump_indent(aTHX_ o, level, bar, file, "SEQ = %u\n",
(unsigned int)cCOPo->cop_seq);
Expand Down
Loading
Loading