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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 Code* host() const { return host_; } | 377 Code* host() const { return host_; } |
378 | 378 |
379 // Apply a relocation by delta bytes | 379 // Apply a relocation by delta bytes |
380 INLINE(void apply(intptr_t delta)); | 380 INLINE(void apply(intptr_t delta)); |
381 | 381 |
382 // Is the pointer this relocation info refers to coded like a plain pointer | 382 // Is the pointer this relocation info refers to coded like a plain pointer |
383 // or is it strange in some way (e.g. relative or patched into a series of | 383 // or is it strange in some way (e.g. relative or patched into a series of |
384 // instructions). | 384 // instructions). |
385 bool IsCodedSpecially(); | 385 bool IsCodedSpecially(); |
386 | 386 |
| 387 // If true, the pointer this relocation info refers to is an entry in the |
| 388 // constant pool, otherwise the pointer is embedded in the instruction stream. |
| 389 bool IsInConstantPool(); |
| 390 |
387 // Read/modify the code target in the branch/call instruction | 391 // Read/modify the code target in the branch/call instruction |
388 // this relocation applies to; | 392 // this relocation applies to; |
389 // can only be called if IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) | 393 // can only be called if IsCodeTarget(rmode_) || IsRuntimeEntry(rmode_) |
390 INLINE(Address target_address()); | 394 INLINE(Address target_address()); |
391 INLINE(void set_target_address(Address target, | 395 INLINE(void set_target_address(Address target, |
392 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); | 396 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); |
393 INLINE(Object* target_object()); | 397 INLINE(Object* target_object()); |
394 INLINE(Handle<Object> target_object_handle(Assembler* origin)); | 398 INLINE(Handle<Object> target_object_handle(Assembler* origin)); |
395 INLINE(void set_target_object(Object* target, | 399 INLINE(void set_target_object(Object* target, |
396 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); | 400 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); |
397 INLINE(Address target_runtime_entry(Assembler* origin)); | 401 INLINE(Address target_runtime_entry(Assembler* origin)); |
398 INLINE(void set_target_runtime_entry(Address target, | 402 INLINE(void set_target_runtime_entry(Address target, |
399 WriteBarrierMode mode = | 403 WriteBarrierMode mode = |
400 UPDATE_WRITE_BARRIER)); | 404 UPDATE_WRITE_BARRIER)); |
401 INLINE(Cell* target_cell()); | 405 INLINE(Cell* target_cell()); |
402 INLINE(Handle<Cell> target_cell_handle()); | 406 INLINE(Handle<Cell> target_cell_handle()); |
403 INLINE(void set_target_cell(Cell* cell, | 407 INLINE(void set_target_cell(Cell* cell, |
404 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); | 408 WriteBarrierMode mode = UPDATE_WRITE_BARRIER)); |
405 INLINE(Handle<Object> code_age_stub_handle(Assembler* origin)); | 409 INLINE(Handle<Object> code_age_stub_handle(Assembler* origin)); |
406 INLINE(Code* code_age_stub()); | 410 INLINE(Code* code_age_stub()); |
407 INLINE(void set_code_age_stub(Code* stub)); | 411 INLINE(void set_code_age_stub(Code* stub)); |
408 | 412 |
| 413 // Returns the address of the constant pool entry where the target address |
| 414 // is held. This should only be called if IsInConstantPool returns true. |
| 415 INLINE(Address constant_pool_entry_address()); |
| 416 |
409 // Read the address of the word containing the target_address in an | 417 // Read the address of the word containing the target_address in an |
410 // instruction stream. What this means exactly is architecture-independent. | 418 // instruction stream. What this means exactly is architecture-independent. |
411 // The only architecture-independent user of this function is the serializer. | 419 // The only architecture-independent user of this function is the serializer. |
412 // The serializer uses it to find out how many raw bytes of instruction to | 420 // The serializer uses it to find out how many raw bytes of instruction to |
413 // output before the next target. Architecture-independent code shouldn't | 421 // output before the next target. Architecture-independent code shouldn't |
414 // dereference the pointer it gets back from this. | 422 // dereference the pointer it gets back from this. |
415 INLINE(Address target_address_address()); | 423 INLINE(Address target_address_address()); |
| 424 |
416 // This indicates how much space a target takes up when deserializing a code | 425 // This indicates how much space a target takes up when deserializing a code |
417 // stream. For most architectures this is just the size of a pointer. For | 426 // stream. For most architectures this is just the size of a pointer. For |
418 // an instruction like movw/movt where the target bits are mixed into the | 427 // an instruction like movw/movt where the target bits are mixed into the |
419 // instruction bits the size of the target will be zero, indicating that the | 428 // instruction bits the size of the target will be zero, indicating that the |
420 // serializer should not step forwards in memory after a target is resolved | 429 // serializer should not step forwards in memory after a target is resolved |
421 // and written. In this case the target_address_address function above | 430 // and written. In this case the target_address_address function above |
422 // should return the end of the instructions to be patched, allowing the | 431 // should return the end of the instructions to be patched, allowing the |
423 // deserializer to deserialize the instructions as raw bytes and put them in | 432 // deserializer to deserialize the instructions as raw bytes and put them in |
424 // place, ready to be patched with the target. | 433 // place, ready to be patched with the target. |
425 INLINE(int target_address_size()); | 434 INLINE(int target_address_size()); |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 public: | 1042 public: |
1034 NullCallWrapper() { } | 1043 NullCallWrapper() { } |
1035 virtual ~NullCallWrapper() { } | 1044 virtual ~NullCallWrapper() { } |
1036 virtual void BeforeCall(int call_size) const { } | 1045 virtual void BeforeCall(int call_size) const { } |
1037 virtual void AfterCall() const { } | 1046 virtual void AfterCall() const { } |
1038 }; | 1047 }; |
1039 | 1048 |
1040 } } // namespace v8::internal | 1049 } } // namespace v8::internal |
1041 | 1050 |
1042 #endif // V8_ASSEMBLER_H_ | 1051 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |