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
e806062d
Commit
e806062d
authored
Jun 25, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix 'python -i' mode
parent
bfdd8844
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
src/jit.cpp
src/jit.cpp
+16
-6
src/runtime/types.h
src/runtime/types.h
+1
-1
No files found.
src/jit.cpp
View file @
e806062d
...
...
@@ -37,6 +37,7 @@
#include "core/threading.h"
#include "core/types.h"
#include "core/util.h"
#include "runtime/types.h"
#ifndef GITREV
...
...
@@ -114,8 +115,9 @@ int main(int argc, char** argv) {
// end of argument parsing
_t
.
split
(
"to run"
);
BoxedModule
*
main_module
=
NULL
;
if
(
fn
!=
NULL
)
{
BoxedModule
*
main
=
createModule
(
"__main__"
,
fn
);
main_module
=
createModule
(
"__main__"
,
fn
);
llvm
::
SmallString
<
128
>
path
;
...
...
@@ -148,7 +150,7 @@ int main(int argc, char** argv) {
}
try
{
compileAndRunModule
(
m
,
main
);
compileAndRunModule
(
m
,
main
_module
);
}
catch
(
Box
*
b
)
{
std
::
string
msg
=
formatException
(
b
);
printLastTraceback
();
...
...
@@ -159,7 +161,11 @@ int main(int argc, char** argv) {
}
if
(
repl
&&
BENCH
)
{
BoxedModule
*
main
=
createModule
(
"__main__"
,
"<bench>"
);
if
(
!
main_module
)
{
main_module
=
createModule
(
"__main__"
,
"<bench>"
);
}
else
{
main_module
->
fn
=
"<bench>"
;
}
timeval
start
,
end
;
gettimeofday
(
&
start
,
NULL
);
...
...
@@ -170,7 +176,7 @@ int main(int argc, char** argv) {
run
++
;
AST_Module
*
m
=
new
AST_Module
();
compileAndRunModule
(
m
,
main
);
compileAndRunModule
(
m
,
main
_module
);
if
(
run
>=
MAX_RUNS
)
{
printf
(
"Quitting after %d iterations
\n
"
,
run
);
...
...
@@ -193,7 +199,11 @@ int main(int argc, char** argv) {
printf
(
"Pyston v0.1 (rev "
STRINGIFY
(
GITREV
)
")"
);
printf
(
", targeting Python %d.%d.%d
\n
"
,
PYTHON_VERSION_MAJOR
,
PYTHON_VERSION_MINOR
,
PYTHON_VERSION_MICRO
);
BoxedModule
*
main
=
createModule
(
"__main__"
,
"<stdin>"
);
if
(
!
main_module
)
{
main_module
=
createModule
(
"__main__"
,
"<stdin>"
);
}
else
{
main_module
->
fn
=
"<stdin>"
;
}
while
(
repl
)
{
char
*
line
=
readline
(
">> "
);
...
...
@@ -240,7 +250,7 @@ int main(int argc, char** argv) {
}
try
{
compileAndRunModule
(
m
,
main
);
compileAndRunModule
(
m
,
main
_module
);
}
catch
(
Box
*
b
)
{
std
::
string
msg
=
formatException
(
b
);
printLastTraceback
();
...
...
src/runtime/types.h
View file @
e806062d
...
...
@@ -286,7 +286,7 @@ public:
class
BoxedModule
:
public
Box
{
public:
HCAttrs
attrs
;
const
std
::
string
fn
;
// for traceback purposes; not the same as __file__
std
::
string
fn
;
// for traceback purposes; not the same as __file__
BoxedModule
(
const
std
::
string
&
name
,
const
std
::
string
&
fn
);
std
::
string
name
();
...
...
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