Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
Pyston
Commits
3580fc81
Commit
3580fc81
authored
May 04, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #46 from undingen/small_improvements
Rearrange BoxedClass members to reduce size slightly (8 Bytes)
parents
31f9357e
b00af904
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
src/core/types.h
src/core/types.h
+9
-9
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+1
-1
No files found.
src/core/types.h
View file @
3580fc81
...
...
@@ -335,25 +335,25 @@ class BoxedClass : public HCBox {
//typedef void (*Dtor)(Box*);
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
// refcounts of any attributes
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
// 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
// to guard on anything about the class.
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
);
void
freeze
()
{
assert
(
!
is_constant
);
...
...
src/runtime/objmodel.cpp
View file @
3580fc81
...
...
@@ -278,7 +278,7 @@ extern "C" void checkUnpackingLength(i64 expected, i64 given) {
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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment