Commit a303f67a authored by Kevin Modzelewski's avatar Kevin Modzelewski

Do the same for float

parent affb88b1
......@@ -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;
}
......
This diff is collapsed.
......@@ -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*);
......
......@@ -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;
......
......@@ -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
}
}
......
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment