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
bf4846a8
Commit
bf4846a8
authored
Feb 26, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit '02bd71' into refcounting
parents
8165581c
02bd71a8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
15 deletions
+37
-15
src/codegen/baseline_jit.cpp
src/codegen/baseline_jit.cpp
+1
-1
src/runtime/ics.cpp
src/runtime/ics.cpp
+1
-1
src/runtime/types.cpp
src/runtime/types.cpp
+12
-10
test/extra/lxml_test.py
test/extra/lxml_test.py
+4
-3
test/tests/class_and_func_name.py
test/tests/class_and_func_name.py
+6
-0
test/tests/imp_test.py
test/tests/imp_test.py
+8
-0
test/tests/none__class__.py
test/tests/none__class__.py
+5
-0
No files found.
src/codegen/baseline_jit.cpp
View file @
bf4846a8
...
...
@@ -84,7 +84,7 @@ JitCodeBlock::JitCodeBlock(llvm::StringRef name)
int32_t
*
offset_ptr
=
(
int32_t
*
)((
uint8_t
*
)
eh_frame_addr
+
0x20
);
int32_t
*
size_ptr
=
(
int32_t
*
)((
uint8_t
*
)
eh_frame_addr
+
0x24
);
int64_t
offset
=
(
int8_t
*
)
code
.
get
()
-
(
int8_t
*
)
offset_ptr
;
assert
(
offset
>=
INT_MIN
&&
offset
<=
INT_MAX
);
RELEASE_ASSERT
(
offset
>=
INT_MIN
&&
offset
<=
INT_MAX
,
""
);
*
offset_ptr
=
offset
;
*
size_ptr
=
code_size
;
...
...
src/runtime/ics.cpp
View file @
bf4846a8
...
...
@@ -168,7 +168,7 @@ static void writeTrivialEhFrame(void* eh_frame_addr, void* func_addr, uint64_t f
int32_t
*
size_ptr
=
(
int32_t
*
)((
uint8_t
*
)
eh_frame_addr
+
0x24
);
int64_t
offset
=
(
int8_t
*
)
func_addr
-
(
int8_t
*
)
offset_ptr
;
assert
(
offset
>=
INT_MIN
&&
offset
<=
INT_MAX
);
RELEASE_ASSERT
(
offset
>=
INT_MIN
&&
offset
<=
INT_MAX
,
""
);
*
offset_ptr
=
offset
;
assert
(
func_size
<=
UINT_MAX
);
...
...
src/runtime/types.cpp
View file @
bf4846a8
...
...
@@ -3086,7 +3086,7 @@ static Box* typeName(Box* b, void*) {
}
static
void
typeSetName
(
Box
*
b
,
Box
*
v
,
void
*
)
{
assert
(
b
->
cls
==
type_cls
);
assert
(
PyType_Check
(
b
)
);
BoxedClass
*
type
=
static_cast
<
BoxedClass
*>
(
b
);
// Awkward... in CPython you can only set __name__ for heaptype classes
...
...
@@ -4047,6 +4047,7 @@ void setupRuntime() {
none_cls
->
giveAttr
(
"__nonzero__"
,
new
BoxedFunction
(
FunctionMetadata
::
create
((
void
*
)
noneNonzero
,
BOXED_BOOL
,
1
)));
none_cls
->
giveAttrBorrowed
(
"__doc__"
,
None
);
none_cls
->
tp_hash
=
(
hashfunc
)
_Py_HashPointer
;
none_cls
->
tp_new
=
NULL
;
// don't allow creating instances
none_cls
->
freeze
();
none_cls
->
tp_repr
=
none_repr
;
...
...
@@ -4345,24 +4346,25 @@ BoxedModule* createModule(BoxedString* name, const char* fn, const char* doc) no
BoxedDict
*
d
=
getSysModulesDict
();
BoxedModule
*
module
=
NULL
;
// Surprisingly, there are times that we need to return the existing module if
// one exists:
Box
*
existing
=
d
->
getOrNull
(
name
);
if
(
existing
&&
PyModule_Check
(
existing
))
{
return
static_cast
<
BoxedModule
*>
(
existing
);
module
=
static_cast
<
BoxedModule
*>
(
existing
);
Py_INCREF
(
module
);
}
else
{
module
=
new
BoxedModule
();
autoDecref
(
moduleInit
(
module
,
name
,
autoDecref
(
boxString
(
doc
?
doc
:
""
))));
d
->
d
[
incref
(
name
)]
=
module
;
}
BoxedModule
*
module
=
new
BoxedModule
();
autoDecref
(
moduleInit
(
module
,
name
,
autoDecref
(
boxString
(
doc
?
doc
:
""
))));
if
(
fn
)
module
->
giveAttr
(
"__file__"
,
boxString
(
fn
));
Py_XDECREF
(
existing
);
d
->
d
[
incref
(
name
)]
=
module
;
module
->
setattr
(
autoDecref
(
internStringMortal
(
"__file__"
)),
autoDecref
(
boxString
(
fn
)),
NULL
);
if
(
name
->
s
()
==
"__main__"
)
module
->
giveAttrBorrowed
(
"__builtins__"
,
builtins_module
);
module
->
setattr
(
autoDecref
(
internStringMortal
(
"__builtins__"
)),
builtins_module
,
NULL
);
return
module
;
}
...
...
test/extra/lxml_test.py
View file @
bf4846a8
...
...
@@ -32,9 +32,10 @@ def install_and_test_lxml():
print
"Applied lxml patch"
subprocess
.
check_call
([
PYTHON_EXE
,
"setup.py"
,
"build_ext"
,
"-i"
,
"--with-cython"
],
cwd
=
LXML_DIR
)
expected
=
[{
'ran'
:
1381
,
'failures'
:
28
,
'errors'
:
5
}]
run_test
([
PYTHON_EXE
,
"test.py"
],
cwd
=
LXML_DIR
,
expected
=
expected
)
# We currently don't run the objectify tests because the assume that the python impl use refcounting.
expected
=
[{
'ran'
:
1188
,
'failures'
:
3
,
'errors'
:
1
}]
run_test
([
PYTHON_EXE
,
"test.py"
,
"!.*test_objectify.py"
],
cwd
=
LXML_DIR
,
expected
=
expected
)
create_virtenv
(
ENV_NAME
,
None
,
force_create
=
True
)
install_and_test_lxml
()
test/tests/class_and_func_name.py
View file @
bf4846a8
...
...
@@ -54,3 +54,9 @@ print sorted.__name__
# should all fail:
set_name
(
sorted
,
"blah"
)
set_name
(
sorted
,
5
)
import
abc
class
D
(
C
):
__metaclass__
=
abc
.
ABCMeta
D
.
__name__
=
"has_abc_meta"
print
D
test/tests/imp_test.py
View file @
bf4846a8
...
...
@@ -35,3 +35,11 @@ def n(s):
return
str
(
s
).
replace
(
".pyc"
,
".py"
)
print
n
(
m
),
n
(
m
.
__name__
),
n
(
m
.
__file__
),
hasattr
(
m
,
"__path__"
)
import
sys
,
types
name
=
"json"
m
=
sys
.
modules
[
name
]
=
types
.
ModuleType
(
name
)
print
sorted
(
dir
(
m
))
s
=
imp
.
find_module
(
name
)
m
=
imp
.
load_module
(
name
,
*
s
)
print
name
in
m
.
__file__
,
sorted
(
dir
(
m
))
test/tests/none__class__.py
View file @
bf4846a8
print
None
.
__class__
print
type
(
None
).
__doc__
,
None
.
__doc__
try
:
type
(
None
)()
except
TypeError
as
e
:
print
e
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