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
5de266c3
Commit
5de266c3
authored
Aug 24, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #854 from undingen/spec
Fix and reenable type speculations
parents
0fc53b70
401ff2ff
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
10 deletions
+16
-10
src/analysis/type_analysis.cpp
src/analysis/type_analysis.cpp
+0
-3
src/codegen/ast_interpreter.cpp
src/codegen/ast_interpreter.cpp
+9
-3
src/codegen/codegen.h
src/codegen/codegen.h
+1
-1
src/codegen/irgen/irgenerator.cpp
src/codegen/irgen/irgenerator.cpp
+1
-1
src/codegen/runtime_hooks.cpp
src/codegen/runtime_hooks.cpp
+4
-0
test/tests/deopt_generator_tests.py
test/tests/deopt_generator_tests.py
+1
-2
No files found.
src/analysis/type_analysis.cpp
View file @
5de266c3
...
...
@@ -113,9 +113,6 @@ private:
assert
(
old_type
);
assert
(
speculation
!=
TypeAnalysis
::
NONE
);
// TODO: reenable this
return
old_type
;
if
(
speculated_cls
!=
NULL
&&
speculated_cls
->
is_constant
)
{
ConcreteCompilerType
*
speculated_type
=
unboxedType
(
typeFromClass
(
speculated_cls
));
if
(
VERBOSITY
()
>=
2
)
{
...
...
src/codegen/ast_interpreter.cpp
View file @
5de266c3
...
...
@@ -1819,9 +1819,10 @@ Box* astInterpretFunctionEval(CLFunction* clfunc, Box* globals, Box* boxedLocals
return
v
?
v
:
None
;
}
Box
*
astInterpretDeopt
(
CLFunction
*
clfunc
,
AST_expr
*
after_expr
,
AST_stmt
*
enclosing_stmt
,
Box
*
expr_val
,
static
Box
*
astInterpretDeoptInner
(
CLFunction
*
clfunc
,
AST_expr
*
after_expr
,
AST_stmt
*
enclosing_stmt
,
Box
*
expr_val
,
FrameStackState
frame_state
)
__attribute__
((
noinline
));
static
Box
*
astInterpretDeoptInner
(
CLFunction
*
clfunc
,
AST_expr
*
after_expr
,
AST_stmt
*
enclosing_stmt
,
Box
*
expr_val
,
FrameStackState
frame_state
)
{
RELEASE_ASSERT
(
0
,
"didn't check if this still works"
);
assert
(
clfunc
);
assert
(
enclosing_stmt
);
assert
(
frame_state
.
locals
);
...
...
@@ -1911,6 +1912,11 @@ Box* astInterpretDeopt(CLFunction* clfunc, AST_expr* after_expr, AST_stmt* enclo
return
v
?
v
:
None
;
}
Box
*
astInterpretDeopt
(
CLFunction
*
clfunc
,
AST_expr
*
after_expr
,
AST_stmt
*
enclosing_stmt
,
Box
*
expr_val
,
FrameStackState
frame_state
)
{
return
astInterpretDeoptInner
(
clfunc
,
after_expr
,
enclosing_stmt
,
expr_val
,
frame_state
);
}
extern
"C"
void
printExprHelper
(
Box
*
obj
)
{
Box
*
displayhook
=
PySys_GetObject
(
"displayhook"
);
if
(
!
displayhook
)
...
...
src/codegen/codegen.h
View file @
5de266c3
...
...
@@ -69,7 +69,7 @@ struct GlobalState {
llvm
::
Type
*
llvm_value_type
,
*
llvm_value_type_ptr
,
*
llvm_value_type_ptr_ptr
;
llvm
::
Type
*
llvm_class_type
,
*
llvm_class_type_ptr
;
llvm
::
Type
*
llvm_opaque_type
;
llvm
::
Type
*
llvm_boxedstring_type_ptr
,
*
llvm_dict_type_ptr
,
*
llvm_aststmt_type_ptr
;
llvm
::
Type
*
llvm_boxedstring_type_ptr
,
*
llvm_dict_type_ptr
,
*
llvm_aststmt_type_ptr
,
*
llvm_astexpr_type_ptr
;
llvm
::
Type
*
llvm_frame_info_type
;
llvm
::
Type
*
llvm_clfunction_type_ptr
,
*
llvm_closure_type_ptr
,
*
llvm_generator_type_ptr
;
llvm
::
Type
*
llvm_module_type_ptr
,
*
llvm_bool_type_ptr
;
...
...
src/codegen/irgen/irgenerator.cpp
View file @
5de266c3
...
...
@@ -604,7 +604,7 @@ private:
curblock
=
deopt_bb
;
emitter
.
getBuilder
()
->
SetInsertPoint
(
curblock
);
llvm
::
Value
*
v
=
emitter
.
createCall2
(
UnwindInfo
(
current_statement
,
NULL
),
g
.
funcs
.
deopt
,
embedRelocatablePtr
(
node
,
g
.
llvm_ast
stmt
_type_ptr
),
node_value
);
embedRelocatablePtr
(
node
,
g
.
llvm_ast
expr
_type_ptr
),
node_value
);
emitter
.
getBuilder
()
->
CreateRet
(
v
);
curblock
=
success_bb
;
...
...
src/codegen/runtime_hooks.cpp
View file @
5de266c3
...
...
@@ -148,6 +148,10 @@ void initGlobalFuncs(GlobalState& g) {
assert
(
g
.
llvm_aststmt_type_ptr
);
g
.
llvm_aststmt_type_ptr
=
g
.
llvm_aststmt_type_ptr
->
getPointerTo
();
g
.
llvm_astexpr_type_ptr
=
g
.
stdlib_module
->
getTypeByName
(
"class.pyston::AST_expr"
);
assert
(
g
.
llvm_astexpr_type_ptr
);
g
.
llvm_astexpr_type_ptr
=
g
.
llvm_astexpr_type_ptr
->
getPointerTo
();
// The LLVM vector type for the arguments that we pass to runtimeCall and related functions.
// It will be a pointer to a type named something like class.std::vector or
// class.std::vector.##. We can figure out exactly what it is by looking at the last
...
...
test/tests/deopt_generator_tests.py
View file @
5de266c3
# skip-if: '-O' in EXTRA_JIT_ARGS
# expected: statfail
# skip-if: '-O' in EXTRA_JIT_ARGS or '-n' in EXTRA_JIT_ARGS
# statcheck: 4 <= noninit_count('num_deopt') < 50
# statcheck: 1 <= stats["num_osr_exits"] <= 2
...
...
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