| 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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 // ok: | 251 // ok: |
| 252 // | 252 // |
| 253 ASSERT(*(call_target_address - 3) == 0x73 && // jae | 253 ASSERT(*(call_target_address - 3) == 0x73 && // jae |
| 254 *(call_target_address - 2) == 0x07 && // offset | 254 *(call_target_address - 2) == 0x07 && // offset |
| 255 *(call_target_address - 1) == 0xe8); // call | 255 *(call_target_address - 1) == 0xe8); // call |
| 256 *(call_target_address - 3) = 0x90; // nop | 256 *(call_target_address - 3) = 0x90; // nop |
| 257 *(call_target_address - 2) = 0x90; // nop | 257 *(call_target_address - 2) = 0x90; // nop |
| 258 Assembler::set_target_address_at(call_target_address, | 258 Assembler::set_target_address_at(call_target_address, |
| 259 replacement_code->entry()); | 259 replacement_code->entry()); |
| 260 | 260 |
| 261 RelocInfo rinfo(call_target_address, | 261 unoptimized_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
| 262 RelocInfo::CODE_TARGET, | 262 unoptimized_code, call_target_address, replacement_code); |
| 263 0, | |
| 264 unoptimized_code); | |
| 265 unoptimized_code->GetHeap()->incremental_marking()->RecordWriteIntoCode( | |
| 266 unoptimized_code, &rinfo, replacement_code); | |
| 267 } | 263 } |
| 268 | 264 |
| 269 | 265 |
| 270 void Deoptimizer::RevertStackCheckCodeAt(Address pc_after, | 266 void Deoptimizer::RevertStackCheckCodeAt(Code* unoptimized_code, |
| 267 Address pc_after, |
| 271 Code* check_code, | 268 Code* check_code, |
| 272 Code* replacement_code) { | 269 Code* replacement_code) { |
| 273 Address call_target_address = pc_after - kIntSize; | 270 Address call_target_address = pc_after - kIntSize; |
| 274 ASSERT(replacement_code->entry() == | 271 ASSERT(replacement_code->entry() == |
| 275 Assembler::target_address_at(call_target_address)); | 272 Assembler::target_address_at(call_target_address)); |
| 276 // Replace the nops from patching (Deoptimizer::PatchStackCheckCode) to | 273 // Replace the nops from patching (Deoptimizer::PatchStackCheckCode) to |
| 277 // restore the conditional branch. | 274 // restore the conditional branch. |
| 278 ASSERT(*(call_target_address - 3) == 0x90 && // nop | 275 ASSERT(*(call_target_address - 3) == 0x90 && // nop |
| 279 *(call_target_address - 2) == 0x90 && // nop | 276 *(call_target_address - 2) == 0x90 && // nop |
| 280 *(call_target_address - 1) == 0xe8); // call | 277 *(call_target_address - 1) == 0xe8); // call |
| 281 *(call_target_address - 3) = 0x73; // jae | 278 *(call_target_address - 3) = 0x73; // jae |
| 282 *(call_target_address - 2) = 0x07; // offset | 279 *(call_target_address - 2) = 0x07; // offset |
| 283 Assembler::set_target_address_at(call_target_address, | 280 Assembler::set_target_address_at(call_target_address, |
| 284 check_code->entry()); | 281 check_code->entry()); |
| 285 check_code->GetHeap()->incremental_marking()-> | 282 |
| 286 RecordCodeTargetPatch(call_target_address, check_code); | 283 check_code->GetHeap()->incremental_marking()->RecordCodeTargetPatch( |
| 284 unoptimized_code, call_target_address, check_code); |
| 287 } | 285 } |
| 288 | 286 |
| 289 | 287 |
| 290 static int LookupBailoutId(DeoptimizationInputData* data, unsigned ast_id) { | 288 static int LookupBailoutId(DeoptimizationInputData* data, unsigned ast_id) { |
| 291 ByteArray* translations = data->TranslationByteArray(); | 289 ByteArray* translations = data->TranslationByteArray(); |
| 292 int length = data->DeoptCount(); | 290 int length = data->DeoptCount(); |
| 293 for (int i = 0; i < length; i++) { | 291 for (int i = 0; i < length; i++) { |
| 294 if (static_cast<unsigned>(data->AstId(i)->value()) == ast_id) { | 292 if (static_cast<unsigned>(data->AstId(i)->value()) == ast_id) { |
| 295 TranslationIterator it(translations, data->TranslationIndex(i)->value()); | 293 TranslationIterator it(translations, data->TranslationIndex(i)->value()); |
| 296 int value = it.Next(); | 294 int value = it.Next(); |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 } | 858 } |
| 861 __ bind(&done); | 859 __ bind(&done); |
| 862 } | 860 } |
| 863 | 861 |
| 864 #undef __ | 862 #undef __ |
| 865 | 863 |
| 866 | 864 |
| 867 } } // namespace v8::internal | 865 } } // namespace v8::internal |
| 868 | 866 |
| 869 #endif // V8_TARGET_ARCH_X64 | 867 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |