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
8170d8ae
Commit
8170d8ae
authored
Jul 28, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add noexcept() specifiers
Apparently they can do compile-time evaluations, which is cool.
parent
ed14dd77
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+8
-4
src/runtime/objmodel.h
src/runtime/objmodel.h
+4
-3
No files found.
src/runtime/objmodel.cpp
View file @
8170d8ae
...
...
@@ -1475,7 +1475,7 @@ Box* dataDescriptorInstanceSpecialCases(GetattrRewriteArgs* rewrite_args, BoxedS
template
<
enum
ExceptionStyle
S
>
Box
*
getattrInternalEx
(
Box
*
obj
,
BoxedString
*
attr
,
GetattrRewriteArgs
*
rewrite_args
,
bool
cls_only
,
bool
for_call
,
Box
**
bind_obj_out
,
RewriterVar
**
r_bind_obj_out
)
{
Box
**
bind_obj_out
,
RewriterVar
**
r_bind_obj_out
)
noexcept
(
S
==
ExceptionStyle
::
CAPI
)
{
assert
(
gc
::
isValidGCObject
(
attr
));
if
(
S
==
CAPI
)
{
...
...
@@ -1979,7 +1979,9 @@ Box* getattrInternalGeneric(Box* obj, BoxedString* attr, GetattrRewriteArgs* rew
return
NULL
;
}
template
<
enum
ExceptionStyle
S
>
Box
*
getattrInternal
(
Box
*
obj
,
BoxedString
*
attr
,
GetattrRewriteArgs
*
rewrite_args
)
{
template
<
enum
ExceptionStyle
S
>
Box
*
getattrInternal
(
Box
*
obj
,
BoxedString
*
attr
,
GetattrRewriteArgs
*
rewrite_args
)
noexcept
(
S
==
ExceptionStyle
::
CAPI
)
{
return
getattrInternalEx
<
S
>
(
obj
,
attr
,
rewrite_args
,
/* cls_only */
false
,
/* for_call */
false
,
NULL
,
NULL
);
...
...
@@ -2592,7 +2594,8 @@ extern "C" BoxedInt* hash(Box* obj) {
return
new
BoxedInt
(
r
);
}
template
<
enum
ExceptionStyle
S
>
BoxedInt
*
lenInternal
(
Box
*
obj
,
LenRewriteArgs
*
rewrite_args
)
{
template
<
enum
ExceptionStyle
S
>
BoxedInt
*
lenInternal
(
Box
*
obj
,
LenRewriteArgs
*
rewrite_args
)
noexcept
(
S
==
ExceptionStyle
::
CAPI
)
{
static
BoxedString
*
len_str
=
internStringImmortal
(
"__len__"
);
if
(
S
==
CAPI
)
{
...
...
@@ -4625,7 +4628,8 @@ Box* callItemOrSliceAttr(Box* target, BoxedString* item_str, BoxedString* slice_
}
}
template
<
enum
ExceptionStyle
S
>
Box
*
getitemInternal
(
Box
*
target
,
Box
*
slice
,
GetitemRewriteArgs
*
rewrite_args
)
{
template
<
enum
ExceptionStyle
S
>
Box
*
getitemInternal
(
Box
*
target
,
Box
*
slice
,
GetitemRewriteArgs
*
rewrite_args
)
noexcept
(
S
==
ExceptionStyle
::
CAPI
)
{
if
(
S
==
CAPI
)
{
assert
(
!
rewrite_args
&&
"implement me"
);
rewrite_args
=
NULL
;
...
...
src/runtime/objmodel.h
View file @
8170d8ae
...
...
@@ -116,10 +116,11 @@ Box* runtimeCallInternal(Box* obj, CallRewriteArgs* rewrite_args, ArgPassSpec ar
struct
GetitemRewriteArgs
;
template
<
ExceptionStyle
::
ExceptionStyle
S
>
Box
*
getitemInternal
(
Box
*
target
,
Box
*
slice
,
GetitemRewriteArgs
*
rewrite_args
);
Box
*
getitemInternal
(
Box
*
target
,
Box
*
slice
,
GetitemRewriteArgs
*
rewrite_args
)
noexcept
(
S
==
ExceptionStyle
::
CAPI
)
;
struct
LenRewriteArgs
;
template
<
ExceptionStyle
::
ExceptionStyle
S
>
BoxedInt
*
lenInternal
(
Box
*
obj
,
LenRewriteArgs
*
rewrite_args
);
template
<
ExceptionStyle
::
ExceptionStyle
S
>
BoxedInt
*
lenInternal
(
Box
*
obj
,
LenRewriteArgs
*
rewrite_args
)
noexcept
(
S
==
ExceptionStyle
::
CAPI
);
Box
*
lenCallInternal
(
BoxedFunctionBase
*
f
,
CallRewriteArgs
*
rewrite_args
,
ArgPassSpec
argspec
,
Box
*
arg1
,
Box
*
arg2
,
Box
*
arg3
,
Box
**
args
,
const
std
::
vector
<
BoxedString
*>*
keyword_names
);
...
...
@@ -141,7 +142,7 @@ Box* compareInternal(Box* lhs, Box* rhs, int op_type, CompareRewriteArgs* rewrit
// This is the equivalent of PyObject_GetAttr. Unlike getattrInternalGeneric, it checks for custom __getattr__ or
// __getattribute__ methods.
template
<
ExceptionStyle
::
ExceptionStyle
S
>
Box
*
getattrInternal
(
Box
*
obj
,
BoxedString
*
attr
,
GetattrRewriteArgs
*
rewrite_args
);
Box
*
getattrInternal
(
Box
*
obj
,
BoxedString
*
attr
,
GetattrRewriteArgs
*
rewrite_args
)
noexcept
(
S
==
ExceptionStyle
::
CAPI
)
;
// This is the equivalent of PyObject_GenericGetAttr, which performs the default lookup rules for getattr() (check for
// data descriptor, check for instance attribute, check for non-data descriptor). It does not check for __getattr__ or
...
...
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