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
91ac4569
Commit
91ac4569
authored
Aug 08, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename these functions
parent
4b7c277f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
17 deletions
+15
-17
src/codegen/ast_interpreter.cpp
src/codegen/ast_interpreter.cpp
+2
-2
src/codegen/irgen/hooks.h
src/codegen/irgen/hooks.h
+0
-4
src/codegen/irgen/irgenerator.cpp
src/codegen/irgen/irgenerator.cpp
+2
-2
src/codegen/runtime_hooks.cpp
src/codegen/runtime_hooks.cpp
+2
-2
src/codegen/runtime_hooks.h
src/codegen/runtime_hooks.h
+1
-1
src/codegen/unwinding.h
src/codegen/unwinding.h
+3
-1
src/runtime/exceptions.cpp
src/runtime/exceptions.cpp
+3
-3
src/runtime/inline/link_forcer.cpp
src/runtime/inline/link_forcer.cpp
+2
-2
No files found.
src/codegen/ast_interpreter.cpp
View file @
91ac4569
...
@@ -333,7 +333,7 @@ Box* ASTInterpreter::execJITedBlock(CFGBlock* b) {
...
@@ -333,7 +333,7 @@ Box* ASTInterpreter::execJITedBlock(CFGBlock* b) {
auto
source
=
getCL
()
->
source
.
get
();
auto
source
=
getCL
()
->
source
.
get
();
stmt
->
cxx_exception_count
++
;
stmt
->
cxx_exception_count
++
;
exceptionCaughtInInterpreter
(
LineInfo
(
stmt
->
lineno
,
stmt
->
col_offset
,
source
->
fn
,
source
->
getName
()),
&
e
);
caughtCxxException
(
LineInfo
(
stmt
->
lineno
,
stmt
->
col_offset
,
source
->
fn
,
source
->
getName
()),
&
e
);
next_block
=
((
AST_Invoke
*
)
stmt
)
->
exc_dest
;
next_block
=
((
AST_Invoke
*
)
stmt
)
->
exc_dest
;
last_exception
=
e
;
last_exception
=
e
;
...
@@ -773,7 +773,7 @@ Value ASTInterpreter::visit_invoke(AST_Invoke* node) {
...
@@ -773,7 +773,7 @@ Value ASTInterpreter::visit_invoke(AST_Invoke* node) {
auto
source
=
getCL
()
->
source
.
get
();
auto
source
=
getCL
()
->
source
.
get
();
node
->
cxx_exception_count
++
;
node
->
cxx_exception_count
++
;
exceptionCaughtInInterpreter
(
LineInfo
(
node
->
lineno
,
node
->
col_offset
,
source
->
fn
,
source
->
getName
()),
&
e
);
caughtCxxException
(
LineInfo
(
node
->
lineno
,
node
->
col_offset
,
source
->
fn
,
source
->
getName
()),
&
e
);
next_block
=
node
->
exc_dest
;
next_block
=
node
->
exc_dest
;
last_exception
=
e
;
last_exception
=
e
;
...
...
src/codegen/irgen/hooks.h
View file @
91ac4569
...
@@ -39,10 +39,6 @@ void compileAndRunModule(AST_Module* m, BoxedModule* bm);
...
@@ -39,10 +39,6 @@ void compileAndRunModule(AST_Module* m, BoxedModule* bm);
// will we always want to generate unique function names? (ie will this function always be reasonable?)
// will we always want to generate unique function names? (ie will this function always be reasonable?)
CompiledFunction
*
cfForMachineFunctionName
(
const
std
::
string
&
);
CompiledFunction
*
cfForMachineFunctionName
(
const
std
::
string
&
);
extern
"C"
void
capiExcCaughtInJit
(
AST_stmt
*
current_stmt
,
void
*
source_info
);
// This is just meant for the use of the JIT (normal runtime code should call throwCAPIException)
extern
"C"
void
reraiseJitCapiExc
()
__attribute__
((
noreturn
));
extern
"C"
Box
*
exec
(
Box
*
boxedCode
,
Box
*
globals
,
Box
*
locals
,
FutureFlags
caller_future_flags
);
extern
"C"
Box
*
exec
(
Box
*
boxedCode
,
Box
*
globals
,
Box
*
locals
,
FutureFlags
caller_future_flags
);
extern
"C"
Box
*
eval
(
Box
*
boxedCode
,
Box
*
globals
,
Box
*
locals
);
extern
"C"
Box
*
eval
(
Box
*
boxedCode
,
Box
*
globals
,
Box
*
locals
);
extern
"C"
Box
*
compile
(
Box
*
source
,
Box
*
filename
,
Box
*
mode
,
Box
**
_args
/* flags, dont_inherit */
);
extern
"C"
Box
*
compile
(
Box
*
source
,
Box
*
filename
,
Box
*
mode
,
Box
**
_args
/* flags, dont_inherit */
);
...
...
src/codegen/irgen/irgenerator.cpp
View file @
91ac4569
...
@@ -2805,14 +2805,14 @@ public:
...
@@ -2805,14 +2805,14 @@ public:
capi_current_statements
[
final_dest
]
=
current_stmt
;
capi_current_statements
[
final_dest
]
=
current_stmt
;
emitter
.
setCurrentBasicBlock
(
capi_exc_dest
);
emitter
.
setCurrentBasicBlock
(
capi_exc_dest
);
emitter
.
getBuilder
()
->
CreateCall2
(
g
.
funcs
.
ca
piExcCaughtInJit
,
emitter
.
getBuilder
()
->
CreateCall2
(
g
.
funcs
.
ca
ughtCapiException
,
embedRelocatablePtr
(
current_stmt
,
g
.
llvm_aststmt_type_ptr
),
embedRelocatablePtr
(
current_stmt
,
g
.
llvm_aststmt_type_ptr
),
embedRelocatablePtr
(
irstate
->
getSourceInfo
(),
g
.
i8_ptr
));
embedRelocatablePtr
(
irstate
->
getSourceInfo
(),
g
.
i8_ptr
));
if
(
!
final_dest
)
{
if
(
!
final_dest
)
{
// Propagate the exception out of the function:
// Propagate the exception out of the function:
if
(
irstate
->
getExceptionStyle
()
==
CXX
)
{
if
(
irstate
->
getExceptionStyle
()
==
CXX
)
{
emitter
.
getBuilder
()
->
CreateCall
(
g
.
funcs
.
reraise
JitCapiExc
);
emitter
.
getBuilder
()
->
CreateCall
(
g
.
funcs
.
reraise
CapiExcAsCxx
);
emitter
.
getBuilder
()
->
CreateUnreachable
();
emitter
.
getBuilder
()
->
CreateUnreachable
();
}
else
{
}
else
{
emitter
.
getBuilder
()
->
CreateRet
(
getNullPtr
(
g
.
llvm_value_type_ptr
));
emitter
.
getBuilder
()
->
CreateRet
(
getNullPtr
(
g
.
llvm_value_type_ptr
));
...
...
src/codegen/runtime_hooks.cpp
View file @
91ac4569
...
@@ -312,8 +312,8 @@ void initGlobalFuncs(GlobalState& g) {
...
@@ -312,8 +312,8 @@ void initGlobalFuncs(GlobalState& g) {
GET
(
PyErr_Fetch
);
GET
(
PyErr_Fetch
);
GET
(
PyErr_NormalizeException
);
GET
(
PyErr_NormalizeException
);
GET
(
PyErr_Restore
);
GET
(
PyErr_Restore
);
GET
(
ca
piExcCaughtInJit
);
GET
(
ca
ughtCapiException
);
GET
(
reraise
JitCapiExc
);
GET
(
reraise
CapiExcAsCxx
);
GET
(
deopt
);
GET
(
deopt
);
GET
(
div_float_float
);
GET
(
div_float_float
);
...
...
src/codegen/runtime_hooks.h
View file @
91ac4569
...
@@ -51,7 +51,7 @@ struct GlobalFuncs {
...
@@ -51,7 +51,7 @@ struct GlobalFuncs {
llvm
::
Value
*
__cxa_end_catch
;
llvm
::
Value
*
__cxa_end_catch
;
llvm
::
Value
*
raise0
,
*
raise3
,
*
raise3_capi
;
llvm
::
Value
*
raise0
,
*
raise3
,
*
raise3_capi
;
llvm
::
Value
*
PyErr_Fetch
,
*
PyErr_NormalizeException
,
*
PyErr_Restore
,
*
ca
piExcCaughtInJit
,
*
reraiseJitCapiExc
;
llvm
::
Value
*
PyErr_Fetch
,
*
PyErr_NormalizeException
,
*
PyErr_Restore
,
*
ca
ughtCapiException
,
*
reraiseCapiExcAsCxx
;
llvm
::
Value
*
deopt
;
llvm
::
Value
*
deopt
;
llvm
::
Value
*
div_float_float
,
*
floordiv_float_float
,
*
mod_float_float
,
*
pow_float_float
;
llvm
::
Value
*
div_float_float
,
*
floordiv_float_float
,
*
mod_float_float
,
*
pow_float_float
;
...
...
src/codegen/unwinding.h
View file @
91ac4569
...
@@ -53,7 +53,9 @@ void logException(ExcInfo* exc_info);
...
@@ -53,7 +53,9 @@ void logException(ExcInfo* exc_info);
void
startReraise
();
void
startReraise
();
bool
exceptionAtLineCheck
();
bool
exceptionAtLineCheck
();
void
exceptionAtLine
(
LineInfo
line_info
,
Box
**
traceback
);
void
exceptionAtLine
(
LineInfo
line_info
,
Box
**
traceback
);
void
exceptionCaughtInInterpreter
(
LineInfo
line_info
,
ExcInfo
*
exc_info
);
void
caughtCxxException
(
LineInfo
line_info
,
ExcInfo
*
exc_info
);
extern
"C"
void
caughtCapiException
(
AST_stmt
*
current_stmt
,
void
*
source_info
);
extern
"C"
void
reraiseCapiExcAsCxx
()
__attribute__
((
noreturn
));
CLFunction
*
getTopPythonFunction
();
CLFunction
*
getTopPythonFunction
();
...
...
src/runtime/exceptions.cpp
View file @
91ac4569
...
@@ -220,14 +220,14 @@ void logException(ExcInfo* exc_info) {
...
@@ -220,14 +220,14 @@ void logException(ExcInfo* exc_info) {
#endif
#endif
}
}
extern
"C"
void
ca
piExcCaughtInJit
(
AST_stmt
*
stmt
,
void
*
_source_info
)
{
extern
"C"
void
ca
ughtCapiException
(
AST_stmt
*
stmt
,
void
*
_source_info
)
{
SourceInfo
*
source
=
static_cast
<
SourceInfo
*>
(
_source_info
);
SourceInfo
*
source
=
static_cast
<
SourceInfo
*>
(
_source_info
);
PyThreadState
*
tstate
=
PyThreadState_GET
();
PyThreadState
*
tstate
=
PyThreadState_GET
();
exceptionAtLine
(
LineInfo
(
stmt
->
lineno
,
stmt
->
col_offset
,
source
->
fn
,
source
->
getName
()),
&
tstate
->
curexc_traceback
);
exceptionAtLine
(
LineInfo
(
stmt
->
lineno
,
stmt
->
col_offset
,
source
->
fn
,
source
->
getName
()),
&
tstate
->
curexc_traceback
);
}
}
extern
"C"
void
reraise
JitCapiExc
()
{
extern
"C"
void
reraise
CapiExcAsCxx
()
{
ensureCAPIExceptionSet
();
ensureCAPIExceptionSet
();
// TODO: we are normalizing to many times?
// TODO: we are normalizing to many times?
ExcInfo
e
=
excInfoForRaise
(
cur_thread_state
.
curexc_type
,
cur_thread_state
.
curexc_value
,
ExcInfo
e
=
excInfoForRaise
(
cur_thread_state
.
curexc_type
,
cur_thread_state
.
curexc_value
,
...
@@ -237,7 +237,7 @@ extern "C" void reraiseJitCapiExc() {
...
@@ -237,7 +237,7 @@ extern "C" void reraiseJitCapiExc() {
throw
e
;
throw
e
;
}
}
void
exceptionCaughtInInterpreter
(
LineInfo
line_info
,
ExcInfo
*
exc_info
)
{
void
caughtCxxException
(
LineInfo
line_info
,
ExcInfo
*
exc_info
)
{
static
StatCounter
frames_unwound
(
"num_frames_unwound_python"
);
static
StatCounter
frames_unwound
(
"num_frames_unwound_python"
);
frames_unwound
.
log
();
frames_unwound
.
log
();
...
...
src/runtime/inline/link_forcer.cpp
View file @
91ac4569
...
@@ -130,8 +130,8 @@ void force() {
...
@@ -130,8 +130,8 @@ void force() {
FORCE
(
PyErr_Fetch
);
FORCE
(
PyErr_Fetch
);
FORCE
(
PyErr_NormalizeException
);
FORCE
(
PyErr_NormalizeException
);
FORCE
(
PyErr_Restore
);
FORCE
(
PyErr_Restore
);
FORCE
(
ca
piExcCaughtInJit
);
FORCE
(
ca
ughtCapiException
);
FORCE
(
reraise
JitCapiExc
);
FORCE
(
reraise
CapiExcAsCxx
);
FORCE
(
deopt
);
FORCE
(
deopt
);
FORCE
(
div_i64_i64
);
FORCE
(
div_i64_i64
);
...
...
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