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
d915f9e4
Commit
d915f9e4
authored
Nov 21, 2016
by
Boxiang Sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
index_id temp fix
parent
df55c251
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
11 deletions
+13
-11
src/codegen/ast_interpreter.cpp
src/codegen/ast_interpreter.cpp
+3
-3
src/codegen/irgen/irgenerator.cpp
src/codegen/irgen/irgenerator.cpp
+4
-0
src/runtime/import.cpp
src/runtime/import.cpp
+2
-3
src/runtime/import.h
src/runtime/import.h
+1
-1
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+2
-3
src/runtime/objmodel.h
src/runtime/objmodel.h
+1
-1
No files found.
src/codegen/ast_interpreter.cpp
View file @
d915f9e4
...
...
@@ -822,8 +822,8 @@ Value ASTInterpreter::visit_importfrom(BST_ImportFrom* node) {
InternedString
name
=
getCodeConstants
().
getInternedString
(
node
->
index_id
);
Value
v
;
if
(
jit
)
v
.
var
=
jit
->
emitImportFrom
(
module
,
name
);
v
.
o
=
importFrom
(
module
.
o
,
(
BoxedString
*
)
name
);
v
.
var
=
jit
->
emitImportFrom
(
module
,
name
.
getBox
()
);
v
.
o
=
importFrom
(
module
.
o
,
name
.
getBox
()
);
return
v
;
}
...
...
@@ -836,7 +836,7 @@ Value ASTInterpreter::visit_importname(BST_ImportName* node) {
Value
v
;
if
(
jit
)
v
.
var
=
jit
->
emitImportName
(
level
,
froms
,
name
.
getBox
());
v
.
o
=
import
(
level
,
froms
.
o
,
(
BoxedString
*
)
name
);
v
.
o
=
import
(
level
,
froms
.
o
,
name
.
getBox
()
);
return
v
;
}
...
...
src/codegen/irgen/irgenerator.cpp
View file @
d915f9e4
...
...
@@ -946,6 +946,8 @@ private:
InternedString
name
=
irstate
->
getCodeConstants
().
getInternedString
(
node
->
index_id
);
llvm
::
Value
*
converted_name
=
embedRelocatablePtr
(
name
,
g
.
llvm_boxedstring_type_ptr
);
emitter
.
setType
(
converted_name
,
RefType
::
BORROWED
);
llvm
::
Value
*
r
=
emitter
.
createCall2
(
unw_info
,
g
.
funcs
.
importFrom
,
converted_module
->
getValue
(),
converted_name
);
emitter
.
setType
(
r
,
RefType
::
OWNED
);
...
...
@@ -976,6 +978,8 @@ private:
InternedString
name
=
irstate
->
getCodeConstants
().
getInternedString
(
node
->
index_id
);
llvm
::
Value
*
converted_name
=
embedRelocatablePtr
(
name
,
g
.
llvm_boxedstring_type_ptr
);
emitter
.
setType
(
converted_name
,
RefType
::
BORROWED
);
llvm
::
Value
*
imported
=
emitter
.
createCall
(
unw_info
,
g
.
funcs
.
import
,
{
getConstantInt
(
level
,
g
.
i32
),
converted_froms
->
getValue
(),
converted_name
});
...
...
src/runtime/import.cpp
View file @
d915f9e4
...
...
@@ -133,9 +133,8 @@ extern "C" PyObject* PyImport_ExecCodeModuleEx(const char* name, PyObject* co, c
}
}
extern
"C"
Box
*
import
(
int
level
,
Box
*
from_imports
,
Box
*
_module_name
)
{
assert
(
_module_name
->
cls
==
str_cls
);
BoxedString
*
module_name
=
(
BoxedString
*
)
_module_name
;
extern
"C"
Box
*
import
(
int
level
,
Box
*
from_imports
,
BoxedString
*
module_name
)
{
assert
(
module_name
->
cls
==
str_cls
);
Box
*
rtn
=
PyImport_ImportModuleLevel
(
module_name
->
c_str
(),
getGlobalsDict
(),
NULL
,
from_imports
,
level
);
if
(
!
rtn
)
throwCAPIException
();
...
...
src/runtime/import.h
View file @
d915f9e4
...
...
@@ -20,7 +20,7 @@
namespace
pyston
{
extern
"C"
PyObject
*
PyImport_GetImporter
(
PyObject
*
path
)
noexcept
;
extern
"C"
Box
*
import
(
int
level
,
Box
*
from_imports
,
Box
*
module_name
);
extern
"C"
Box
*
import
(
int
level
,
Box
*
from_imports
,
Box
edString
*
module_name
);
BoxedModule
*
importCExtension
(
BoxedString
*
full_name
,
const
std
::
string
&
last_name
,
const
std
::
string
&
path
);
#ifdef Py_REF_DEBUG
...
...
src/runtime/objmodel.cpp
View file @
d915f9e4
...
...
@@ -7636,11 +7636,10 @@ extern "C" void setGlobal(Box* globals, BoxedString* name, STOLEN(Box*) value) {
}
}
extern
"C"
Box
*
importFrom
(
Box
*
_m
,
Box
*
_
name
)
{
extern
"C"
Box
*
importFrom
(
Box
*
_m
,
Box
edString
*
name
)
{
STAT_TIMER
(
t0
,
"us_timer_importFrom"
,
10
);
assert
(
_name
->
cls
==
str_cls
);
BoxedString
*
name
=
(
BoxedString
*
)
_name
;
assert
(
name
->
cls
==
str_cls
);
Box
*
r
=
getattrInternal
<
CXX
>
(
_m
,
name
);
if
(
r
)
...
...
src/runtime/objmodel.h
View file @
d915f9e4
...
...
@@ -94,7 +94,7 @@ extern "C" void assignSlice(PyObject* u, PyObject* v, PyObject* w, PyObject* x);
extern
"C"
Box
*
getclsattr
(
Box
*
obj
,
BoxedString
*
attr
)
__attribute__
((
noinline
));
extern
"C"
Box
*
getclsattrMaybeNonstring
(
Box
*
obj
,
Box
*
attr
)
__attribute__
((
noinline
));
extern
"C"
Box
*
unaryop
(
Box
*
operand
,
int
op_type
)
__attribute__
((
noinline
));
extern
"C"
Box
*
importFrom
(
Box
*
obj
,
Box
*
attr
)
__attribute__
((
noinline
));
extern
"C"
Box
*
importFrom
(
Box
*
obj
,
Box
edString
*
attr
)
__attribute__
((
noinline
));
extern
"C"
Box
*
importStar
(
Box
*
from_module
,
Box
*
to_globals
)
__attribute__
((
noinline
));
extern
"C"
Box
**
unpackIntoArray
(
Box
*
obj
,
int64_t
expected_size
,
Box
**
out_keep_alive
);
extern
"C"
void
assertNameDefined
(
bool
b
,
const
char
*
name
,
BoxedClass
*
exc_cls
,
bool
local_var_msg
);
...
...
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