| 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 // code aging. | 425 // code aging. |
| 426 | 426 |
| 427 FIRST_REAL_RELOC_MODE = CODE_TARGET, | 427 FIRST_REAL_RELOC_MODE = CODE_TARGET, |
| 428 LAST_REAL_RELOC_MODE = VENEER_POOL, | 428 LAST_REAL_RELOC_MODE = VENEER_POOL, |
| 429 LAST_CODE_ENUM = DEBUGGER_STATEMENT, | 429 LAST_CODE_ENUM = DEBUGGER_STATEMENT, |
| 430 LAST_GCED_ENUM = CELL, | 430 LAST_GCED_ENUM = CELL, |
| 431 }; | 431 }; |
| 432 | 432 |
| 433 STATIC_ASSERT(NUMBER_OF_MODES <= kBitsPerInt); | 433 STATIC_ASSERT(NUMBER_OF_MODES <= kBitsPerInt); |
| 434 | 434 |
| 435 RelocInfo() {} | 435 explicit RelocInfo(Isolate* isolate) : isolate_(isolate) { |
| 436 DCHECK_NOT_NULL(isolate); |
| 437 } |
| 436 | 438 |
| 437 RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host) | 439 RelocInfo(Isolate* isolate, byte* pc, Mode rmode, intptr_t data, Code* host) |
| 438 : pc_(pc), rmode_(rmode), data_(data), host_(host) { | 440 : isolate_(isolate), pc_(pc), rmode_(rmode), data_(data), host_(host) { |
| 441 DCHECK_NOT_NULL(isolate); |
| 439 } | 442 } |
| 440 | 443 |
| 441 static inline bool IsRealRelocMode(Mode mode) { | 444 static inline bool IsRealRelocMode(Mode mode) { |
| 442 return mode >= FIRST_REAL_RELOC_MODE && | 445 return mode >= FIRST_REAL_RELOC_MODE && |
| 443 mode <= LAST_REAL_RELOC_MODE; | 446 mode <= LAST_REAL_RELOC_MODE; |
| 444 } | 447 } |
| 445 static inline bool IsConstructCall(Mode mode) { | 448 static inline bool IsConstructCall(Mode mode) { |
| 446 return mode == CONSTRUCT_CALL; | 449 return mode == CONSTRUCT_CALL; |
| 447 } | 450 } |
| 448 static inline bool IsCodeTarget(Mode mode) { | 451 static inline bool IsCodeTarget(Mode mode) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 } | 514 } |
| 512 static inline bool IsCodeAgeSequence(Mode mode) { | 515 static inline bool IsCodeAgeSequence(Mode mode) { |
| 513 return mode == CODE_AGE_SEQUENCE; | 516 return mode == CODE_AGE_SEQUENCE; |
| 514 } | 517 } |
| 515 static inline bool IsGeneratorContinuation(Mode mode) { | 518 static inline bool IsGeneratorContinuation(Mode mode) { |
| 516 return mode == GENERATOR_CONTINUATION; | 519 return mode == GENERATOR_CONTINUATION; |
| 517 } | 520 } |
| 518 static inline int ModeMask(Mode mode) { return 1 << mode; } | 521 static inline int ModeMask(Mode mode) { return 1 << mode; } |
| 519 | 522 |
| 520 // Accessors | 523 // Accessors |
| 524 Isolate* isolate() const { return isolate_; } |
| 521 byte* pc() const { return pc_; } | 525 byte* pc() const { return pc_; } |
| 522 void set_pc(byte* pc) { pc_ = pc; } | 526 void set_pc(byte* pc) { pc_ = pc; } |
| 523 Mode rmode() const { return rmode_; } | 527 Mode rmode() const { return rmode_; } |
| 524 intptr_t data() const { return data_; } | 528 intptr_t data() const { return data_; } |
| 525 Code* host() const { return host_; } | 529 Code* host() const { return host_; } |
| 526 void set_host(Code* host) { host_ = host; } | 530 void set_host(Code* host) { host_ = host; } |
| 527 | 531 |
| 528 // Apply a relocation by delta bytes. When the code object is moved, PC | 532 // Apply a relocation by delta bytes. When the code object is moved, PC |
| 529 // relative addresses have to be updated as well as absolute addresses | 533 // relative addresses have to be updated as well as absolute addresses |
| 530 // inside the code (internal references). | 534 // inside the code (internal references). |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1; | 655 static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1; |
| 652 static const int kPositionMask = 1 << POSITION | 1 << STATEMENT_POSITION; | 656 static const int kPositionMask = 1 << POSITION | 1 << STATEMENT_POSITION; |
| 653 static const int kDataMask = | 657 static const int kDataMask = |
| 654 (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT); | 658 (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT); |
| 655 static const int kDebugBreakSlotMask = | 659 static const int kDebugBreakSlotMask = |
| 656 1 << DEBUG_BREAK_SLOT_AT_POSITION | 1 << DEBUG_BREAK_SLOT_AT_RETURN | | 660 1 << DEBUG_BREAK_SLOT_AT_POSITION | 1 << DEBUG_BREAK_SLOT_AT_RETURN | |
| 657 1 << DEBUG_BREAK_SLOT_AT_CALL | 1 << DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL; | 661 1 << DEBUG_BREAK_SLOT_AT_CALL | 1 << DEBUG_BREAK_SLOT_AT_CONSTRUCT_CALL; |
| 658 static const int kApplyMask; // Modes affected by apply. Depends on arch. | 662 static const int kApplyMask; // Modes affected by apply. Depends on arch. |
| 659 | 663 |
| 660 private: | 664 private: |
| 665 Isolate* isolate_; |
| 661 // On ARM, note that pc_ is the address of the constant pool entry | 666 // On ARM, note that pc_ is the address of the constant pool entry |
| 662 // to be relocated and not the address of the instruction | 667 // to be relocated and not the address of the instruction |
| 663 // referencing the constant pool entry (except when rmode_ == | 668 // referencing the constant pool entry (except when rmode_ == |
| 664 // comment). | 669 // comment). |
| 665 byte* pc_; | 670 byte* pc_; |
| 666 Mode rmode_; | 671 Mode rmode_; |
| 667 intptr_t data_; | 672 intptr_t data_; |
| 668 Code* host_; | 673 Code* host_; |
| 669 friend class RelocIterator; | 674 friend class RelocIterator; |
| 670 }; | 675 }; |
| (...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 std::vector<ConstantPoolEntry> shared_entries; | 1295 std::vector<ConstantPoolEntry> shared_entries; |
| 1291 }; | 1296 }; |
| 1292 | 1297 |
| 1293 Label emitted_label_; // Records pc_offset of emitted pool | 1298 Label emitted_label_; // Records pc_offset of emitted pool |
| 1294 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; | 1299 PerTypeEntryInfo info_[ConstantPoolEntry::NUMBER_OF_TYPES]; |
| 1295 }; | 1300 }; |
| 1296 | 1301 |
| 1297 } // namespace internal | 1302 } // namespace internal |
| 1298 } // namespace v8 | 1303 } // namespace v8 |
| 1299 #endif // V8_ASSEMBLER_H_ | 1304 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |