Commit df9ec460 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Merge pull request #631 from kmod/perf4

more rewriting
parents 9415d7c1 73fc53c9
...@@ -290,6 +290,10 @@ bool ICInfo::shouldAttempt() { ...@@ -290,6 +290,10 @@ bool ICInfo::shouldAttempt() {
retry_in--; retry_in--;
return false; return false;
} }
// Note(kmod): in some pathological deeply-recursive cases, it's important that we set the
// retry counter even if we attempt it again. We could probably handle this by setting
// the backoff to 0 on commit, and then setting the retry to the backoff here.
return !isMegamorphic(); return !isMegamorphic();
} }
......
...@@ -321,7 +321,7 @@ private: ...@@ -321,7 +321,7 @@ private:
// Loads the constant into any register or if already in a register just return it // Loads the constant into any register or if already in a register just return it
assembler::Register loadConst(uint64_t val, Location otherThan = Location::any()); assembler::Register loadConst(uint64_t val, Location otherThan = Location::any());
llvm::DenseMap<uint64_t, RewriterVar*> constToVar; std::unordered_map<uint64_t, RewriterVar*> constToVar;
}; };
......
This diff is collapsed.
...@@ -19,4 +19,10 @@ def fact(n): ...@@ -19,4 +19,10 @@ def fact(n):
w = doStuff() w = doStuff()
fact(10) # try to clear some memory fact(10) # try to clear some memory
def recurse(f, n):
if n:
return recurse(f, n - 1)
return f()
recurse(gc.collect, 50)
gc.collect() gc.collect()
...@@ -21,6 +21,12 @@ def getWR(): ...@@ -21,6 +21,12 @@ def getWR():
wr = getWR() wr = getWR()
fact(100) # try to clear some memory fact(100) # try to clear some memory
def recurse(f, n):
if n:
return recurse(f, n - 1)
return f()
recurse(gc.collect, 50)
gc.collect() gc.collect()
try: try:
......
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