| 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 are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 242 } |
| 243 | 243 |
| 244 | 244 |
| 245 Object** RelocInfo::call_object_address() { | 245 Object** RelocInfo::call_object_address() { |
| 246 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || | 246 ASSERT((IsJSReturn(rmode()) && IsPatchedReturnSequence()) || |
| 247 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); | 247 (IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence())); |
| 248 return reinterpret_cast<Object**>(pc_ + 1); | 248 return reinterpret_cast<Object**>(pc_ + 1); |
| 249 } | 249 } |
| 250 | 250 |
| 251 | 251 |
| 252 void RelocInfo::WipeOut() { |
| 253 if (IsEmbeddedObject(rmode_) || IsExternalReference(rmode_)) { |
| 254 Memory::Address_at(pc_) = NULL; |
| 255 } else if (IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_)) { |
| 256 // Effectively write zero into the relocation. |
| 257 Assembler::set_target_address_at(pc_, pc_ + sizeof(int32_t)); |
| 258 } else { |
| 259 UNREACHABLE(); |
| 260 } |
| 261 } |
| 262 |
| 263 |
| 252 bool RelocInfo::IsPatchedReturnSequence() { | 264 bool RelocInfo::IsPatchedReturnSequence() { |
| 253 return *pc_ == kCallOpcode; | 265 return *pc_ == kCallOpcode; |
| 254 } | 266 } |
| 255 | 267 |
| 256 | 268 |
| 257 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { | 269 bool RelocInfo::IsPatchedDebugBreakSlotSequence() { |
| 258 return !Assembler::IsNop(pc()); | 270 return !Assembler::IsNop(pc()); |
| 259 } | 271 } |
| 260 | 272 |
| 261 | 273 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 | 536 |
| 525 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { | 537 Operand::Operand(int32_t disp, RelocInfo::Mode rmode) { |
| 526 // [disp/r] | 538 // [disp/r] |
| 527 set_modrm(0, ebp); | 539 set_modrm(0, ebp); |
| 528 set_dispr(disp, rmode); | 540 set_dispr(disp, rmode); |
| 529 } | 541 } |
| 530 | 542 |
| 531 } } // namespace v8::internal | 543 } } // namespace v8::internal |
| 532 | 544 |
| 533 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ | 545 #endif // V8_IA32_ASSEMBLER_IA32_INL_H_ |
| OLD | NEW |