Chromium Code Reviews| Index: src/deoptimizer.cc |
| diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc |
| index 00e7d0ee2cab70655ebdf3613f34cc93de44d049..7f0781cd550e1f151905a02b005508963d1ed04f 100644 |
| --- a/src/deoptimizer.cc |
| +++ b/src/deoptimizer.cc |
| @@ -820,11 +820,22 @@ void Deoptimizer::PatchStackCheckCode(Code* unoptimized_code, |
| unoptimized_code->stack_check_table_offset(); |
| uint32_t table_length = Memory::uint32_at(stack_check_cursor); |
| stack_check_cursor += kIntSize; |
| + Address first_site = 0; |
| + Address last_site = 0; |
| for (uint32_t i = 0; i < table_length; ++i) { |
| uint32_t pc_offset = Memory::uint32_at(stack_check_cursor + kIntSize); |
| Address pc_after = unoptimized_code->instruction_start() + pc_offset; |
| PatchStackCheckCodeAt(pc_after, check_code, replacement_code); |
| stack_check_cursor += 2 * kIntSize; |
| + if (first_site == 0) { |
| + first_site = pc_after; |
| + } |
| + last_site = pc_after; |
| + } |
| + if (table_length > 0) { |
| + // Flush instruction cache for the patched code blocks. |
| + uint32_t length = last_site - first_site + patch_size(); |
|
Søren Thygesen Gjesse
2011/02/04 13:54:27
If you use the CodePatcher the i-cache flushing is
Karl Klose
2011/02/04 18:06:49
Done. I used the code patcher and removed the flus
|
| + CPU::FlushICache(first_site - patch_size(), length); |
| } |
| } |
| @@ -839,11 +850,22 @@ void Deoptimizer::RevertStackCheckCode(Code* unoptimized_code, |
| unoptimized_code->stack_check_table_offset(); |
| uint32_t table_length = Memory::uint32_at(stack_check_cursor); |
| stack_check_cursor += kIntSize; |
| + Address first_site = 0; |
| + Address last_site = 0; |
| for (uint32_t i = 0; i < table_length; ++i) { |
| uint32_t pc_offset = Memory::uint32_at(stack_check_cursor + kIntSize); |
| Address pc_after = unoptimized_code->instruction_start() + pc_offset; |
| RevertStackCheckCodeAt(pc_after, check_code, replacement_code); |
| stack_check_cursor += 2 * kIntSize; |
| + if (first_site == 0) { |
| + first_site = pc_after; |
| + } |
| + last_site = pc_after; |
| + } |
| + if (table_length > 0) { |
| + // Flush instruction cache for the patched code blocks. |
| + uint32_t length = last_site - first_site + patch_size(); |
|
Søren Thygesen Gjesse
2011/02/04 13:54:27
Ditto.
Karl Klose
2011/02/04 18:06:49
Done. I used the code patcher and removed the flus
|
| + CPU::FlushICache(first_site - patch_size(), length); |
| } |
| } |