Commit d0b63f26 authored by Marius Wachtler's avatar Marius Wachtler

Merge commit 'b830092a' into refcounting

parents 84e3eeb8 b830092a
......@@ -110,7 +110,7 @@ public:
}
static InstanceMethodType* get(CompilerType* obj_type, CompilerType* function_type) {
InstanceMethodType* rtn = made[std::make_pair(obj_type, function_type)];
InstanceMethodType*& rtn = made[std::make_pair(obj_type, function_type)];
if (rtn == NULL)
rtn = new InstanceMethodType(obj_type, function_type);
return rtn;
......@@ -182,14 +182,18 @@ public:
void serializeToFrame(VAR* var, std::vector<llvm::Value*>& stackmap_args) override {
var->getValue()->obj->serializeToFrame(stackmap_args);
var->getValue()->func->serializeToFrame(stackmap_args);
var->getValue()->im_class->serializeToFrame(stackmap_args);
}
Box* deserializeFromFrame(const FrameVals& vals) override {
assert(vals.size() == numFrameArgs());
abort();
assert(vals.size() == numFrameArgs() && vals.size() == 3);
Box* obj = reinterpret_cast<Box*>(vals[0]);
Box* func = reinterpret_cast<Box*>(vals[1]);
Box* im_class = reinterpret_cast<Box*>(vals[2]);
return boxInstanceMethod(obj, func, im_class);
}
int numFrameArgs() override { return obj_type->numFrameArgs() + function_type->numFrameArgs(); }
int numFrameArgs() override { return obj_type->numFrameArgs() + function_type->numFrameArgs() + 1 /* im_class */; }
};
std::unordered_map<std::pair<CompilerType*, CompilerType*>, InstanceMethodType*> InstanceMethodType::made;
......
# skip-if: '-O' in EXTRA_JIT_ARGS or '-n' in EXTRA_JIT_ARGS
# statcheck: 4 == noninit_count('num_deopt')
# this used to hit an abort in our LLVM tier codegen
try:
import __pyston__
__pyston__.setOption("OSR_THRESHOLD_BASELINE", 50)
__pyston__.setOption("REOPT_THRESHOLD_BASELINE", 50)
__pyston__.setOption("SPECULATION_THRESHOLD", 10)
except ImportError:
pass
from thread import allocate_lock
def triggers_deopt(x):
if x < 90:
return ""
return unicode("")
class C():
def __init__(self):
self.l = allocate_lock()
def f(self, x):
with self.l:
triggers_deopt(x).isalnum
c = C()
for i in range(100):
c.f(i)
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