Commit b00af904 authored by Marius Wachtler's avatar Marius Wachtler

Rearrange BoxedClass members to redcue size slightly (8 Bytes)

parent 153ac11a
...@@ -335,25 +335,25 @@ class BoxedClass : public HCBox { ...@@ -335,25 +335,25 @@ class BoxedClass : public HCBox {
//typedef void (*Dtor)(Box*); //typedef void (*Dtor)(Box*);
typedef void* Dtor; typedef void* Dtor;
// whether or not instances of this class are subclasses of HCBox,
// ie they have python-level instance attributes:
const bool hasattrs;
// compiler-level (cf python-level) destructor, that does things like decrementing // compiler-level (cf python-level) destructor, that does things like decrementing
// refcounts of any attributes // refcounts of any attributes
const Dtor dtor; const Dtor dtor;
// Whether this class object is constant or not.
// Does not necessarily imply that the instances of this class are constant,
// though for now (is_constant && !hasattrs) does imply that the instances are constant.
bool is_constant;
// If the user sets __getattribute__ or __getattr__, we will have to invalidate // If the user sets __getattribute__ or __getattr__, we will have to invalidate
// all getattr IC entries that relied on the fact that those functions didn't exist. // all getattr IC entries that relied on the fact that those functions didn't exist.
// Doing this via invalidation means that instance attr lookups don't have // Doing this via invalidation means that instance attr lookups don't have
// to guard on anything about the class. // to guard on anything about the class.
ICInvalidator dependent_icgetattrs; ICInvalidator dependent_icgetattrs;
// whether or not instances of this class are subclasses of HCBox,
// ie they have python-level instance attributes:
const bool hasattrs;
// Whether this class object is constant or not.
// Does not necessarily imply that the instances of this class are constant,
// though for now (is_constant && !hasattrs) does imply that the instances are constant.
bool is_constant;
BoxedClass(bool hasattrs, Dtor dtor); BoxedClass(bool hasattrs, Dtor dtor);
void freeze() { void freeze() {
assert(!is_constant); assert(!is_constant);
......
...@@ -278,7 +278,7 @@ extern "C" void checkUnpackingLength(i64 expected, i64 given) { ...@@ -278,7 +278,7 @@ extern "C" void checkUnpackingLength(i64 expected, i64 given) {
raiseExc(); raiseExc();
} }
BoxedClass::BoxedClass(bool hasattrs, BoxedClass::Dtor dtor): HCBox(&type_flavor, type_cls), hasattrs(hasattrs), dtor(dtor), is_constant(false) { BoxedClass::BoxedClass(bool hasattrs, BoxedClass::Dtor dtor): HCBox(&type_flavor, type_cls), dtor(dtor), hasattrs(hasattrs), is_constant(false) {
} }
extern "C" const std::string* getNameOfClass(BoxedClass* cls) { extern "C" const std::string* getNameOfClass(BoxedClass* cls) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment