| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 if (mode == UPDATE_WRITE_BARRIER && | 363 if (mode == UPDATE_WRITE_BARRIER && |
| 364 host() != NULL) { | 364 host() != NULL) { |
| 365 // TODO(1550) We are passing NULL as a slot because cell can never be on | 365 // TODO(1550) We are passing NULL as a slot because cell can never be on |
| 366 // evacuation candidate. | 366 // evacuation candidate. |
| 367 host()->GetHeap()->incremental_marking()->RecordWrite( | 367 host()->GetHeap()->incremental_marking()->RecordWrite( |
| 368 host(), NULL, cell); | 368 host(), NULL, cell); |
| 369 } | 369 } |
| 370 } | 370 } |
| 371 | 371 |
| 372 | 372 |
| 373 void RelocInfo::WipeOut() { |
| 374 if (IsEmbeddedObject(rmode_) || IsExternalReference(rmode_)) { |
| 375 Memory::Address_at(pc_) = NULL; |
| 376 } else if (IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)) { |
| 377 // Effectively write zero into the relocation. |
| 378 Assembler::set_target_address_at(pc_, pc_ + sizeof(int32_t)); |
| 379 } else { |
| 380 UNREACHABLE(); |
| 381 } |
| 382 } |
| 383 |
| 384 |
| 373 bool RelocInfo::IsPatchedReturnSequence() { | 385 bool RelocInfo::IsPatchedReturnSequence() { |
| 374 // The recognized call sequence is: | 386 // The recognized call sequence is: |
| 375 // movq(kScratchRegister, address); call(kScratchRegister); | 387 // movq(kScratchRegister, address); call(kScratchRegister); |
| 376 // It only needs to be distinguished from a return sequence | 388 // It only needs to be distinguished from a return sequence |
| 377 // movq(rsp, rbp); pop(rbp); ret(n); int3 *6 | 389 // movq(rsp, rbp); pop(rbp); ret(n); int3 *6 |
| 378 // The 11th byte is int3 (0xCC) in the return sequence and | 390 // The 11th byte is int3 (0xCC) in the return sequence and |
| 379 // REX.WB (0x48+register bit) for the call sequence. | 391 // REX.WB (0x48+register bit) for the call sequence. |
| 380 #ifdef ENABLE_DEBUGGER_SUPPORT | 392 #ifdef ENABLE_DEBUGGER_SUPPORT |
| 381 return pc_[Assembler::kMoveAddressIntoScratchRegisterInstructionLength] != | 393 return pc_[Assembler::kMoveAddressIntoScratchRegisterInstructionLength] != |
| 382 0xCC; | 394 0xCC; |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 ASSERT(len_ == 1 || len_ == 2); | 557 ASSERT(len_ == 1 || len_ == 2); |
| 546 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); | 558 int32_t* p = reinterpret_cast<int32_t*>(&buf_[len_]); |
| 547 *p = disp; | 559 *p = disp; |
| 548 len_ += sizeof(int32_t); | 560 len_ += sizeof(int32_t); |
| 549 } | 561 } |
| 550 | 562 |
| 551 | 563 |
| 552 } } // namespace v8::internal | 564 } } // namespace v8::internal |
| 553 | 565 |
| 554 #endif // V8_X64_ASSEMBLER_X64_INL_H_ | 566 #endif // V8_X64_ASSEMBLER_X64_INL_H_ |
| OLD | NEW |