| 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // cmp rsp, <limit> ;; Not changed | 131 // cmp rsp, <limit> ;; Not changed |
| 132 // nop | 132 // nop |
| 133 // nop | 133 // nop |
| 134 // call <on-stack replacment> | 134 // call <on-stack replacment> |
| 135 // test rax, <loop nesting depth> | 135 // test rax, <loop nesting depth> |
| 136 // ok: | 136 // ok: |
| 137 // | 137 // |
| 138 ASSERT(*(call_target_address - 3) == 0x73 && // jae | 138 ASSERT(*(call_target_address - 3) == 0x73 && // jae |
| 139 *(call_target_address - 2) == 0x07 && // offset | 139 *(call_target_address - 2) == 0x07 && // offset |
| 140 *(call_target_address - 1) == 0xe8); // call | 140 *(call_target_address - 1) == 0xe8); // call |
| 141 *(call_target_address - 3) = 0x90; // nop | 141 *(call_target_address - 3) = 0x66; // 2 byte nop part 1 |
| 142 *(call_target_address - 2) = 0x90; // nop | 142 *(call_target_address - 2) = 0x90; // 2 byte nop part 2 |
| 143 Assembler::set_target_address_at(call_target_address, | 143 Assembler::set_target_address_at(call_target_address, |
| 144 replacement_code->entry()); | 144 replacement_code->entry()); |
| 145 | 145 |
| 146 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( | 146 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
| 147 unoptimized_code, call_target_address, replacement_code); | 147 unoptimized_code, call_target_address, replacement_code); |
| 148 } | 148 } |
| 149 | 149 |
| 150 | 150 |
| 151 void Deoptimizer::RevertStackCheckCodeAt(Code* unoptimized_code, | 151 void Deoptimizer::RevertStackCheckCodeAt(Code* unoptimized_code, |
| 152 Address pc_after, | 152 Address pc_after, |
| 153 Code* check_code, | 153 Code* check_code, |
| 154 Code* replacement_code) { | 154 Code* replacement_code) { |
| 155 Address call_target_address = pc_after - kIntSize; | 155 Address call_target_address = pc_after - kIntSize; |
| 156 ASSERT(replacement_code->entry() == | 156 ASSERT(replacement_code->entry() == |
| 157 Assembler::target_address_at(call_target_address)); | 157 Assembler::target_address_at(call_target_address)); |
| 158 // Replace the nops from patching (Deoptimizer::PatchStackCheckCode) to | 158 // Replace the nops from patching (Deoptimizer::PatchStackCheckCode) to |
| 159 // restore the conditional branch. | 159 // restore the conditional branch. |
| 160 ASSERT(*(call_target_address - 3) == 0x90 && // nop | 160 ASSERT(*(call_target_address - 3) == 0x66 && // 2 byte nop part 1 |
| 161 *(call_target_address - 2) == 0x90 && // nop | 161 *(call_target_address - 2) == 0x90 && // 2 byte nop part 2 |
| 162 *(call_target_address - 1) == 0xe8); // call | 162 *(call_target_address - 1) == 0xe8); // call |
| 163 *(call_target_address - 3) = 0x73; // jae | 163 *(call_target_address - 3) = 0x73; // jae |
| 164 *(call_target_address - 2) = 0x07; // offset | 164 *(call_target_address - 2) = 0x07; // offset |
| 165 Assembler::set_target_address_at(call_target_address, | 165 Assembler::set_target_address_at(call_target_address, |
| 166 check_code->entry()); | 166 check_code->entry()); |
| 167 | 167 |
| 168 check_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( | 168 check_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
| 169 unoptimized_code, call_target_address, check_code); | 169 unoptimized_code, call_target_address, check_code); |
| 170 } | 170 } |
| 171 | 171 |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 } | 743 } |
| 744 __ bind(&done); | 744 __ bind(&done); |
| 745 } | 745 } |
| 746 | 746 |
| 747 #undef __ | 747 #undef __ |
| 748 | 748 |
| 749 | 749 |
| 750 } } // namespace v8::internal | 750 } } // namespace v8::internal |
| 751 | 751 |
| 752 #endif // V8_TARGET_ARCH_X64 | 752 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |