| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 RelocInfoWriter reloc_info_writer(reloc_end_address, code_start_address); | 73 RelocInfoWriter reloc_info_writer(reloc_end_address, code_start_address); |
| 74 | 74 |
| 75 // For each return after a safepoint insert a call to the corresponding | 75 // For each return after a safepoint insert a call to the corresponding |
| 76 // deoptimization entry. Since the call is a relative encoding, write new | 76 // deoptimization entry. Since the call is a relative encoding, write new |
| 77 // reloc info. We do not need any of the existing reloc info because the | 77 // reloc info. We do not need any of the existing reloc info because the |
| 78 // existing code will not be used again (we zap it in debug builds). | 78 // existing code will not be used again (we zap it in debug builds). |
| 79 SafepointTable table(code); | 79 SafepointTable table(code); |
| 80 Address prev_address = code_start_address; | 80 Address prev_address = code_start_address; |
| 81 for (unsigned i = 0; i < table.length(); ++i) { | 81 for (unsigned i = 0; i < table.length(); ++i) { |
| 82 Address curr_address = code_start_address + table.GetPcOffset(i); | 82 Address curr_address = code_start_address + table.GetPcOffset(i); |
| 83 ASSERT_GE(curr_address - prev_address, patch_size()); | 83 ASSERT_GE(curr_address, prev_address); |
| 84 ZapCodeRange(prev_address, curr_address); | 84 ZapCodeRange(prev_address, curr_address); |
| 85 | 85 |
| 86 SafepointEntry safepoint_entry = table.GetEntry(i); | 86 SafepointEntry safepoint_entry = table.GetEntry(i); |
| 87 int deoptimization_index = safepoint_entry.deoptimization_index(); | 87 int deoptimization_index = safepoint_entry.deoptimization_index(); |
| 88 if (deoptimization_index != Safepoint::kNoDeoptimizationIndex) { | 88 if (deoptimization_index != Safepoint::kNoDeoptimizationIndex) { |
| 89 // The gap code is needed to get to the state expected at the bailout. | 89 // The gap code is needed to get to the state expected at the bailout. |
| 90 curr_address += safepoint_entry.gap_code_size(); | 90 curr_address += safepoint_entry.gap_code_size(); |
| 91 | 91 |
| 92 CodePatcher patcher(curr_address, patch_size()); | 92 CodePatcher patcher(curr_address, patch_size()); |
| 93 Address deopt_entry = GetDeoptimizationEntry(deoptimization_index, LAZY); | 93 Address deopt_entry = GetDeoptimizationEntry(deoptimization_index, LAZY); |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 } | 653 } |
| 654 __ bind(&done); | 654 __ bind(&done); |
| 655 } | 655 } |
| 656 | 656 |
| 657 #undef __ | 657 #undef __ |
| 658 | 658 |
| 659 | 659 |
| 660 } } // namespace v8::internal | 660 } } // namespace v8::internal |
| 661 | 661 |
| 662 #endif // V8_TARGET_ARCH_IA32 | 662 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |