| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) { | 205 Handle<HeapObject> RelocInfo::target_object_handle(Assembler* origin) { |
| 206 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 206 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 207 return Handle<HeapObject>( | 207 return Handle<HeapObject>( |
| 208 reinterpret_cast<HeapObject**>(Assembler::target_address_at(pc_, host_))); | 208 reinterpret_cast<HeapObject**>(Assembler::target_address_at(pc_, host_))); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void RelocInfo::set_target_object(HeapObject* target, | 211 void RelocInfo::set_target_object(HeapObject* target, |
| 212 WriteBarrierMode write_barrier_mode, | 212 WriteBarrierMode write_barrier_mode, |
| 213 ICacheFlushMode icache_flush_mode) { | 213 ICacheFlushMode icache_flush_mode) { |
| 214 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); | 214 DCHECK(IsCodeTarget(rmode_) || rmode_ == EMBEDDED_OBJECT); |
| 215 Assembler::set_target_address_at(isolate_, pc_, host_, | 215 Assembler::set_target_address_at(target->GetIsolate(), pc_, host_, |
| 216 reinterpret_cast<Address>(target), | 216 reinterpret_cast<Address>(target), |
| 217 icache_flush_mode); | 217 icache_flush_mode); |
| 218 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL) { | 218 if (write_barrier_mode == UPDATE_WRITE_BARRIER && host() != NULL) { |
| 219 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( | 219 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode( |
| 220 host(), this, HeapObject::cast(target)); | 220 host(), this, HeapObject::cast(target)); |
| 221 host()->GetHeap()->RecordWriteIntoCode(host(), this, target); | 221 host()->GetHeap()->RecordWriteIntoCode(host(), this, target); |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 | 224 |
| 225 | 225 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 255 DCHECK(rmode_ == INTERNAL_REFERENCE || rmode_ == INTERNAL_REFERENCE_ENCODED); | 255 DCHECK(rmode_ == INTERNAL_REFERENCE || rmode_ == INTERNAL_REFERENCE_ENCODED); |
| 256 return reinterpret_cast<Address>(pc_); | 256 return reinterpret_cast<Address>(pc_); |
| 257 } | 257 } |
| 258 | 258 |
| 259 | 259 |
| 260 Address RelocInfo::target_runtime_entry(Assembler* origin) { | 260 Address RelocInfo::target_runtime_entry(Assembler* origin) { |
| 261 DCHECK(IsRuntimeEntry(rmode_)); | 261 DCHECK(IsRuntimeEntry(rmode_)); |
| 262 return target_address(); | 262 return target_address(); |
| 263 } | 263 } |
| 264 | 264 |
| 265 | 265 void RelocInfo::set_target_runtime_entry(Isolate* isolate, Address target, |
| 266 void RelocInfo::set_target_runtime_entry(Address target, | |
| 267 WriteBarrierMode write_barrier_mode, | 266 WriteBarrierMode write_barrier_mode, |
| 268 ICacheFlushMode icache_flush_mode) { | 267 ICacheFlushMode icache_flush_mode) { |
| 269 DCHECK(IsRuntimeEntry(rmode_)); | 268 DCHECK(IsRuntimeEntry(rmode_)); |
| 270 if (target_address() != target) | 269 if (target_address() != target) |
| 271 set_target_address(target, write_barrier_mode, icache_flush_mode); | 270 set_target_address(isolate, target, write_barrier_mode, icache_flush_mode); |
| 272 } | 271 } |
| 273 | 272 |
| 274 | 273 |
| 275 Handle<Cell> RelocInfo::target_cell_handle() { | 274 Handle<Cell> RelocInfo::target_cell_handle() { |
| 276 DCHECK(rmode_ == RelocInfo::CELL); | 275 DCHECK(rmode_ == RelocInfo::CELL); |
| 277 Address address = Memory::Address_at(pc_); | 276 Address address = Memory::Address_at(pc_); |
| 278 return Handle<Cell>(reinterpret_cast<Cell**>(address)); | 277 return Handle<Cell>(reinterpret_cast<Cell**>(address)); |
| 279 } | 278 } |
| 280 | 279 |
| 281 | 280 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 309 Code* RelocInfo::code_age_stub() { | 308 Code* RelocInfo::code_age_stub() { |
| 310 DCHECK(rmode_ == RelocInfo::CODE_AGE_SEQUENCE); | 309 DCHECK(rmode_ == RelocInfo::CODE_AGE_SEQUENCE); |
| 311 return Code::GetCodeFromTargetAddress( | 310 return Code::GetCodeFromTargetAddress( |
| 312 Assembler::target_address_at(pc_ + Assembler::kInstrSize, host_)); | 311 Assembler::target_address_at(pc_ + Assembler::kInstrSize, host_)); |
| 313 } | 312 } |
| 314 | 313 |
| 315 | 314 |
| 316 void RelocInfo::set_code_age_stub(Code* stub, | 315 void RelocInfo::set_code_age_stub(Code* stub, |
| 317 ICacheFlushMode icache_flush_mode) { | 316 ICacheFlushMode icache_flush_mode) { |
| 318 DCHECK(rmode_ == RelocInfo::CODE_AGE_SEQUENCE); | 317 DCHECK(rmode_ == RelocInfo::CODE_AGE_SEQUENCE); |
| 319 Assembler::set_target_address_at(isolate_, pc_ + Assembler::kInstrSize, host_, | 318 Assembler::set_target_address_at(stub->GetIsolate(), |
| 319 pc_ + Assembler::kInstrSize, host_, |
| 320 stub->instruction_start()); | 320 stub->instruction_start()); |
| 321 } | 321 } |
| 322 | 322 |
| 323 | 323 |
| 324 Address RelocInfo::debug_call_address() { | 324 Address RelocInfo::debug_call_address() { |
| 325 // The pc_ offset of 0 assumes patched debug break slot or return | 325 // The pc_ offset of 0 assumes patched debug break slot or return |
| 326 // sequence. | 326 // sequence. |
| 327 DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()); | 327 DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()); |
| 328 return Assembler::target_address_at(pc_, host_); | 328 return Assembler::target_address_at(pc_, host_); |
| 329 } | 329 } |
| 330 | 330 |
| 331 | 331 void RelocInfo::set_debug_call_address(Isolate* isolate, Address target) { |
| 332 void RelocInfo::set_debug_call_address(Address target) { | |
| 333 DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()); | 332 DCHECK(IsDebugBreakSlot(rmode()) && IsPatchedDebugBreakSlotSequence()); |
| 334 // The pc_ offset of 0 assumes patched debug break slot or return | 333 // The pc_ offset of 0 assumes patched debug break slot or return |
| 335 // sequence. | 334 // sequence. |
| 336 Assembler::set_target_address_at(isolate_, pc_, host_, target); | 335 Assembler::set_target_address_at(isolate, pc_, host_, target); |
| 337 if (host() != NULL) { | 336 if (host() != NULL) { |
| 338 Code* target_code = Code::GetCodeFromTargetAddress(target); | 337 Code* target_code = Code::GetCodeFromTargetAddress(target); |
| 339 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this, | 338 host()->GetHeap()->incremental_marking()->RecordWriteIntoCode(host(), this, |
| 340 target_code); | 339 target_code); |
| 341 } | 340 } |
| 342 } | 341 } |
| 343 | 342 |
| 344 | 343 void RelocInfo::WipeOut(Isolate* isolate) { |
| 345 void RelocInfo::WipeOut() { | |
| 346 DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) || | 344 DCHECK(IsEmbeddedObject(rmode_) || IsCodeTarget(rmode_) || |
| 347 IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) || | 345 IsRuntimeEntry(rmode_) || IsExternalReference(rmode_) || |
| 348 IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_)); | 346 IsInternalReference(rmode_) || IsInternalReferenceEncoded(rmode_)); |
| 349 if (IsInternalReference(rmode_)) { | 347 if (IsInternalReference(rmode_)) { |
| 350 Memory::Address_at(pc_) = NULL; | 348 Memory::Address_at(pc_) = NULL; |
| 351 } else if (IsInternalReferenceEncoded(rmode_)) { | 349 } else if (IsInternalReferenceEncoded(rmode_)) { |
| 352 Assembler::set_target_internal_reference_encoded_at(pc_, nullptr); | 350 Assembler::set_target_internal_reference_encoded_at(pc_, nullptr); |
| 353 } else { | 351 } else { |
| 354 Assembler::set_target_address_at(isolate_, pc_, host_, NULL); | 352 Assembler::set_target_address_at(isolate, pc_, host_, NULL); |
| 355 } | 353 } |
| 356 } | 354 } |
| 357 | 355 |
| 358 template <typename ObjectVisitor> | 356 template <typename ObjectVisitor> |
| 359 void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { | 357 void RelocInfo::Visit(Isolate* isolate, ObjectVisitor* visitor) { |
| 360 RelocInfo::Mode mode = rmode(); | 358 RelocInfo::Mode mode = rmode(); |
| 361 if (mode == RelocInfo::EMBEDDED_OBJECT) { | 359 if (mode == RelocInfo::EMBEDDED_OBJECT) { |
| 362 visitor->VisitEmbeddedPointer(this); | 360 visitor->VisitEmbeddedPointer(this); |
| 363 } else if (RelocInfo::IsCodeTarget(mode)) { | 361 } else if (RelocInfo::IsCodeTarget(mode)) { |
| 364 visitor->VisitCodeTarget(this); | 362 visitor->VisitCodeTarget(this); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 CheckBuffer(); | 478 CheckBuffer(); |
| 481 } | 479 } |
| 482 EmitHelper(x, is_compact_branch); | 480 EmitHelper(x, is_compact_branch); |
| 483 } | 481 } |
| 484 | 482 |
| 485 | 483 |
| 486 } // namespace internal | 484 } // namespace internal |
| 487 } // namespace v8 | 485 } // namespace v8 |
| 488 | 486 |
| 489 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ | 487 #endif // V8_MIPS_ASSEMBLER_MIPS_INL_H_ |
| OLD | NEW |