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
c011fb3a
Commit
c011fb3a
authored
Jul 28, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #770 from undingen/bjit_problems
bjit: fix problems when setting bjit thresholds to 1
parents
ded39f2a
0bcfeb27
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
14 deletions
+32
-14
src/asm_writing/rewriter.cpp
src/asm_writing/rewriter.cpp
+2
-2
src/asm_writing/rewriter.h
src/asm_writing/rewriter.h
+1
-1
src/codegen/baseline_jit.cpp
src/codegen/baseline_jit.cpp
+20
-3
src/runtime/classobj.cpp
src/runtime/classobj.cpp
+3
-2
src/runtime/dict.cpp
src/runtime/dict.cpp
+2
-2
src/runtime/list.cpp
src/runtime/list.cpp
+2
-2
src/runtime/set.cpp
src/runtime/set.cpp
+2
-2
No files found.
src/asm_writing/rewriter.cpp
View file @
c011fb3a
...
@@ -819,7 +819,7 @@ RewriterVar* Rewriter::call(bool has_side_effects, void* func_addr, const Rewrit
...
@@ -819,7 +819,7 @@ RewriterVar* Rewriter::call(bool has_side_effects, void* func_addr, const Rewrit
return
result
;
return
result
;
}
}
void
Rewriter
::
_setupCall
(
RewriterVar
*
result
,
bool
has_side_effects
,
const
RewriterVar
::
SmallVector
&
args
,
void
Rewriter
::
_setupCall
(
bool
has_side_effects
,
const
RewriterVar
::
SmallVector
&
args
,
const
RewriterVar
::
SmallVector
&
args_xmm
)
{
const
RewriterVar
::
SmallVector
&
args_xmm
)
{
if
(
has_side_effects
)
if
(
has_side_effects
)
assert
(
done_guarding
);
assert
(
done_guarding
);
...
@@ -972,7 +972,7 @@ void Rewriter::_call(RewriterVar* result, bool has_side_effects, void* func_addr
...
@@ -972,7 +972,7 @@ void Rewriter::_call(RewriterVar* result, bool has_side_effects, void* func_addr
// RewriterVarUsage scratch = createNewVar(Location::any());
// RewriterVarUsage scratch = createNewVar(Location::any());
assembler
::
Register
r
=
allocReg
(
assembler
::
R11
);
assembler
::
Register
r
=
allocReg
(
assembler
::
R11
);
_setupCall
(
result
,
has_side_effects
,
args
,
args_xmm
);
_setupCall
(
has_side_effects
,
args
,
args_xmm
);
for
(
RewriterVar
*
arg
:
args
)
{
for
(
RewriterVar
*
arg
:
args
)
{
arg
->
bumpUse
();
arg
->
bumpUse
();
...
...
src/asm_writing/rewriter.h
View file @
c011fb3a
...
@@ -422,7 +422,7 @@ protected:
...
@@ -422,7 +422,7 @@ protected:
void
_trap
();
void
_trap
();
void
_loadConst
(
RewriterVar
*
result
,
int64_t
val
);
void
_loadConst
(
RewriterVar
*
result
,
int64_t
val
);
void
_setupCall
(
RewriterVar
*
result
,
bool
has_side_effects
,
const
RewriterVar
::
SmallVector
&
args
,
void
_setupCall
(
bool
has_side_effects
,
const
RewriterVar
::
SmallVector
&
args
,
const
RewriterVar
::
SmallVector
&
args_xmm
);
const
RewriterVar
::
SmallVector
&
args_xmm
);
void
_call
(
RewriterVar
*
result
,
bool
has_side_effects
,
void
*
func_addr
,
const
RewriterVar
::
SmallVector
&
args
,
void
_call
(
RewriterVar
*
result
,
bool
has_side_effects
,
void
*
func_addr
,
const
RewriterVar
::
SmallVector
&
args
,
const
RewriterVar
::
SmallVector
&
args_xmm
);
const
RewriterVar
::
SmallVector
&
args_xmm
);
...
...
src/codegen/baseline_jit.cpp
View file @
c011fb3a
...
@@ -560,7 +560,21 @@ int JitFragmentWriter::finishCompilation() {
...
@@ -560,7 +560,21 @@ int JitFragmentWriter::finishCompilation() {
}
}
if
(
assembler
->
hasFailed
())
{
if
(
assembler
->
hasFailed
())
{
int
bytes_written
=
assembler
->
bytesWritten
();
// don't retry JITing very large blocks
const
auto
large_block_threshold
=
JitCodeBlock
::
code_size
-
4096
;
if
(
bytes_written
>
large_block_threshold
)
{
static
StatCounter
num_jit_large_blocks
(
"num_baselinejit_skipped_large_blocks"
);
num_jit_large_blocks
.
log
();
blocks_aborted
.
insert
(
block
);
code_block
.
fragmentAbort
(
false
);
}
else
{
// we ran out of space - we allow a retry and set shouldCreateNewBlock to true in order to allocate a new
// block for the next attempt.
code_block
.
fragmentAbort
(
true
/* not_enough_space */
);
code_block
.
fragmentAbort
(
true
/* not_enough_space */
);
}
return
0
;
return
0
;
}
}
...
@@ -803,9 +817,12 @@ void JitFragmentWriter::_emitPPCall(RewriterVar* result, void* func_addr, const
...
@@ -803,9 +817,12 @@ void JitFragmentWriter::_emitPPCall(RewriterVar* result, void* func_addr, const
}
}
RewriterVar
::
SmallVector
reg_args
(
args
.
begin
(),
args
.
begin
()
+
6
);
RewriterVar
::
SmallVector
reg_args
(
args
.
begin
(),
args
.
begin
()
+
6
);
assert
(
reg_args
.
size
()
==
6
);
assert
(
reg_args
.
size
()
==
6
);
_setupCall
(
result
,
false
,
reg_args
,
RewriterVar
::
SmallVector
());
_setupCall
(
false
,
reg_args
,
RewriterVar
::
SmallVector
());
}
else
}
else
_setupCall
(
result
,
false
,
args
,
RewriterVar
::
SmallVector
());
_setupCall
(
false
,
args
,
RewriterVar
::
SmallVector
());
if
(
failed
)
return
;
// make sure setupCall doesn't use R11
// make sure setupCall doesn't use R11
assert
(
vars_by_location
.
count
(
assembler
::
R11
)
==
0
);
assert
(
vars_by_location
.
count
(
assembler
::
R11
)
==
0
);
...
...
src/runtime/classobj.cpp
View file @
c011fb3a
...
@@ -203,7 +203,7 @@ static const char* set_bases(PyClassObject* c, PyObject* v) {
...
@@ -203,7 +203,7 @@ static const char* set_bases(PyClassObject* c, PyObject* v) {
return
""
;
return
""
;
}
}
static
void
classobjSetattr
(
Box
*
_cls
,
Box
*
_attr
,
Box
*
_value
)
{
static
Box
*
classobjSetattr
(
Box
*
_cls
,
Box
*
_attr
,
Box
*
_value
)
{
RELEASE_ASSERT
(
_cls
->
cls
==
classobj_cls
,
""
);
RELEASE_ASSERT
(
_cls
->
cls
==
classobj_cls
,
""
);
BoxedClassobj
*
cls
=
static_cast
<
BoxedClassobj
*>
(
_cls
);
BoxedClassobj
*
cls
=
static_cast
<
BoxedClassobj
*>
(
_cls
);
...
@@ -216,10 +216,11 @@ static void classobjSetattr(Box* _cls, Box* _attr, Box* _value) {
...
@@ -216,10 +216,11 @@ static void classobjSetattr(Box* _cls, Box* _attr, Box* _value) {
raiseExcHelper
(
TypeError
,
"%s"
,
error_str
);
raiseExcHelper
(
TypeError
,
"%s"
,
error_str
);
static
BoxedString
*
bases_str
=
internStringImmortal
(
"__bases__"
);
static
BoxedString
*
bases_str
=
internStringImmortal
(
"__bases__"
);
cls
->
setattr
(
bases_str
,
_value
,
NULL
);
cls
->
setattr
(
bases_str
,
_value
,
NULL
);
return
;
return
None
;
}
}
PyObject_GenericSetAttr
(
cls
,
_attr
,
_value
);
PyObject_GenericSetAttr
(
cls
,
_attr
,
_value
);
checkAndThrowCAPIException
();
checkAndThrowCAPIException
();
return
None
;
}
}
static
int
classobj_setattro
(
Box
*
cls
,
Box
*
attr
,
Box
*
value
)
noexcept
{
static
int
classobj_setattro
(
Box
*
cls
,
Box
*
attr
,
Box
*
value
)
noexcept
{
...
...
src/runtime/dict.cpp
View file @
c011fb3a
...
@@ -696,8 +696,8 @@ static Box* dict_repr(PyObject* self) noexcept {
...
@@ -696,8 +696,8 @@ static Box* dict_repr(PyObject* self) noexcept {
}
}
void
setupDict
()
{
void
setupDict
()
{
dict_iterator_cls
=
BoxedHeapClass
::
create
(
type_cls
,
object_cls
,
&
dictIteratorGCHandler
,
0
,
0
,
sizeof
(
BoxedDict
),
dict_iterator_cls
=
BoxedHeapClass
::
create
(
type_cls
,
object_cls
,
&
dictIteratorGCHandler
,
0
,
0
,
false
,
"dictionary-itemiterator"
);
sizeof
(
BoxedDictIterator
),
false
,
"dictionary-itemiterator"
);
dict_keys_cls
=
BoxedHeapClass
::
create
(
type_cls
,
object_cls
,
&
dictViewGCHandler
,
0
,
0
,
sizeof
(
BoxedDictView
),
false
,
dict_keys_cls
=
BoxedHeapClass
::
create
(
type_cls
,
object_cls
,
&
dictViewGCHandler
,
0
,
0
,
sizeof
(
BoxedDictView
),
false
,
"dict_keys"
);
"dict_keys"
);
...
...
src/runtime/list.cpp
View file @
c011fb3a
...
@@ -1083,8 +1083,8 @@ extern "C" int PyList_SetSlice(PyObject* a, Py_ssize_t ilow, Py_ssize_t ihigh, P
...
@@ -1083,8 +1083,8 @@ extern "C" int PyList_SetSlice(PyObject* a, Py_ssize_t ilow, Py_ssize_t ihigh, P
}
}
void
setupList
()
{
void
setupList
()
{
list_iterator_cls
=
BoxedHeapClass
::
create
(
type_cls
,
object_cls
,
&
listIteratorGCHandler
,
0
,
0
,
sizeof
(
BoxedList
),
list_iterator_cls
=
BoxedHeapClass
::
create
(
type_cls
,
object_cls
,
&
listIteratorGCHandler
,
0
,
0
,
false
,
"listiterator"
);
sizeof
(
BoxedListIterator
),
false
,
"listiterator"
);
list_reverse_iterator_cls
=
BoxedHeapClass
::
create
(
type_cls
,
object_cls
,
&
listIteratorGCHandler
,
0
,
0
,
list_reverse_iterator_cls
=
BoxedHeapClass
::
create
(
type_cls
,
object_cls
,
&
listIteratorGCHandler
,
0
,
0
,
sizeof
(
BoxedListIterator
),
false
,
"listreverseiterator"
);
sizeof
(
BoxedListIterator
),
false
,
"listreverseiterator"
);
...
...
src/runtime/set.cpp
View file @
c011fb3a
...
@@ -488,8 +488,8 @@ extern "C" PyObject* PyFrozenSet_New(PyObject* iterable) noexcept {
...
@@ -488,8 +488,8 @@ extern "C" PyObject* PyFrozenSet_New(PyObject* iterable) noexcept {
using
namespace
pyston
::
set
;
using
namespace
pyston
::
set
;
void
setupSet
()
{
void
setupSet
()
{
set_iterator_cls
=
BoxedHeapClass
::
create
(
type_cls
,
object_cls
,
&
setIteratorGCHandler
,
0
,
0
,
sizeof
(
BoxedSet
),
set_iterator_cls
=
BoxedHeapClass
::
create
(
type_cls
,
object_cls
,
&
setIteratorGCHandler
,
0
,
0
,
false
,
"setiterator"
);
sizeof
(
BoxedSetIterator
),
false
,
"setiterator"
);
set_iterator_cls
->
giveAttr
(
set_iterator_cls
->
giveAttr
(
"__iter__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
setiteratorIter
,
typeFromClass
(
set_iterator_cls
),
1
)));
"__iter__"
,
new
BoxedFunction
(
boxRTFunction
((
void
*
)
setiteratorIter
,
typeFromClass
(
set_iterator_cls
),
1
)));
set_iterator_cls
->
giveAttr
(
"__hasnext__"
,
set_iterator_cls
->
giveAttr
(
"__hasnext__"
,
...
...
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