| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 // | 224 // |
| 225 // cmp esp, <limit> ;; Not changed | 225 // cmp esp, <limit> ;; Not changed |
| 226 // nop | 226 // nop |
| 227 // nop | 227 // nop |
| 228 // call <on-stack replacment> | 228 // call <on-stack replacment> |
| 229 // test eax, <loop nesting depth> | 229 // test eax, <loop nesting depth> |
| 230 // ok: | 230 // ok: |
| 231 ASSERT(*(call_target_address - 3) == 0x73 && // jae | 231 ASSERT(*(call_target_address - 3) == 0x73 && // jae |
| 232 *(call_target_address - 2) == 0x07 && // offset | 232 *(call_target_address - 2) == 0x07 && // offset |
| 233 *(call_target_address - 1) == 0xe8); // call | 233 *(call_target_address - 1) == 0xe8); // call |
| 234 *(call_target_address - 3) = 0x90; // nop | 234 *(call_target_address - 3) = 0x66; // 2 byte nop part 1 |
| 235 *(call_target_address - 2) = 0x90; // nop | 235 *(call_target_address - 2) = 0x90; // 2 byte nop part 2 |
| 236 Assembler::set_target_address_at(call_target_address, | 236 Assembler::set_target_address_at(call_target_address, |
| 237 replacement_code->entry()); | 237 replacement_code->entry()); |
| 238 | 238 |
| 239 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( | 239 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
| 240 unoptimized_code, call_target_address, replacement_code); | 240 unoptimized_code, call_target_address, replacement_code); |
| 241 } | 241 } |
| 242 | 242 |
| 243 | 243 |
| 244 void Deoptimizer::RevertStackCheckCodeAt(Code* unoptimized_code, | 244 void Deoptimizer::RevertStackCheckCodeAt(Code* unoptimized_code, |
| 245 Address pc_after, | 245 Address pc_after, |
| 246 Code* check_code, | 246 Code* check_code, |
| 247 Code* replacement_code) { | 247 Code* replacement_code) { |
| 248 Address call_target_address = pc_after - kIntSize; | 248 Address call_target_address = pc_after - kIntSize; |
| 249 ASSERT(replacement_code->entry() == | 249 ASSERT(replacement_code->entry() == |
| 250 Assembler::target_address_at(call_target_address)); | 250 Assembler::target_address_at(call_target_address)); |
| 251 // Replace the nops from patching (Deoptimizer::PatchStackCheckCode) to | 251 // Replace the nops from patching (Deoptimizer::PatchStackCheckCode) to |
| 252 // restore the conditional branch. | 252 // restore the conditional branch. |
| 253 ASSERT(*(call_target_address - 3) == 0x90 && // nop | 253 ASSERT(*(call_target_address - 3) == 0x66 && // 2 byte nop part 1 |
| 254 *(call_target_address - 2) == 0x90 && // nop | 254 *(call_target_address - 2) == 0x90 && // 2 byte nop part 2 |
| 255 *(call_target_address - 1) == 0xe8); // call | 255 *(call_target_address - 1) == 0xe8); // call |
| 256 *(call_target_address - 3) = 0x73; // jae | 256 *(call_target_address - 3) = 0x73; // jae |
| 257 *(call_target_address - 2) = 0x07; // offset | 257 *(call_target_address - 2) = 0x07; // offset |
| 258 Assembler::set_target_address_at(call_target_address, | 258 Assembler::set_target_address_at(call_target_address, |
| 259 check_code->entry()); | 259 check_code->entry()); |
| 260 | 260 |
| 261 check_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( | 261 check_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
| 262 unoptimized_code, call_target_address, check_code); | 262 unoptimized_code, call_target_address, check_code); |
| 263 } | 263 } |
| 264 | 264 |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 821 } | 821 } |
| 822 __ bind(&done); | 822 __ bind(&done); |
| 823 } | 823 } |
| 824 | 824 |
| 825 #undef __ | 825 #undef __ |
| 826 | 826 |
| 827 | 827 |
| 828 } } // namespace v8::internal | 828 } } // namespace v8::internal |
| 829 | 829 |
| 830 #endif // V8_TARGET_ARCH_IA32 | 830 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |