OLD | NEW |
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions | 5 // modification, are permitted provided that the following conditions |
6 // are met: | 6 // are met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 // mov sequence | 321 // mov sequence |
322 // Currently used only by deserializer, no need to flush. | 322 // Currently used only by deserializer, no need to flush. |
323 Assembler::set_target_address_at(isolate_, pc_, host_, NULL, | 323 Assembler::set_target_address_at(isolate_, pc_, host_, NULL, |
324 SKIP_ICACHE_FLUSH); | 324 SKIP_ICACHE_FLUSH); |
325 } else { | 325 } else { |
326 Assembler::set_target_address_at(isolate_, pc_, host_, NULL); | 326 Assembler::set_target_address_at(isolate_, pc_, host_, NULL); |
327 } | 327 } |
328 } | 328 } |
329 | 329 |
330 | 330 |
331 bool RelocInfo::IsPatchedReturnSequence() { | |
332 // | |
333 // The patched return sequence is defined by | |
334 // BreakLocation::SetDebugBreakAtReturn() | |
335 // FIXED_SEQUENCE | |
336 | |
337 Instr instr0 = Assembler::instr_at(pc_); | |
338 Instr instr1 = Assembler::instr_at(pc_ + 1 * Assembler::kInstrSize); | |
339 #if V8_TARGET_ARCH_PPC64 | |
340 Instr instr3 = Assembler::instr_at(pc_ + (3 * Assembler::kInstrSize)); | |
341 Instr instr4 = Assembler::instr_at(pc_ + (4 * Assembler::kInstrSize)); | |
342 Instr binstr = Assembler::instr_at(pc_ + (7 * Assembler::kInstrSize)); | |
343 #else | |
344 Instr binstr = Assembler::instr_at(pc_ + 4 * Assembler::kInstrSize); | |
345 #endif | |
346 bool patched_return = | |
347 ((instr0 & kOpcodeMask) == ADDIS && (instr1 & kOpcodeMask) == ORI && | |
348 #if V8_TARGET_ARCH_PPC64 | |
349 (instr3 & kOpcodeMask) == ORIS && (instr4 & kOpcodeMask) == ORI && | |
350 #endif | |
351 (binstr == 0x7d821008)); // twge r2, r2 | |
352 | |
353 // printf("IsPatchedReturnSequence: %d\n", patched_return); | |
354 return patched_return; | |
355 } | |
356 | |
357 | |
358 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { | |
359 Instr current_instr = Assembler::instr_at(pc_); | |
360 return !Assembler::IsNop(current_instr, Assembler::DEBUG_BREAK_NOP); | |
361 } | |
362 | |
363 | |
364 void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { | 331 void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { |
365 RelocInfo::Mode mode = rmode(); | 332 RelocInfo::Mode mode = rmode(); |
366 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 333 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
367 visitor->VisitEmbeddedPointer(this); | 334 visitor->VisitEmbeddedPointer(this); |
368 } else if (RelocInfo::IsCodeTarget(mode)) { | 335 } else if (RelocInfo::IsCodeTarget(mode)) { |
369 visitor->VisitCodeTarget(this); | 336 visitor->VisitCodeTarget(this); |
370 } else if (mode == RelocInfo::CELL) { | 337 } else if (mode == RelocInfo::CELL) { |
371 visitor->VisitCell(this); | 338 visitor->VisitCell(this); |
372 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { | 339 } else if (mode == RelocInfo::EXTERNAL_REFERENCE) { |
373 visitor->VisitExternalReference(this); | 340 visitor->VisitExternalReference(this); |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
719 } | 686 } |
720 #endif | 687 #endif |
721 return; | 688 return; |
722 } | 689 } |
723 UNREACHABLE(); | 690 UNREACHABLE(); |
724 } | 691 } |
725 } // namespace internal | 692 } // namespace internal |
726 } // namespace v8 | 693 } // namespace v8 |
727 | 694 |
728 #endif // V8_PPC_ASSEMBLER_PPC_INL_H_ | 695 #endif // V8_PPC_ASSEMBLER_PPC_INL_H_ |
OLD | NEW |