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
154a71e8
Commit
154a71e8
authored
Mar 11, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Went through runtime/*.h
parent
293e884e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
33 additions
and
11 deletions
+33
-11
src/runtime/hiddenclass.h
src/runtime/hiddenclass.h
+1
-1
src/runtime/iterobject.h
src/runtime/iterobject.h
+6
-2
src/runtime/set.cpp
src/runtime/set.cpp
+3
-0
src/runtime/types.cpp
src/runtime/types.cpp
+1
-1
src/runtime/types.h
src/runtime/types.h
+22
-7
No files found.
src/runtime/hiddenclass.h
View file @
154a71e8
...
@@ -92,7 +92,7 @@ public:
...
@@ -92,7 +92,7 @@ public:
// The mapping from string attribute names to attribute offsets. There may be other objects in the attributes
// The mapping from string attribute names to attribute offsets. There may be other objects in the attributes
// array.
// array.
// Only valid for NORMAL or SINGLETON hidden classes
// Only valid for NORMAL or SINGLETON hidden classes
const
llvm
::
DenseMap
<
BoxedString
*
,
int
>&
getStrAttrOffsets
()
{
BORROWED
(
const
llvm
::
DenseMap
<
BoxedString
*
,
int
>&
)
getStrAttrOffsets
()
{
assert
(
type
==
NORMAL
||
type
==
SINGLETON
);
assert
(
type
==
NORMAL
||
type
==
SINGLETON
);
return
attr_offsets
;
return
attr_offsets
;
}
}
...
...
src/runtime/iterobject.h
View file @
154a71e8
...
@@ -33,7 +33,9 @@ public:
...
@@ -33,7 +33,9 @@ public:
int64_t
idx
;
int64_t
idx
;
Box
*
next
;
Box
*
next
;
BoxedSeqIter
(
Box
*
b
,
int64_t
start
)
:
b
(
b
),
idx
(
start
),
next
(
NULL
)
{}
BoxedSeqIter
(
Box
*
b
,
int64_t
start
)
:
b
(
b
),
idx
(
start
),
next
(
NULL
)
{
Py_INCREF
(
b
);
}
DEFAULT_CLASS
(
seqiter_cls
);
DEFAULT_CLASS
(
seqiter_cls
);
...
@@ -59,7 +61,9 @@ public:
...
@@ -59,7 +61,9 @@ public:
Box
*
iter
;
Box
*
iter
;
Box
*
next
;
Box
*
next
;
BoxedIterWrapper
(
Box
*
iter
)
:
iter
(
iter
),
next
(
NULL
)
{}
BoxedIterWrapper
(
Box
*
iter
)
:
iter
(
iter
),
next
(
NULL
)
{
Py_INCREF
(
iter
);
}
DEFAULT_CLASS
(
iterwrapper_cls
);
DEFAULT_CLASS
(
iterwrapper_cls
);
...
...
src/runtime/set.cpp
View file @
154a71e8
...
@@ -48,7 +48,10 @@ public:
...
@@ -48,7 +48,10 @@ public:
static
void
dealloc
(
BoxedSetIterator
*
o
)
noexcept
{
static
void
dealloc
(
BoxedSetIterator
*
o
)
noexcept
{
PyObject_GC_UnTrack
(
o
);
PyObject_GC_UnTrack
(
o
);
PyObject_ClearWeakRefs
((
PyObject
*
)
self
);
Py_DECREF
(
o
->
s
);
Py_DECREF
(
o
->
s
);
o
->
cls
->
tp_free
(
o
);
o
->
cls
->
tp_free
(
o
);
}
}
...
...
src/runtime/types.cpp
View file @
154a71e8
...
@@ -3941,7 +3941,7 @@ void setupRuntime() {
...
@@ -3941,7 +3941,7 @@ void setupRuntime() {
BoxedClass
(
object_cls
,
0
,
0
,
sizeof
(
BoxedWrapperObject
),
false
,
"method-wrapper"
,
false
,
BoxedClass
(
object_cls
,
0
,
0
,
sizeof
(
BoxedWrapperObject
),
false
,
"method-wrapper"
,
false
,
BoxedWrapperObject
::
dealloc
,
NULL
,
true
,
BoxedWrapperObject
::
traverse
,
NOCLEAR
);
BoxedWrapperObject
::
dealloc
,
NULL
,
true
,
BoxedWrapperObject
::
traverse
,
NOCLEAR
);
wrapperdescr_cls
=
new
(
0
)
BoxedClass
(
object_cls
,
0
,
0
,
sizeof
(
BoxedWrapperDescriptor
),
false
,
"wrapper_descriptor"
,
wrapperdescr_cls
=
new
(
0
)
BoxedClass
(
object_cls
,
0
,
0
,
sizeof
(
BoxedWrapperDescriptor
),
false
,
"wrapper_descriptor"
,
false
,
NULL
,
NULL
,
false
);
false
,
BoxedWrapperDescriptor
::
dealloc
,
NULL
,
false
);
EmptyString
=
new
(
0
)
BoxedString
(
""
);
EmptyString
=
new
(
0
)
BoxedString
(
""
);
constants
.
push_back
(
EmptyString
);
constants
.
push_back
(
EmptyString
);
...
...
src/runtime/types.h
View file @
154a71e8
...
@@ -1086,8 +1086,12 @@ public:
...
@@ -1086,8 +1086,12 @@ public:
Box
*
prop_doc
;
Box
*
prop_doc
;
bool
getter_doc
;
bool
getter_doc
;
BoxedProperty
(
Box
*
get
,
Box
*
set
,
Box
*
del
,
Box
*
doc
)
BoxedProperty
(
Box
*
get
,
Box
*
set
,
Box
*
del
,
Box
*
doc
)
:
prop_get
(
get
),
prop_set
(
set
),
prop_del
(
del
),
prop_doc
(
doc
)
{
:
prop_get
(
get
),
prop_set
(
set
),
prop_del
(
del
),
prop_doc
(
doc
)
{}
Py_XINCREF
(
get
);
Py_XINCREF
(
set
);
Py_XINCREF
(
del
);
Py_XINCREF
(
doc
);
}
static
void
dealloc
(
Box
*
b
)
noexcept
;
static
void
dealloc
(
Box
*
b
)
noexcept
;
static
int
traverse
(
Box
*
self
,
visitproc
visit
,
void
*
arg
)
noexcept
;
static
int
traverse
(
Box
*
self
,
visitproc
visit
,
void
*
arg
)
noexcept
;
...
@@ -1114,7 +1118,9 @@ class BoxedClassmethod : public Box {
...
@@ -1114,7 +1118,9 @@ class BoxedClassmethod : public Box {
public:
public:
Box
*
cm_callable
;
Box
*
cm_callable
;
BoxedClassmethod
(
Box
*
callable
)
:
cm_callable
(
callable
)
{}
BoxedClassmethod
(
Box
*
callable
)
:
cm_callable
(
callable
)
{
Py_INCREF
(
cm_callable
);
}
DEFAULT_CLASS_SIMPLE
(
classmethod_cls
,
true
);
DEFAULT_CLASS_SIMPLE
(
classmethod_cls
,
true
);
...
@@ -1130,7 +1136,9 @@ public:
...
@@ -1130,7 +1136,9 @@ public:
size_t
nelts
;
size_t
nelts
;
Box
*
elts
[
0
];
Box
*
elts
[
0
];
BoxedClosure
(
BoxedClosure
*
parent
)
:
parent
(
parent
)
{}
BoxedClosure
(
BoxedClosure
*
parent
)
:
parent
(
parent
)
{
Py_XINCREF
(
parent
);
}
// TODO: convert this to a var-object and use DEFAULT_CLASS_VAR_SIMPLE
// TODO: convert this to a var-object and use DEFAULT_CLASS_VAR_SIMPLE
void
*
operator
new
(
size_t
size
,
size_t
nelts
)
__attribute__
((
visibility
(
"default"
)))
{
void
*
operator
new
(
size_t
size
,
size_t
nelts
)
__attribute__
((
visibility
(
"default"
)))
{
...
@@ -1191,7 +1199,11 @@ public:
...
@@ -1191,7 +1199,11 @@ public:
BoxedClass
*
type
;
BoxedClass
*
type
;
void
*
wrapped
;
void
*
wrapped
;
BoxedWrapperDescriptor
(
const
wrapper_def
*
wrapper
,
BoxedClass
*
type
,
void
*
wrapped
)
BoxedWrapperDescriptor
(
const
wrapper_def
*
wrapper
,
BoxedClass
*
type
,
void
*
wrapped
)
:
wrapper
(
wrapper
),
type
(
type
),
wrapped
(
wrapped
)
{}
:
wrapper
(
wrapper
),
type
(
type
),
wrapped
(
wrapped
)
{
Py_INCREF
(
type
);
}
void
dealloc
(
Box
*
b
)
noexcept
;
DEFAULT_CLASS
(
wrapperdescr_cls
);
DEFAULT_CLASS
(
wrapperdescr_cls
);
...
@@ -1207,7 +1219,10 @@ public:
...
@@ -1207,7 +1219,10 @@ public:
BoxedWrapperDescriptor
*
descr
;
BoxedWrapperDescriptor
*
descr
;
Box
*
obj
;
Box
*
obj
;
BoxedWrapperObject
(
BoxedWrapperDescriptor
*
descr
,
Box
*
obj
)
:
descr
(
descr
),
obj
(
obj
)
{}
BoxedWrapperObject
(
BoxedWrapperDescriptor
*
descr
,
Box
*
obj
)
:
descr
(
descr
),
obj
(
obj
)
{
Py_INCREF
(
descr
);
Py_INCREF
(
obj
);
}
DEFAULT_CLASS
(
wrapperobject_cls
);
DEFAULT_CLASS
(
wrapperobject_cls
);
...
@@ -1309,7 +1324,7 @@ inline Box*& getArg(int idx, Box*& arg1, Box*& arg2, Box*& arg3, Box** args) {
...
@@ -1309,7 +1324,7 @@ inline Box*& getArg(int idx, Box*& arg1, Box*& arg2, Box*& arg3, Box** args) {
return
args
[
idx
-
3
];
return
args
[
idx
-
3
];
}
}
inline
B
oxedString
*
getStaticString
(
llvm
::
StringRef
s
)
{
inline
B
ORROWED
(
BoxedString
*
)
getStaticString
(
llvm
::
StringRef
s
)
{
BoxedString
*
r
=
internStringImmortal
(
s
);
BoxedString
*
r
=
internStringImmortal
(
s
);
constants
.
push_back
(
r
);
constants
.
push_back
(
r
);
return
r
;
return
r
;
...
...
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