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
e432e29c
Commit
e432e29c
authored
Aug 31, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use DEFAULT_CLASS_SIMPLE in more cases
parent
b4ece352
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
19 additions
and
18 deletions
+19
-18
src/capi/types.h
src/capi/types.h
+1
-1
src/runtime/builtin_modules/builtins.cpp
src/runtime/builtin_modules/builtins.cpp
+1
-1
src/runtime/builtin_modules/thread.cpp
src/runtime/builtin_modules/thread.cpp
+1
-1
src/runtime/frame.cpp
src/runtime/frame.cpp
+1
-1
src/runtime/generator.cpp
src/runtime/generator.cpp
+3
-1
src/runtime/inline/xrange.cpp
src/runtime/inline/xrange.cpp
+2
-2
src/runtime/iterobject.h
src/runtime/iterobject.h
+1
-1
src/runtime/set.cpp
src/runtime/set.cpp
+1
-1
src/runtime/set.h
src/runtime/set.h
+2
-2
src/runtime/super.cpp
src/runtime/super.cpp
+1
-1
src/runtime/tuple.h
src/runtime/tuple.h
+1
-1
src/runtime/types.cpp
src/runtime/types.cpp
+1
-2
src/runtime/types.h
src/runtime/types.h
+3
-3
No files found.
src/capi/types.h
View file @
e432e29c
...
...
@@ -37,7 +37,7 @@ public:
Py_XINCREF
(
module
);
}
DEFAULT_CLASS
(
capifunc_cls
);
DEFAULT_CLASS
_SIMPLE
(
capifunc_cls
,
true
);
PyCFunction
getFunction
()
{
return
method_def
->
ml_meth
;
}
...
...
src/runtime/builtin_modules/builtins.cpp
View file @
e432e29c
...
...
@@ -1318,7 +1318,7 @@ public:
Py_XINCREF
(
idx_long
);
}
DEFAULT_CLASS
(
enumerate_cls
);
DEFAULT_CLASS
_SIMPLE
(
enumerate_cls
,
true
);
static
Box
*
new_
(
Box
*
cls
,
Box
*
obj
,
Box
*
start
)
{
RELEASE_ASSERT
(
cls
==
enumerate_cls
,
""
);
...
...
src/runtime/builtin_modules/thread.cpp
View file @
e432e29c
...
...
@@ -126,7 +126,7 @@ private:
public:
BoxedThreadLock
()
{
lock_lock
=
PyThread_allocate_lock
();
}
DEFAULT_CLASS
(
thread_lock_cls
);
DEFAULT_CLASS
_SIMPLE
(
thread_lock_cls
,
false
);
static
Box
*
acquire
(
Box
*
_self
,
Box
*
_waitflag
)
{
RELEASE_ASSERT
(
_self
->
cls
==
thread_lock_cls
,
""
);
...
...
src/runtime/frame.cpp
View file @
e432e29c
...
...
@@ -163,7 +163,7 @@ public:
assert
(
hasExited
());
}
DEFAULT_CLASS
(
frame_cls
);
DEFAULT_CLASS
_SIMPLE
(
frame_cls
,
true
);
static
BORROWED
(
Box
*
)
boxFrame
(
FrameInfo
*
fi
)
{
if
(
fi
->
frame_obj
==
NULL
)
...
...
src/runtime/generator.cpp
View file @
e432e29c
...
...
@@ -434,7 +434,8 @@ extern "C" BoxedGenerator* createGenerator(BoxedFunctionBase* function, Box* arg
static
uint64_t
*
generator_timer_counter
=
Stats
::
getStatCounter
(
"us_timer_generator_toplevel"
);
#endif
extern
"C"
BoxedGenerator
::
BoxedGenerator
(
BoxedFunctionBase
*
function
,
Box
*
arg1
,
Box
*
arg2
,
Box
*
arg3
,
Box
**
args
)
:
function
(
function
),
:
weakreflist
(
NULL
),
function
(
function
),
arg1
(
arg1
),
arg2
(
arg2
),
arg3
(
arg3
),
...
...
@@ -442,6 +443,7 @@ extern "C" BoxedGenerator::BoxedGenerator(BoxedFunctionBase* function, Box* arg1
entryExited
(
false
),
running
(
false
),
returnValue
(
nullptr
),
iterated_from__hasnext__
(
false
),
exception
(
nullptr
,
nullptr
,
nullptr
),
context
(
nullptr
),
returnContext
(
nullptr
),
...
...
src/runtime/inline/xrange.cpp
View file @
e432e29c
...
...
@@ -59,7 +59,7 @@ public:
friend
class
BoxedXrangeIterator
;
DEFAULT_CLASS
(
xrange_cls
);
DEFAULT_CLASS
_SIMPLE
(
xrange_cls
,
false
);
};
class
BoxedXrangeIterator
:
public
Box
{
...
...
@@ -87,7 +87,7 @@ public:
cur
=
start
;
}
DEFAULT_CLASS
(
xrange_iterator_cls
);
DEFAULT_CLASS
_SIMPLE
(
xrange_iterator_cls
,
true
);
static
llvm_compat_bool
xrangeIteratorHasnextUnboxed
(
Box
*
s
)
__attribute__
((
visibility
(
"default"
)))
{
assert
(
s
->
cls
==
xrange_iterator_cls
);
...
...
src/runtime/iterobject.h
View file @
e432e29c
...
...
@@ -76,7 +76,7 @@ public:
BoxedIterWrapper
(
Box
*
iter
)
:
iter
(
iter
),
next
(
NULL
)
{
Py_INCREF
(
iter
);
}
DEFAULT_CLASS
(
iterwrapper_cls
);
DEFAULT_CLASS
_SIMPLE
(
iterwrapper_cls
,
true
);
static
void
dealloc
(
BoxedIterWrapper
*
o
)
noexcept
{
PyObject_GC_UnTrack
(
o
);
...
...
src/runtime/set.cpp
View file @
e432e29c
...
...
@@ -61,7 +61,7 @@ public:
BoxedSetIterator
(
BoxedSet
*
s
)
:
s
(
s
),
it
(
s
->
s
.
begin
()),
size
(
s
->
s
.
size
())
{
Py_INCREF
(
s
);
}
DEFAULT_CLASS
(
set_iterator_cls
);
DEFAULT_CLASS
_SIMPLE
(
set_iterator_cls
,
true
);
bool
hasNext
()
{
return
it
!=
s
->
s
.
end
();
}
...
...
src/runtime/set.h
View file @
e432e29c
...
...
@@ -31,11 +31,11 @@ public:
Set
s
;
Box
**
weakreflist
;
/* List of weak references */
BoxedSet
()
__attribute__
((
visibility
(
"default"
)))
{}
BoxedSet
()
__attribute__
((
visibility
(
"default"
)))
:
weakreflist
(
NULL
)
{}
template
<
typename
T
>
__attribute__
((
visibility
(
"default"
)))
BoxedSet
(
T
&&
s
)
:
s
(
std
::
forward
<
T
>
(
s
))
{}
DEFAULT_CLASS
(
set_cls
);
DEFAULT_CLASS
_SIMPLE
(
set_cls
,
true
);
static
void
dealloc
(
Box
*
b
)
noexcept
;
static
int
traverse
(
Box
*
self
,
visitproc
visit
,
void
*
arg
)
noexcept
;
...
...
src/runtime/super.cpp
View file @
e432e29c
...
...
@@ -38,7 +38,7 @@ public:
Py_INCREF
(
obj_type
);
}
DEFAULT_CLASS
(
super_cls
);
DEFAULT_CLASS
_SIMPLE
(
super_cls
,
true
);
static
void
dealloc
(
Box
*
b
)
noexcept
{
BoxedSuper
*
self
=
(
BoxedSuper
*
)
b
;
...
...
src/runtime/tuple.h
View file @
e432e29c
...
...
@@ -27,7 +27,7 @@ public:
int
pos
;
BoxedTupleIterator
(
BoxedTuple
*
t
);
DEFAULT_CLASS
(
tuple_iterator_cls
);
DEFAULT_CLASS
_SIMPLE
(
tuple_iterator_cls
,
true
);
static
void
dealloc
(
BoxedTupleIterator
*
o
)
noexcept
{
PyObject_GC_UnTrack
(
o
);
...
...
src/runtime/types.cpp
View file @
e432e29c
...
...
@@ -2265,14 +2265,13 @@ private:
public:
AttrWrapperIter
(
AttrWrapper
*
aw
);
DEFAULT_CLASS
(
attrwrapperiter_cls
);
DEFAULT_CLASS
_SIMPLE
(
attrwrapperiter_cls
,
false
);
static
Box
*
hasnext
(
Box
*
_self
);
static
Box
*
next
(
Box
*
_self
);
static
Box
*
next_capi
(
Box
*
_self
)
noexcept
;
static
void
dealloc
(
Box
*
b
)
noexcept
;
static
int
traverse
(
Box
*
self
,
visitproc
visit
,
void
*
arg
)
noexcept
;
};
// A dictionary-like wrapper around the attributes array.
...
...
src/runtime/types.h
View file @
e432e29c
...
...
@@ -1116,7 +1116,7 @@ public:
BoxedBuiltinFunctionOrMethod
(
FunctionMetadata
*
f
,
const
char
*
name
,
std
::
initializer_list
<
Box
*>
defaults
,
BoxedClosure
*
closure
=
NULL
,
const
char
*
doc
=
NULL
);
DEFAULT_CLASS
(
builtin_function_or_method_cls
);
DEFAULT_CLASS
_SIMPLE
(
builtin_function_or_method_cls
,
true
);
};
extern
"C"
void
_PyModule_Clear
(
PyObject
*
)
noexcept
;
...
...
@@ -1268,7 +1268,7 @@ public:
void
*
stack_begin
;
FrameInfo
*
top_caller_frame_info
;
// The FrameInfo that called into this generator.
// For abandoned-generator collection
-- WIP
// For abandoned-generator collection
FrameInfo
*
paused_frame_info
;
// The FrameInfo the generator was on when it called yield (or NULL if the generator
// hasn't started or has exited).
...
...
@@ -1281,7 +1281,7 @@ public:
BoxedGenerator
(
BoxedFunctionBase
*
function
,
Box
*
arg1
,
Box
*
arg2
,
Box
*
arg3
,
Box
**
args
);
DEFAULT_CLASS
(
generator_cls
);
DEFAULT_CLASS
_SIMPLE
(
generator_cls
,
true
);
};
Box
*
objectSetattr
(
Box
*
obj
,
Box
*
attr
,
Box
*
value
);
...
...
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