Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index 1ef2dad7396166213cd10df6ef1c585182d87cee..b8133ae15e43e3fe08a65114cb60b4c0d8d5300d 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -6944,15 +6944,9 @@ static MaybeObject* Runtime_CompileForOnStackReplacement(Arguments args) { |
Handle<Code> check_code = check_stub.GetCode(); |
Handle<Code> replacement_code( |
Builtins::builtin(Builtins::OnStackReplacement)); |
- // Iterate the unoptimized code and revert all the patched stack checks. |
- for (RelocIterator it(*unoptimized, RelocInfo::kCodeTargetMask); |
- !it.done(); |
- it.next()) { |
- RelocInfo* rinfo = it.rinfo(); |
- if (rinfo->target_address() == replacement_code->entry()) { |
- Deoptimizer::RevertStackCheckCode(rinfo, *check_code); |
- } |
- } |
+ Deoptimizer::RevertStackCheckCode(*unoptimized, |
+ *check_code, |
+ *replacement_code); |
// Allow OSR only at nesting level zero again. |
unoptimized->set_allow_osr_at_loop_nesting_level(0); |