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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 // test eax, <loop nesting depth> | 245 // test eax, <loop nesting depth> |
246 // ok: | 246 // ok: |
247 ASSERT(*(call_target_address - 3) == 0x73 && // jae | 247 ASSERT(*(call_target_address - 3) == 0x73 && // jae |
248 *(call_target_address - 2) == 0x07 && // offset | 248 *(call_target_address - 2) == 0x07 && // offset |
249 *(call_target_address - 1) == 0xe8); // call | 249 *(call_target_address - 1) == 0xe8); // call |
250 *(call_target_address - 3) = 0x90; // nop | 250 *(call_target_address - 3) = 0x90; // nop |
251 *(call_target_address - 2) = 0x90; // nop | 251 *(call_target_address - 2) = 0x90; // nop |
252 Assembler::set_target_address_at(call_target_address, | 252 Assembler::set_target_address_at(call_target_address, |
253 replacement_code->entry()); | 253 replacement_code->entry()); |
254 | 254 |
255 // TODO(1550) We are passing NULL as a slot because code can never be on | 255 RelocInfo rinfo(call_target_address, |
256 // evacuation candidate. | 256 RelocInfo::CODE_TARGET, |
257 unoptimized_code->GetHeap()->incremental_marking()->RecordWrite( | 257 NULL, |
258 unoptimized_code, NULL, replacement_code); | 258 unoptimized_code); |
| 259 unoptimized_code->GetHeap()->incremental_marking()->RecordWriteIntoCode( |
| 260 unoptimized_code, &rinfo, replacement_code); |
259 } | 261 } |
260 | 262 |
261 | 263 |
262 void Deoptimizer::RevertStackCheckCodeAt(Address pc_after, | 264 void Deoptimizer::RevertStackCheckCodeAt(Address pc_after, |
263 Code* check_code, | 265 Code* check_code, |
264 Code* replacement_code) { | 266 Code* replacement_code) { |
265 Address call_target_address = pc_after - kIntSize; | 267 Address call_target_address = pc_after - kIntSize; |
266 ASSERT(replacement_code->entry() == | 268 ASSERT(replacement_code->entry() == |
267 Assembler::target_address_at(call_target_address)); | 269 Assembler::target_address_at(call_target_address)); |
268 // Replace the nops from patching (Deoptimizer::PatchStackCheckCode) to | 270 // Replace the nops from patching (Deoptimizer::PatchStackCheckCode) to |
269 // restore the conditional branch. | 271 // restore the conditional branch. |
270 ASSERT(*(call_target_address - 3) == 0x90 && // nop | 272 ASSERT(*(call_target_address - 3) == 0x90 && // nop |
271 *(call_target_address - 2) == 0x90 && // nop | 273 *(call_target_address - 2) == 0x90 && // nop |
272 *(call_target_address - 1) == 0xe8); // call | 274 *(call_target_address - 1) == 0xe8); // call |
273 *(call_target_address - 3) = 0x73; // jae | 275 *(call_target_address - 3) = 0x73; // jae |
274 *(call_target_address - 2) = 0x07; // offset | 276 *(call_target_address - 2) = 0x07; // offset |
275 Assembler::set_target_address_at(call_target_address, | 277 Assembler::set_target_address_at(call_target_address, |
276 check_code->entry()); | 278 check_code->entry()); |
277 check_code->GetHeap()->incremental_marking()->RecordWriteOf(check_code); | 279 |
| 280 check_code->GetHeap()->incremental_marking()-> |
| 281 RecordCodeTargetPatch(call_target_address, check_code); |
278 } | 282 } |
279 | 283 |
280 | 284 |
281 static int LookupBailoutId(DeoptimizationInputData* data, unsigned ast_id) { | 285 static int LookupBailoutId(DeoptimizationInputData* data, unsigned ast_id) { |
282 ByteArray* translations = data->TranslationByteArray(); | 286 ByteArray* translations = data->TranslationByteArray(); |
283 int length = data->DeoptCount(); | 287 int length = data->DeoptCount(); |
284 for (int i = 0; i < length; i++) { | 288 for (int i = 0; i < length; i++) { |
285 if (static_cast<unsigned>(data->AstId(i)->value()) == ast_id) { | 289 if (static_cast<unsigned>(data->AstId(i)->value()) == ast_id) { |
286 TranslationIterator it(translations, data->TranslationIndex(i)->value()); | 290 TranslationIterator it(translations, data->TranslationIndex(i)->value()); |
287 int value = it.Next(); | 291 int value = it.Next(); |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 } | 801 } |
798 __ bind(&done); | 802 __ bind(&done); |
799 } | 803 } |
800 | 804 |
801 #undef __ | 805 #undef __ |
802 | 806 |
803 | 807 |
804 } } // namespace v8::internal | 808 } } // namespace v8::internal |
805 | 809 |
806 #endif // V8_TARGET_ARCH_IA32 | 810 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |