| OLD | NEW |
| 1 | 1 |
| 2 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 2 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
| 3 // All Rights Reserved. | 3 // All Rights Reserved. |
| 4 // | 4 // |
| 5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
| 6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
| 7 // met: | 7 // met: |
| 8 // | 8 // |
| 9 // - Redistributions of source code must retain the above copyright notice, | 9 // - Redistributions of source code must retain the above copyright notice, |
| 10 // this list of conditions and the following disclaimer. | 10 // this list of conditions and the following disclaimer. |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 if (IsInternalReference(rmode_)) { | 340 if (IsInternalReference(rmode_)) { |
| 341 Memory::Address_at(pc_) = NULL; | 341 Memory::Address_at(pc_) = NULL; |
| 342 } else if (IsInternalReferenceEncoded(rmode_)) { | 342 } else if (IsInternalReferenceEncoded(rmode_)) { |
| 343 Assembler::set_target_internal_reference_encoded_at(pc_, nullptr); | 343 Assembler::set_target_internal_reference_encoded_at(pc_, nullptr); |
| 344 } else { | 344 } else { |
| 345 Assembler::set_target_address_at(isolate_, pc_, host_, NULL); | 345 Assembler::set_target_address_at(isolate_, pc_, host_, NULL); |
| 346 } | 346 } |
| 347 } | 347 } |
| 348 | 348 |
| 349 | 349 |
| 350 bool RelocInfo::IsPatchedReturnSequence() { | |
| 351 Instr instr0 = Assembler::instr_at(pc_); // lui. | |
| 352 Instr instr1 = Assembler::instr_at(pc_ + 1 * Assembler::kInstrSize); // ori. | |
| 353 Instr instr2 = Assembler::instr_at(pc_ + 2 * Assembler::kInstrSize); // dsll. | |
| 354 Instr instr3 = Assembler::instr_at(pc_ + 3 * Assembler::kInstrSize); // ori. | |
| 355 Instr instr4 = Assembler::instr_at(pc_ + 4 * Assembler::kInstrSize); // jalr. | |
| 356 | |
| 357 bool patched_return = ((instr0 & kOpcodeMask) == LUI && | |
| 358 (instr1 & kOpcodeMask) == ORI && | |
| 359 (instr2 & kFunctionFieldMask) == DSLL && | |
| 360 (instr3 & kOpcodeMask) == ORI && | |
| 361 (instr4 & kFunctionFieldMask) == JALR); | |
| 362 return patched_return; | |
| 363 } | |
| 364 | |
| 365 | |
| 366 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { | |
| 367 Instr current_instr = Assembler::instr_at(pc_); | |
| 368 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); | |
| 369 } | |
| 370 | |
| 371 | |
| 372 void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { | 350 void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { |
| 373 RelocInfo::Mode mode = rmode(); | 351 RelocInfo::Mode mode = rmode(); |
| 374 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 352 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 375 visitor->VisitEmbeddedPointer(this); | 353 visitor->VisitEmbeddedPointer(this); |
| 376 } else if (RelocInfo::IsCodeTarget(mode)) { | 354 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 377 visitor->VisitCodeTarget(this); | 355 visitor->VisitCodeTarget(this); |
| 378 } else if (mode == RelocInfo::CELL) { | 356 } else if (mode == RelocInfo::CELL) { |
| 379 visitor->VisitCell(this); | 357 visitor->VisitCell(this); |
| 380 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 358 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
| 381 visitor->VisitExternalReference(this); | 359 visitor->VisitExternalReference(this); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 void Assembler::emit(uint64_t data) { | 467 void Assembler::emit(uint64_t data) { |
| 490 CheckForEmitInForbiddenSlot(); | 468 CheckForEmitInForbiddenSlot(); |
| 491 EmitHelper(data); | 469 EmitHelper(data); |
| 492 } | 470 } |
| 493 | 471 |
| 494 | 472 |
| 495 } // namespace internal | 473 } // namespace internal |
| 496 } // namespace v8 | 474 } // namespace v8 |
| 497 | 475 |
| 498 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ | 476 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ |
| OLD | NEW |