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
c0770b8a
Commit
c0770b8a
authored
Mar 22, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '
f60d5770
' into refcounting
parents
e5bb961d
f60d5770
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
12 deletions
+34
-12
src/codegen/ast_interpreter.cpp
src/codegen/ast_interpreter.cpp
+5
-9
src/codegen/ast_interpreter.h
src/codegen/ast_interpreter.h
+3
-2
src/codegen/ast_interpreter_exec.S
src/codegen/ast_interpreter_exec.S
+26
-1
No files found.
src/codegen/ast_interpreter.cpp
View file @
c0770b8a
...
...
@@ -1965,10 +1965,11 @@ Box* astInterpretFunctionEval(FunctionMetadata* md, Box* globals, Box* boxedLoca
return
v
?
v
:
None
;
}
static
Box
*
astInterpretDeoptInner
(
FunctionMetadata
*
md
,
AST_expr
*
after_expr
,
AST_stmt
*
enclosing_stmt
,
Box
*
expr_val
,
FrameStackState
frame_state
)
__attribute__
((
noinline
));
static
Box
*
astInterpretDeoptInner
(
FunctionMetadata
*
md
,
AST_expr
*
after_expr
,
AST_stmt
*
enclosing_stmt
,
Box
*
expr_val
,
FrameStackState
frame_state
)
{
// caution when changing the function arguments: this function gets called from an assembler wrapper!
extern
"C"
Box
*
astInterpretDeoptFromASM
(
FunctionMetadata
*
md
,
AST_expr
*
after_expr
,
AST_stmt
*
enclosing_stmt
,
Box
*
expr_val
,
FrameStackState
frame_state
)
{
static_assert
(
sizeof
(
FrameStackState
)
<=
2
*
8
,
"astInterpretDeopt assumes that all args get passed in regs!"
);
assert
(
md
);
assert
(
enclosing_stmt
);
assert
(
frame_state
.
locals
);
...
...
@@ -2066,11 +2067,6 @@ static Box* astInterpretDeoptInner(FunctionMetadata* md, AST_expr* after_expr, A
return
v
?
v
:
None
;
}
Box
*
astInterpretDeopt
(
FunctionMetadata
*
md
,
AST_expr
*
after_expr
,
AST_stmt
*
enclosing_stmt
,
Box
*
expr_val
,
FrameStackState
frame_state
)
{
return
astInterpretDeoptInner
(
md
,
after_expr
,
enclosing_stmt
,
expr_val
,
frame_state
);
}
extern
"C"
void
printExprHelper
(
Box
*
obj
)
{
Box
*
displayhook
=
PySys_GetObject
(
"displayhook"
);
if
(
!
displayhook
)
...
...
src/codegen/ast_interpreter.h
View file @
c0770b8a
...
...
@@ -77,8 +77,9 @@ struct Value {
Box
*
astInterpretFunction
(
FunctionMetadata
*
f
,
Box
*
closure
,
Box
*
generator
,
Box
*
globals
,
Box
*
arg1
,
Box
*
arg2
,
Box
*
arg3
,
Box
**
args
);
Box
*
astInterpretFunctionEval
(
FunctionMetadata
*
cf
,
Box
*
globals
,
Box
*
boxedLocals
);
Box
*
astInterpretDeopt
(
FunctionMetadata
*
cf
,
AST_expr
*
after_expr
,
AST_stmt
*
enclosing_stmt
,
Box
*
expr_val
,
FrameStackState
frame_state
);
// this function is implemented in the src/codegen/ast_interpreter_exec.S assembler file
extern
"C"
Box
*
astInterpretDeopt
(
FunctionMetadata
*
cf
,
AST_expr
*
after_expr
,
AST_stmt
*
enclosing_stmt
,
Box
*
expr_val
,
FrameStackState
frame_state
);
struct
FrameInfo
;
FrameInfo
*
getFrameInfoForInterpretedFrame
(
void
*
frame_ptr
);
...
...
src/codegen/ast_interpreter_exec.S
View file @
c0770b8a
...
...
@@ -32,11 +32,36 @@ executeInnerAndSetupFrame:
sub
$
16
,
%
rsp
mov
%
rdi
,
-
8
(%
rbp
)
call
executeInnerFromASM
leave
add
$
16
,
%
rsp
pop
%
rbp
.
cfi_def_cfa
rsp
,
8
ret
.
cfi_endproc
.
size
executeInnerAndSetupFrame
,.-
executeInnerAndSetupFrame
//
This
function
is
just
a
small
wrapper
around
astInterpretDeoptFromASM
.
//
Our
unwinder
must
be
able
to
detect
deopt
frames
and
by
writting
this
wrapper
in
assembler
we
can
be
sure
to
correctly
//
detect
the
frame
independent
of
compiler
optimizations
because
this
function
will
always
appear
in
the
call
stack
.
//
//
Box
*
astInterpretDeopt
(
FunctionMetadata
*
cf
,
AST_expr
*
after_expr
,
AST_stmt
*
enclosing_stmt
,
Box
*
expr_val
,
//
FrameStackState
frame_state
)
;
.
text
.
globl
astInterpretDeopt
.
type
astInterpretDeopt
,@
function
.
align
16
astInterpretDeopt
:
.
cfi_startproc
push
%
rbp
.
cfi_def_cfa_offset
16
.
cfi_offset
rbp
,-
16
mov
%
rsp
,
%
rbp
.
cfi_def_cfa_register
rbp
call
astInterpretDeoptFromASM
pop
%
rbp
.
cfi_def_cfa
rsp
,
8
ret
.
cfi_endproc
.
size
astInterpretDeopt
,.-
astInterpretDeopt
.
section
.
note.GNU
-
stack
,"",%
progbits
//
we
don
't need executable stack
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