[subset-cff] Really optimize op_str_t / parsed_cs_op_t layout
Now parsed_cs_op_t and op_str_t are both 16 bytes. Saves another 7% in SourceHanSans/10000 benchmark.
This commit is contained in:
parent
2d5ee23731
commit
28e767ddea
|
@ -480,12 +480,15 @@ struct arg_stack_t : cff_stack_t<ARG, 513>
|
||||||
/* an operator prefixed by its operands in a byte string */
|
/* an operator prefixed by its operands in a byte string */
|
||||||
struct op_str_t
|
struct op_str_t
|
||||||
{
|
{
|
||||||
/* This used to be a hb_ubytes_t. Using a pointer and length
|
/* This used to have a hb_ubytes_t. Using a pointer and length
|
||||||
* saves 8 bytes in the struct. */
|
* in a particular order, saves 8 bytes in this struct and more
|
||||||
|
* in our parsed_cs_op_t subclass. */
|
||||||
|
|
||||||
const unsigned char *ptr = nullptr;
|
const unsigned char *ptr = nullptr;
|
||||||
unsigned length = 0;
|
|
||||||
|
|
||||||
op_code_t op;
|
op_code_t op;
|
||||||
|
|
||||||
|
uint8_t length = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* base of OP_SERIALIZER */
|
/* base of OP_SERIALIZER */
|
||||||
|
|
|
@ -309,12 +309,13 @@ struct parsed_cs_op_t : op_str_t
|
||||||
bool for_skip () const { return skip_flag; }
|
bool for_skip () const { return skip_flag; }
|
||||||
void set_skip () { skip_flag = true; }
|
void set_skip () { skip_flag = true; }
|
||||||
|
|
||||||
unsigned subr_num;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool drop_flag : 1;
|
bool drop_flag : 1;
|
||||||
bool keep_flag : 1;
|
bool keep_flag : 1;
|
||||||
bool skip_flag : 1;
|
bool skip_flag : 1;
|
||||||
|
|
||||||
|
public:
|
||||||
|
uint16_t subr_num;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct parsed_cs_str_t : parsed_values_t<parsed_cs_op_t>
|
struct parsed_cs_str_t : parsed_values_t<parsed_cs_op_t>
|
||||||
|
|
Loading…
Reference in New Issue