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
c0a273ff
Commit
c0a273ff
authored
Sep 28, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BST: remove the cxx_exception_count field
parent
482d2e86
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
11 deletions
+12
-11
src/codegen/ast_interpreter.cpp
src/codegen/ast_interpreter.cpp
+2
-2
src/codegen/irgen.h
src/codegen/irgen.h
+4
-3
src/codegen/irgen/irgenerator.cpp
src/codegen/irgen/irgenerator.cpp
+4
-4
src/codegen/unwinding.cpp
src/codegen/unwinding.cpp
+1
-1
src/core/bst.h
src/core/bst.h
+0
-1
src/runtime/types.h
src/runtime/types.h
+1
-0
No files found.
src/codegen/ast_interpreter.cpp
View file @
c0a273ff
...
...
@@ -366,7 +366,7 @@ Box* ASTInterpreter::execJITedBlock(CFGBlock* b) {
assert
(
getPythonFrameInfo
(
0
)
==
getFrameInfo
());
stmt
->
cxx_exception_count
++
;
++
getCode
()
->
cxx_exception_count
[
stmt
]
;
caughtCxxException
(
&
e
);
next_block
=
((
BST_Invoke
*
)
stmt
)
->
exc_dest
;
...
...
@@ -774,7 +774,7 @@ Value ASTInterpreter::visit_invoke(BST_Invoke* node) {
assert
(
getPythonFrameInfo
(
0
)
==
getFrameInfo
());
node
->
cxx_exception_count
++
;
++
getCode
()
->
cxx_exception_count
[
node
]
;
caughtCxxException
(
&
e
);
next_block
=
node
->
exc_dest
;
...
...
src/codegen/irgen.h
View file @
c0a273ff
...
...
@@ -36,6 +36,7 @@ class IREmitter;
struct
UnwindInfo
{
public:
BoxedCode
*
code
;
BST_stmt
*
current_stmt
;
llvm
::
BasicBlock
*
exc_dest
;
...
...
@@ -45,15 +46,15 @@ public:
bool
hasHandler
()
const
{
return
exc_dest
!=
NULL
;
}
UnwindInfo
(
BST_stmt
*
current_stmt
,
llvm
::
BasicBlock
*
exc_dest
,
bool
is_after_deopt
=
false
)
:
current_stmt
(
current_stmt
),
exc_dest
(
exc_dest
),
is_after_deopt
(
is_after_deopt
)
{}
UnwindInfo
(
B
oxedCode
*
code
,
B
ST_stmt
*
current_stmt
,
llvm
::
BasicBlock
*
exc_dest
,
bool
is_after_deopt
=
false
)
:
c
ode
(
code
),
c
urrent_stmt
(
current_stmt
),
exc_dest
(
exc_dest
),
is_after_deopt
(
is_after_deopt
)
{}
ExceptionStyle
preferredExceptionStyle
()
const
;
// Risky! This means that we can't unwind from this location, and should be used in the
// rare case that there are language-specific reasons that the statement should not unwind
// (ex: loading function arguments into the appropriate scopes).
static
UnwindInfo
cantUnwind
()
{
return
UnwindInfo
(
NULL
,
NULL
);
}
static
UnwindInfo
cantUnwind
()
{
return
UnwindInfo
(
NULL
,
NULL
,
NULL
);
}
};
// TODO get rid of this
...
...
src/codegen/irgen/irgenerator.cpp
View file @
c0a273ff
...
...
@@ -145,7 +145,7 @@ ExceptionStyle UnwindInfo::preferredExceptionStyle() const {
// tend to run this check after executing the statement a somewhat-fixed
// number of times.
// We might want to zero these out after we are done compiling, though.
if
(
c
urrent_stmt
->
cxx_exception_count
>=
10
)
if
(
c
ode
&&
code
->
cxx_exception_count
[
current_stmt
]
>=
10
)
return
CAPI
;
return
CXX
;
...
...
@@ -715,7 +715,7 @@ public:
llvm
::
Value
*
createDeopt
(
BST_stmt
*
current_stmt
,
llvm
::
Value
*
node_value
)
override
{
llvm
::
Instruction
*
v
=
createIC
(
createDeoptIC
(),
(
void
*
)
pyston
::
deopt
,
{
node_value
},
UnwindInfo
(
current_stmt
,
NULL
,
/* is_after_deopt*/
true
));
UnwindInfo
(
irstate
->
getCode
(),
current_stmt
,
NULL
,
/* is_after_deopt*/
true
));
llvm
::
Value
*
rtn
=
createAfter
<
llvm
::
IntToPtrInst
>
(
v
,
v
,
g
.
llvm_value_type_ptr
,
""
);
setType
(
rtn
,
RefType
::
OWNED
);
return
rtn
;
...
...
@@ -2448,7 +2448,7 @@ private:
assert
(
!
unw_info
.
hasHandler
());
BST_Invoke
*
invoke
=
bst_cast
<
BST_Invoke
>
(
node
);
doStmt
(
invoke
->
stmt
,
UnwindInfo
(
node
,
entry_blocks
[
invoke
->
exc_dest
]));
doStmt
(
invoke
->
stmt
,
UnwindInfo
(
irstate
->
getCode
(),
node
,
entry_blocks
[
invoke
->
exc_dest
]));
assert
(
state
==
RUNNING
||
state
==
DEAD
);
if
(
state
==
RUNNING
)
{
...
...
@@ -2951,7 +2951,7 @@ public:
doSafePoint
(
block
->
body
[
i
]);
#endif
doStmt
(
block
->
body
[
i
],
UnwindInfo
(
block
->
body
[
i
],
NULL
));
doStmt
(
block
->
body
[
i
],
UnwindInfo
(
irstate
->
getCode
(),
block
->
body
[
i
],
NULL
));
}
if
(
VERBOSITY
(
"irgenerator"
)
>=
2
)
{
// print ending symbol table
printf
(
" %d fini:"
,
block
->
idx
);
...
...
src/codegen/unwinding.cpp
View file @
c0a273ff
...
...
@@ -636,7 +636,7 @@ public:
if
(
!
getIsReraiseFlag
())
{
// TODO: shouldn't fetch this multiple times?
frame_iter
.
getCurrentStatement
()
->
cxx_exception_count
++
;
++
frame_iter
.
getFrameInfo
()
->
code
->
cxx_exception_count
[
frame_iter
.
getCurrentStatement
()]
;
exceptionAtLine
(
&
exc_info
.
traceback
);
}
else
getIsReraiseFlag
()
=
false
;
...
...
src/core/bst.h
View file @
c0a273ff
...
...
@@ -134,7 +134,6 @@ public:
const
BST_TYPE
::
BST_TYPE
type
;
uint32_t
lineno
;
int
cxx_exception_count
=
0
;
virtual
void
accept
(
BSTVisitor
*
v
)
=
0
;
virtual
void
accept_stmt
(
StmtVisitor
*
v
)
=
0
;
...
...
src/runtime/types.h
View file @
c0a273ff
...
...
@@ -1120,6 +1120,7 @@ public:
long
bjit_num_inside
=
0
;
std
::
vector
<
std
::
unique_ptr
<
JitCodeBlock
>>
code_blocks
;
ICInvalidator
dependent_interp_callsites
;
llvm
::
DenseMap
<
BST_stmt
*
,
int
>
cxx_exception_count
;
// Functions can provide an "internal" version, which will get called instead
...
...
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