| 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 bool IsCodedSpecially(); | 383 bool IsCodedSpecially(); |
| 384 | 384 |
| 385 // Read/modify the code target in the branch/call instruction | 385 // Read/modify the code target in the branch/call instruction |
| 386 // this relocation applies to; | 386 // this relocation applies to; |
| 387 // can only be called if IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) | 387 // can only be called if IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) |
| 388 INLINE(Address target_address()); | 388 INLINE(Address target_address()); |
| 389 INLINE(void set_target_address(Address target, | 389 INLINE(void set_target_address(Address target, |
| 390 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); | 390 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); |
| 391 INLINE(Object* target_object()); | 391 INLINE(Object* target_object()); |
| 392 INLINE(Handle<Object> target_object_handle(Assembler* origin)); | 392 INLINE(Handle<Object> target_object_handle(Assembler* origin)); |
| 393 INLINE(Object** target_object_address()); | |
| 394 INLINE(void set_target_object(Object* target, | 393 INLINE(void set_target_object(Object* target, |
| 395 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); | 394 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); |
| 396 INLINE(Address target_runtime_entry(Assembler* origin)); | 395 INLINE(Address target_runtime_entry(Assembler* origin)); |
| 397 INLINE(void set_target_runtime_entry(Address target, | 396 INLINE(void set_target_runtime_entry(Address target, |
| 398 WriteBarrierMode mode = | 397 WriteBarrierMode mode = |
| 399 UPDATE_WRITE_BARRIER)); | 398 UPDATE_WRITE_BARRIER)); |
| 400 INLINE(Cell* target_cell()); | 399 INLINE(Cell* target_cell()); |
| 401 INLINE(Handle<Cell> target_cell_handle()); | 400 INLINE(Handle<Cell> target_cell_handle()); |
| 402 INLINE(void set_target_cell(Cell* cell, | 401 INLINE(void set_target_cell(Cell* cell, |
| 403 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); | 402 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 418 // instruction bits the size of the target will be zero, indicating that the | 417 // instruction bits the size of the target will be zero, indicating that the |
| 419 // serializer should not step forwards in memory after a target is resolved | 418 // serializer should not step forwards in memory after a target is resolved |
| 420 // and written. In this case the target_address_address function above | 419 // and written. In this case the target_address_address function above |
| 421 // should return the end of the instructions to be patched, allowing the | 420 // should return the end of the instructions to be patched, allowing the |
| 422 // deserializer to deserialize the instructions as raw bytes and put them in | 421 // deserializer to deserialize the instructions as raw bytes and put them in |
| 423 // place, ready to be patched with the target. | 422 // place, ready to be patched with the target. |
| 424 INLINE(int target_address_size()); | 423 INLINE(int target_address_size()); |
| 425 | 424 |
| 426 // Read/modify the reference in the instruction this relocation | 425 // Read/modify the reference in the instruction this relocation |
| 427 // applies to; can only be called if rmode_ is external_reference | 426 // applies to; can only be called if rmode_ is external_reference |
| 428 INLINE(Address* target_reference_address()); | 427 INLINE(Address target_reference()); |
| 429 | 428 |
| 430 // Read/modify the address of a call instruction. This is used to relocate | 429 // Read/modify the address of a call instruction. This is used to relocate |
| 431 // the break points where straight-line code is patched with a call | 430 // the break points where straight-line code is patched with a call |
| 432 // instruction. | 431 // instruction. |
| 433 INLINE(Address call_address()); | 432 INLINE(Address call_address()); |
| 434 INLINE(void set_call_address(Address target)); | 433 INLINE(void set_call_address(Address target)); |
| 435 INLINE(Object* call_object()); | 434 INLINE(Object* call_object()); |
| 436 INLINE(void set_call_object(Object* target)); | 435 INLINE(void set_call_object(Object* target)); |
| 437 INLINE(Object** call_object_address()); | 436 INLINE(Object** call_object_address()); |
| 438 | 437 |
| 438 // Wipe out a relocation to a fixed value, used for making snapshots |
| 439 // reproducible. |
| 440 INLINE(void WipeOut()); |
| 441 |
| 439 template<typename StaticVisitor> inline void Visit(Heap* heap); | 442 template<typename StaticVisitor> inline void Visit(Heap* heap); |
| 440 inline void Visit(Isolate* isolate, ObjectVisitor* v); | 443 inline void Visit(Isolate* isolate, ObjectVisitor* v); |
| 441 | 444 |
| 442 // Patch the code with some other code. | 445 // Patch the code with some other code. |
| 443 void PatchCode(byte* instructions, int instruction_count); | 446 void PatchCode(byte* instructions, int instruction_count); |
| 444 | 447 |
| 445 // Patch the code with a call. | 448 // Patch the code with a call. |
| 446 void PatchCodeWithCall(Address target, int guard_bytes); | 449 void PatchCodeWithCall(Address target, int guard_bytes); |
| 447 | 450 |
| 448 // Check whether this return sequence has been patched | 451 // Check whether this return sequence has been patched |
| (...skipping 30 matching lines...) Expand all Loading... |
| 479 // to be relocated and not the address of the instruction | 482 // to be relocated and not the address of the instruction |
| 480 // referencing the constant pool entry (except when rmode_ == | 483 // referencing the constant pool entry (except when rmode_ == |
| 481 // comment). | 484 // comment). |
| 482 byte* pc_; | 485 byte* pc_; |
| 483 Mode rmode_; | 486 Mode rmode_; |
| 484 union { | 487 union { |
| 485 intptr_t data_; | 488 intptr_t data_; |
| 486 double data64_; | 489 double data64_; |
| 487 }; | 490 }; |
| 488 Code* host_; | 491 Code* host_; |
| 489 // Code and Embedded Object pointers on some platforms are stored split | |
| 490 // across two consecutive 32-bit instructions. Heap management | |
| 491 // routines expect to access these pointers indirectly. The following | |
| 492 // location provides a place for these pointers to exist naturally | |
| 493 // when accessed via the Iterator. | |
| 494 Object* reconstructed_obj_ptr_; | |
| 495 // External-reference pointers are also split across instruction-pairs | 492 // External-reference pointers are also split across instruction-pairs |
| 496 // on some platforms, but are accessed via indirect pointers. This location | 493 // on some platforms, but are accessed via indirect pointers. This location |
| 497 // provides a place for that pointer to exist naturally. Its address | 494 // provides a place for that pointer to exist naturally. Its address |
| 498 // is returned by RelocInfo::target_reference_address(). | 495 // is returned by RelocInfo::target_reference_address(). |
| 499 Address reconstructed_adr_ptr_; | 496 Address reconstructed_adr_ptr_; |
| 500 friend class RelocIterator; | 497 friend class RelocIterator; |
| 501 }; | 498 }; |
| 502 | 499 |
| 503 | 500 |
| 504 // RelocInfoWriter serializes a stream of relocation info. It writes towards | 501 // RelocInfoWriter serializes a stream of relocation info. It writes towards |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 public: | 1045 public: |
| 1049 NullCallWrapper() { } | 1046 NullCallWrapper() { } |
| 1050 virtual ~NullCallWrapper() { } | 1047 virtual ~NullCallWrapper() { } |
| 1051 virtual void BeforeCall(int call_size) const { } | 1048 virtual void BeforeCall(int call_size) const { } |
| 1052 virtual void AfterCall() const { } | 1049 virtual void AfterCall() const { } |
| 1053 }; | 1050 }; |
| 1054 | 1051 |
| 1055 } } // namespace v8::internal | 1052 } } // namespace v8::internal |
| 1056 | 1053 |
| 1057 #endif // V8_ASSEMBLER_H_ | 1054 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |