Index: src/deoptimizer.cc |
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc |
index c4dae93b62fe111ab3f6dbfb7b3da6ff1d8479a4..407351fdfd18482a11f4cff0f9358b068f8f10ce 100644 |
--- a/src/deoptimizer.cc |
+++ b/src/deoptimizer.cc |
@@ -1487,8 +1487,9 @@ void Deoptimizer::EnsureCodeForDeoptimizationEntry(BailoutType type, |
? data->eager_deoptimization_entry_code_entries_ |
: data->lazy_deoptimization_entry_code_entries_; |
if (max_entry_id < entry_count) return; |
- entry_count = Min(Max(entry_count * 2, Deoptimizer::kMinNumberOfEntries), |
- Deoptimizer::kMaxNumberOfEntries); |
+ entry_count = Max(entry_count, Deoptimizer::kMinNumberOfEntries); |
+ while (max_entry_id >= entry_count) entry_count *= 2; |
palmer
2012/12/18 20:33:41
Risk of integer overflow? And why not use unsigned
Sven Panne
2012/12/19 07:34:58
Regarding typing: See above. Regarding overflow: C
|
+ ASSERT(entry_count <= Deoptimizer::kMaxNumberOfEntries); |
MacroAssembler masm(Isolate::Current(), NULL, 16 * KB); |
masm.set_emit_debug_code(false); |