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
a303f67a
Commit
a303f67a
authored
Oct 15, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do the same for float
parent
affb88b1
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
93 additions
and
97 deletions
+93
-97
src/analysis/type_analysis.cpp
src/analysis/type_analysis.cpp
+0
-2
src/codegen/compvars.cpp
src/codegen/compvars.cpp
+84
-76
src/codegen/compvars.h
src/codegen/compvars.h
+6
-1
src/codegen/irgen/irgenerator.cpp
src/codegen/irgen/irgenerator.cpp
+1
-10
src/core/options.h
src/core/options.h
+0
-6
src/core/types.h
src/core/types.h
+2
-2
No files found.
src/analysis/type_analysis.cpp
View file @
a303f67a
...
...
@@ -62,10 +62,8 @@ static CompilerType* unboxedType(ConcreteCompilerType* t) {
return
BOOL
;
if
(
t
==
BOXED_INT
)
return
INT
;
#if ENABLE_UNBOXED_VALUES
if
(
t
==
BOXED_FLOAT
)
return
FLOAT
;
#endif
return
t
;
}
...
...
src/codegen/compvars.cpp
View file @
a303f67a
This diff is collapsed.
Click to expand it.
src/codegen/compvars.h
View file @
a303f67a
...
...
@@ -418,8 +418,13 @@ CompilerVariable* makeInt(llvm::Value*);
CompilerVariable
*
makeUnboxedInt
(
IREmitter
&
,
ConcreteCompilerVariable
*
);
CompilerVariable
*
makeUnboxedInt
(
IREmitter
&
,
llvm
::
Value
*
);
// Same for floats:
CompilerVariable
*
makeFloat
(
llvm
::
Value
*
);
CompilerVariable
*
makeFloat
(
double
);
CompilerVariable
*
makeUnboxedFloat
(
IREmitter
&
,
ConcreteCompilerVariable
*
);
CompilerVariable
*
makeUnboxedFloat
(
IREmitter
&
,
llvm
::
Value
*
);
ConcreteCompilerVariable
*
makeBool
(
bool
);
ConcreteCompilerVariable
*
makeFloat
(
double
);
ConcreteCompilerVariable
*
makeLong
(
Box
*
);
ConcreteCompilerVariable
*
makePureImaginary
(
Box
*
);
CompilerVariable
*
makeStr
(
BoxedString
*
);
...
...
src/codegen/irgen/irgenerator.cpp
View file @
a303f67a
...
...
@@ -1521,13 +1521,9 @@ private:
if
(
t
==
BOXED_INT
)
{
return
makeUnboxedInt
(
emitter
,
v
);
}
#if ENABLE_UNBOXED_VALUES
if
(
t
==
BOXED_FLOAT
)
{
llvm
::
Value
*
unboxed
=
emitter
.
getBuilder
()
->
CreateCall
(
g
.
funcs
.
unboxFloat
,
v
);
ConcreteCompilerVariable
*
rtn
=
new
ConcreteCompilerVariable
(
FLOAT
,
unboxed
,
true
);
return
rtn
;
return
makeUnboxedFloat
(
emitter
,
v
);
}
#endif
if
(
t
==
BOXED_BOOL
)
{
llvm
::
Value
*
unboxed
=
emitter
.
getBuilder
()
->
CreateCall
(
g
.
funcs
.
unboxBool
,
v
);
return
boolFromI1
(
emitter
,
unboxed
);
...
...
@@ -2211,10 +2207,8 @@ private:
converted_args
.
push_back
(
var
);
assert
(
var
->
getType
()
!=
BOXED_INT
);
#if ENABLE_UNBOXED_VALUES
assert
(
var
->
getType
()
!=
BOXED_FLOAT
&&
"should probably unbox it, but why is it boxed in the first place?"
);
#endif
// This line can never get hit right now for the same reason that the variables must already be
// concrete,
...
...
@@ -2672,9 +2666,6 @@ public:
ASSERT
(
var
->
getType
()
->
isUsable
(),
"%s"
,
name
.
c_str
());
#if ENABLE_UNBOXED_VALUES
assert
(
var
->
getType
()
!=
BOXED_FLOAT
);
#endif
CompilerVariable
*&
cur
=
symbol_table
[
name
];
assert
(
cur
==
NULL
);
cur
=
var
;
...
...
src/core/options.h
View file @
a303f67a
...
...
@@ -51,12 +51,6 @@ extern bool ENABLE_ICS, ENABLE_ICGENERICS, ENABLE_ICGETITEMS, ENABLE_ICSETITEMS,
extern
bool
BOOLS_AS_I64
;
#define ENABLE_SAMPLING_PROFILER 0
// Our current implementation of unbox values has some minor compatibility issues, where it can
// change the apparent id() / is-equality of a boxed value (by inserting extra unbox+box pairs).
// I think it can be rescued (we need the unboxed compilertype to remember the boxed value),
// but for now it's just turned off with this flag.
#define ENABLE_UNBOXED_VALUES 0
}
}
...
...
src/core/types.h
View file @
a303f67a
...
...
@@ -93,10 +93,10 @@ template <class V> class ValuedCompilerType;
typedef
ValuedCompilerType
<
llvm
::
Value
*>
ConcreteCompilerType
;
ConcreteCompilerType
*
typeFromClass
(
BoxedClass
*
);
extern
ConcreteCompilerType
*
UNBOXED_INT
,
*
BOXED_INT
,
*
LONG
,
*
FLOAT
,
*
BOXED_FLOAT
,
*
UNKNOWN
,
*
BOOL
,
*
STR
,
*
NONE
,
*
LIST
,
extern
ConcreteCompilerType
*
UNBOXED_INT
,
*
BOXED_INT
,
*
LONG
,
*
UNBOXED_
FLOAT
,
*
BOXED_FLOAT
,
*
UNKNOWN
,
*
BOOL
,
*
STR
,
*
NONE
,
*
LIST
,
*
SLICE
,
*
ELLIPSIS
,
*
MODULE
,
*
DICT
,
*
BOOL
,
*
BOXED_BOOL
,
*
BOXED_TUPLE
,
*
SET
,
*
FROZENSET
,
*
CLOSURE
,
*
GENERATOR
,
*
BOXED_COMPLEX
,
*
FRAME_INFO
;
extern
CompilerType
*
UNDEF
,
*
INT
;
extern
CompilerType
*
UNDEF
,
*
INT
,
*
FLOAT
;
class
CompilerVariable
;
template
<
class
V
>
class
ValuedCompilerVariable
;
...
...
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