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
3f9097fa
Commit
3f9097fa
authored
Jul 09, 2015
by
Rudi Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some comments to the code.
parent
94687bdb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
1 deletion
+33
-1
src/capi/typeobject.h
src/capi/typeobject.h
+8
-0
src/codegen/ast_interpreter.cpp
src/codegen/ast_interpreter.cpp
+6
-0
src/core/types.h
src/core/types.h
+6
-0
src/runtime/classobj.h
src/runtime/classobj.h
+11
-0
src/runtime/types.h
src/runtime/types.h
+2
-1
No files found.
src/capi/typeobject.h
View file @
3f9097fa
...
...
@@ -19,6 +19,14 @@
namespace
pyston
{
/*
* Type objects refer to Python's new-style classes that inherit from
* `object`. This, classes declared as:
*
* class Foo(object):
* ...
*/
// Returns if a slot was updated
bool
update_slot
(
BoxedClass
*
self
,
llvm
::
StringRef
attr
)
noexcept
;
...
...
src/codegen/ast_interpreter.cpp
View file @
3f9097fa
...
...
@@ -75,6 +75,12 @@ public:
static
void
deregister
(
void
*
frame_addr
);
};
/*
* ASTInterpreters exist per function frame - there's no global interpreter object that executes
* all non-jitted code!
*
* The ASTInterpreter inherits from Box as part of garbage collection support.
*/
class
ASTInterpreter
:
public
Box
{
public:
typedef
ContiguousMap
<
InternedString
,
Box
*>
SymMap
;
...
...
src/core/types.h
View file @
3f9097fa
...
...
@@ -481,6 +481,12 @@ public:
class
BoxedDict
;
class
BoxedString
;
// In Pyston, this is the same type as CPython's PyObject (they are interchangeable, but we
// use Box in Pyston wherever possible as a convention).
//
// Other types on Pyston inherit from Box (e.g. BoxedString is a Box). Why is this class not
// polymorphic? Because of C extension support -- having virtual methods would change the layout
// of the object.
class
Box
{
private:
BoxedDict
**
getDictPtr
();
...
...
src/runtime/classobj.h
View file @
3f9097fa
...
...
@@ -19,6 +19,17 @@
namespace
pyston
{
/*
* Class objects refer to Python's old-style classes that don't inherit from
* `object`. This, classes declared as:
*
* class Foo:
* ...
*
* When debugging, "obj->cls->tp_name" will have value "instance" for all
* old-style classes rather than the name of the class itself.
*/
void
setupClassobj
();
class
BoxedClass
;
...
...
src/runtime/types.h
View file @
3f9097fa
...
...
@@ -142,7 +142,8 @@ extern "C" void printFloat(double d);
Box
*
objectStr
(
Box
*
);
Box
*
objectRepr
(
Box
*
);
// In Pyston, this is the same type as CPython's PyTypeObject (they are interchangeable, but we
// use BoxedClass in Pyston wherever possible as a convention).
class
BoxedClass
:
public
BoxVar
{
public:
typedef
void
(
*
gcvisit_func
)(
GCVisitor
*
,
Box
*
);
...
...
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