| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 LAST_REAL_RELOC_MODE = VENEER_POOL, | 298 LAST_REAL_RELOC_MODE = VENEER_POOL, |
| 299 FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, | 299 FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, |
| 300 LAST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, | 300 LAST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, |
| 301 LAST_CODE_ENUM = DEBUG_BREAK, | 301 LAST_CODE_ENUM = DEBUG_BREAK, |
| 302 LAST_GCED_ENUM = CELL, | 302 LAST_GCED_ENUM = CELL, |
| 303 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. | 303 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. |
| 304 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, | 304 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, |
| 305 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE | 305 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE |
| 306 }; | 306 }; |
| 307 | 307 |
| 308 enum WeakMode { |
| 309 NOT_WEAK, |
| 310 WEAK_IN_OPTIMIZED_CODE |
| 311 }; |
| 308 | 312 |
| 309 RelocInfo() {} | 313 RelocInfo() {} |
| 310 | 314 |
| 311 RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host) | 315 RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host) |
| 312 : pc_(pc), rmode_(rmode), data_(data), host_(host) { | 316 : pc_(pc), rmode_(rmode), data_(data), host_(host) { |
| 313 } | 317 } |
| 318 |
| 319 RelocInfo(byte* pc, Mode rmode, WeakMode weak_mode, intptr_t data) |
| 320 : pc_(pc), rmode_(rmode), data_(data), weak_mode_(weak_mode) { |
| 321 } |
| 322 |
| 314 RelocInfo(byte* pc, double data64) | 323 RelocInfo(byte* pc, double data64) |
| 315 : pc_(pc), rmode_(NONE64), data64_(data64), host_(NULL) { | 324 : pc_(pc), rmode_(NONE64), data64_(data64), host_(NULL) { |
| 316 } | 325 } |
| 317 | 326 |
| 318 static inline bool IsRealRelocMode(Mode mode) { | 327 static inline bool IsRealRelocMode(Mode mode) { |
| 319 return mode >= FIRST_REAL_RELOC_MODE && | 328 return mode >= FIRST_REAL_RELOC_MODE && |
| 320 mode <= LAST_REAL_RELOC_MODE; | 329 mode <= LAST_REAL_RELOC_MODE; |
| 321 } | 330 } |
| 322 static inline bool IsPseudoRelocMode(Mode mode) { | 331 static inline bool IsPseudoRelocMode(Mode mode) { |
| 323 ASSERT(!IsRealRelocMode(mode)); | 332 ASSERT(!IsRealRelocMode(mode)); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 byte* pc() const { return pc_; } | 397 byte* pc() const { return pc_; } |
| 389 void set_pc(byte* pc) { pc_ = pc; } | 398 void set_pc(byte* pc) { pc_ = pc; } |
| 390 Mode rmode() const { return rmode_; } | 399 Mode rmode() const { return rmode_; } |
| 391 intptr_t data() const { return data_; } | 400 intptr_t data() const { return data_; } |
| 392 double data64() const { return data64_; } | 401 double data64() const { return data64_; } |
| 393 uint64_t raw_data64() { | 402 uint64_t raw_data64() { |
| 394 return BitCast<uint64_t>(data64_); | 403 return BitCast<uint64_t>(data64_); |
| 395 } | 404 } |
| 396 Code* host() const { return host_; } | 405 Code* host() const { return host_; } |
| 397 void set_host(Code* host) { host_ = host; } | 406 void set_host(Code* host) { host_ = host; } |
| 407 WeakMode weak_mode() const { return weak_mode_; } |
| 398 | 408 |
| 399 // Apply a relocation by delta bytes | 409 // Apply a relocation by delta bytes |
| 400 INLINE(void apply(intptr_t delta)); | 410 INLINE(void apply(intptr_t delta)); |
| 401 | 411 |
| 402 // Is the pointer this relocation info refers to coded like a plain pointer | 412 // Is the pointer this relocation info refers to coded like a plain pointer |
| 403 // or is it strange in some way (e.g. relative or patched into a series of | 413 // or is it strange in some way (e.g. relative or patched into a series of |
| 404 // instructions). | 414 // instructions). |
| 405 bool IsCodedSpecially(); | 415 bool IsCodedSpecially(); |
| 406 | 416 |
| 407 // If true, the pointer this relocation info refers to is an entry in the | 417 // If true, the pointer this relocation info refers to is an entry in the |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 // On ARM, note that pc_ is the address of the constant pool entry | 522 // On ARM, note that pc_ is the address of the constant pool entry |
| 513 // to be relocated and not the address of the instruction | 523 // to be relocated and not the address of the instruction |
| 514 // referencing the constant pool entry (except when rmode_ == | 524 // referencing the constant pool entry (except when rmode_ == |
| 515 // comment). | 525 // comment). |
| 516 byte* pc_; | 526 byte* pc_; |
| 517 Mode rmode_; | 527 Mode rmode_; |
| 518 union { | 528 union { |
| 519 intptr_t data_; | 529 intptr_t data_; |
| 520 double data64_; | 530 double data64_; |
| 521 }; | 531 }; |
| 522 Code* host_; | 532 union { |
| 533 Code* host_; |
| 534 WeakMode weak_mode_; |
| 535 }; |
| 523 // External-reference pointers are also split across instruction-pairs | 536 // External-reference pointers are also split across instruction-pairs |
| 524 // on some platforms, but are accessed via indirect pointers. This location | 537 // on some platforms, but are accessed via indirect pointers. This location |
| 525 // provides a place for that pointer to exist naturally. Its address | 538 // provides a place for that pointer to exist naturally. Its address |
| 526 // is returned by RelocInfo::target_reference_address(). | 539 // is returned by RelocInfo::target_reference_address(). |
| 527 Address reconstructed_adr_ptr_; | 540 Address reconstructed_adr_ptr_; |
| 528 friend class RelocIterator; | 541 friend class RelocIterator; |
| 529 }; | 542 }; |
| 530 | 543 |
| 531 | 544 |
| 532 // RelocInfoWriter serializes a stream of relocation info. It writes towards | 545 // RelocInfoWriter serializes a stream of relocation info. It writes towards |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 | 1090 |
| 1078 private: | 1091 private: |
| 1079 int32_t multiplier_; | 1092 int32_t multiplier_; |
| 1080 int32_t shift_; | 1093 int32_t shift_; |
| 1081 }; | 1094 }; |
| 1082 | 1095 |
| 1083 | 1096 |
| 1084 } } // namespace v8::internal | 1097 } } // namespace v8::internal |
| 1085 | 1098 |
| 1086 #endif // V8_ASSEMBLER_H_ | 1099 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |