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
9c7e9307
Commit
9c7e9307
authored
Dec 17, 2015
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
llvm jit: Always store current statement inside the frame info
parent
bcd4fbc3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
29 deletions
+8
-29
src/codegen/irgen/irgenerator.cpp
src/codegen/irgen/irgenerator.cpp
+7
-22
src/codegen/irgen/irgenerator.h
src/codegen/irgen/irgenerator.h
+1
-2
src/codegen/unwinding.cpp
src/codegen/unwinding.cpp
+0
-5
No files found.
src/codegen/irgen/irgenerator.cpp
View file @
9c7e9307
...
...
@@ -341,6 +341,10 @@ private:
llvm
::
CallSite
emitCall
(
const
UnwindInfo
&
unw_info
,
llvm
::
Value
*
callee
,
const
std
::
vector
<
llvm
::
Value
*>&
args
,
ExceptionStyle
target_exception_style
)
{
llvm
::
Value
*
stmt
=
unw_info
.
current_stmt
?
embedRelocatablePtr
(
unw_info
.
current_stmt
,
g
.
llvm_aststmt_type_ptr
)
:
getNullPtr
(
g
.
llvm_aststmt_type_ptr
);
getBuilder
()
->
CreateStore
(
stmt
,
irstate
->
getStmtVar
());
if
(
target_exception_style
==
CXX
&&
(
unw_info
.
hasHandler
()
||
irstate
->
getExceptionStyle
()
==
CAPI
))
{
// Create the invoke:
llvm
::
BasicBlock
*
normal_dest
...
...
@@ -414,7 +418,7 @@ private:
pp_args
.
insert
(
pp_args
.
end
(),
ic_stackmap_args
.
begin
(),
ic_stackmap_args
.
end
());
irgenerator
->
addFrameStackmapArgs
(
info
,
unw_info
.
current_stmt
,
pp_args
);
irgenerator
->
addFrameStackmapArgs
(
info
,
pp_args
);
llvm
::
Intrinsic
::
ID
intrinsic_id
;
if
(
return_type
->
isIntegerTy
()
||
return_type
->
isPointerTy
())
{
...
...
@@ -428,7 +432,6 @@ private:
abort
();
}
llvm
::
Function
*
patchpoint
=
this
->
getIntrinsic
(
intrinsic_id
);
llvm
::
CallSite
rtn
=
this
->
emitCall
(
unw_info
,
patchpoint
,
pp_args
,
target_exception_style
);
return
rtn
;
}
...
...
@@ -487,10 +490,6 @@ public:
}
}
#endif
llvm
::
Value
*
stmt
=
unw_info
.
current_stmt
?
embedRelocatablePtr
(
unw_info
.
current_stmt
,
g
.
llvm_aststmt_type_ptr
)
:
getNullPtr
(
g
.
llvm_aststmt_type_ptr
);
getBuilder
()
->
CreateStore
(
stmt
,
irstate
->
getStmtVar
());
return
emitCall
(
unw_info
,
callee
,
args
,
target_exception_style
).
getInstruction
();
}
...
...
@@ -2587,24 +2586,9 @@ private:
}
public:
void
addFrameStackmapArgs
(
PatchpointInfo
*
pp
,
AST_stmt
*
current_stmt
,
std
::
vector
<
llvm
::
Value
*>&
stackmap_args
)
override
{
void
addFrameStackmapArgs
(
PatchpointInfo
*
pp
,
std
::
vector
<
llvm
::
Value
*>&
stackmap_args
)
override
{
int
initial_args
=
stackmap_args
.
size
();
assert
(
UNBOXED_INT
->
llvmType
()
==
g
.
i64
);
if
(
ENABLE_JIT_OBJECT_CACHE
)
{
llvm
::
Value
*
v
;
if
(
current_stmt
)
v
=
emitter
.
getBuilder
()
->
CreatePtrToInt
(
embedRelocatablePtr
(
current_stmt
,
g
.
i8_ptr
),
g
.
i64
);
else
v
=
getConstantInt
(
0
,
g
.
i64
);
stackmap_args
.
push_back
(
v
);
}
else
{
stackmap_args
.
push_back
(
getConstantInt
((
uint64_t
)
current_stmt
,
g
.
i64
));
}
pp
->
addFrameVar
(
"!current_stmt"
,
UNBOXED_INT
);
// For deopts we need to add the compiler created names to the stackmap
if
(
ENABLE_FRAME_INTROSPECTION
&&
pp
->
isDeopt
())
{
// TODO: don't need to use a sorted symbol table if we're explicitly recording the names!
...
...
@@ -2904,6 +2888,7 @@ public:
emitter
.
setCurrentBasicBlock
(
capi_exc_dest
);
assert
(
!
phi_node
);
phi_node
=
emitter
.
getBuilder
()
->
CreatePHI
(
g
.
llvm_aststmt_type_ptr
,
0
);
emitter
.
getBuilder
()
->
CreateCall2
(
g
.
funcs
.
caughtCapiException
,
phi_node
,
embedRelocatablePtr
(
irstate
->
getSourceInfo
(),
g
.
i8_ptr
));
...
...
src/codegen/irgen/irgenerator.h
View file @
9c7e9307
...
...
@@ -158,8 +158,7 @@ public:
virtual
void
run
(
const
CFGBlock
*
block
)
=
0
;
// primary entry point
virtual
EndingState
getEndingSymbolTable
()
=
0
;
virtual
void
doSafePoint
(
AST_stmt
*
next_statement
)
=
0
;
virtual
void
addFrameStackmapArgs
(
PatchpointInfo
*
pp
,
AST_stmt
*
current_stmt
,
std
::
vector
<
llvm
::
Value
*>&
stackmap_args
)
=
0
;
virtual
void
addFrameStackmapArgs
(
PatchpointInfo
*
pp
,
std
::
vector
<
llvm
::
Value
*>&
stackmap_args
)
=
0
;
virtual
void
addOutgoingExceptionState
(
ExceptionState
exception_state
)
=
0
;
virtual
void
setIncomingExceptionState
(
llvm
::
SmallVector
<
ExceptionState
,
2
>
exc_state
)
=
0
;
virtual
llvm
::
BasicBlock
*
getCXXExcDest
(
llvm
::
BasicBlock
*
final_dest
)
=
0
;
...
...
src/codegen/unwinding.cpp
View file @
9c7e9307
...
...
@@ -353,11 +353,6 @@ public:
}
AST_stmt
*
getCurrentStatement
()
{
if
(
id
.
type
==
PythonFrameId
::
COMPILED
)
{
auto
locations
=
findLocations
(
"!current_stmt"
);
if
(
locations
.
size
()
==
1
)
return
reinterpret_cast
<
AST_stmt
*>
(
readLocation
(
locations
[
0
]));
}
assert
(
getFrameInfo
()
->
stmt
);
return
getFrameInfo
()
->
stmt
;
}
...
...
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