Chromium Code Reviews| Index: src/assembler.h |
| diff --git a/src/assembler.h b/src/assembler.h |
| index 72a9b15380b88d65cfab2552115e0a2371ae5a1b..ff990309d972a466cbee545a40d552d6f1735988 100644 |
| --- a/src/assembler.h |
| +++ b/src/assembler.h |
| @@ -178,10 +178,11 @@ class RelocInfo BASE_EMBEDDED { |
| enum Mode { |
| // Please note the order is important (see IsCodeTarget, IsGCRelocMode). |
| + CODE_TARGET, // Code target which is not any of the below. |
| + CODE_TARGET_WITH_ID, |
| CONSTRUCT_CALL, // code target that is a call to a JavaScript constructor. |
| CODE_TARGET_CONTEXT, // Code target used for contextual loads. |
| DEBUG_BREAK, // Code target for the debugger statement. |
| - CODE_TARGET, // Code target which is not any of the above. |
| EMBEDDED_OBJECT, |
| GLOBAL_PROPERTY_CELL, |
| @@ -198,10 +199,13 @@ class RelocInfo BASE_EMBEDDED { |
| // add more as needed |
| // Pseudo-types |
| - NUMBER_OF_MODES, // must be no greater than 14 - see RelocInfoWriter |
| + NUMBER_OF_MODES, // must be no greater than ?? - see RelocInfoWriter |
|
fschneider
2011/02/11 11:28:18
Update comment. Maybe a STATIC_ASSERT would be bet
|
| NONE, // never recorded |
| - LAST_CODE_ENUM = CODE_TARGET, |
| - LAST_GCED_ENUM = EMBEDDED_OBJECT |
| + LAST_CODE_ENUM = DEBUG_BREAK, |
| + LAST_GCED_ENUM = EMBEDDED_OBJECT, |
| + // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact |
| + // encoding. |
| + LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID |
| }; |
| @@ -331,7 +335,8 @@ class RelocInfo BASE_EMBEDDED { |
| static const int kCodeTargetMask = (1 << (LAST_CODE_ENUM + 1)) - 1; |
| static const int kPositionMask = 1 << POSITION | 1 << STATEMENT_POSITION; |
| - static const int kDebugMask = kPositionMask | 1 << COMMENT; |
| + static const int kDataMask = |
| + (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT); |
| static const int kApplyMask; // Modes affected by apply. Depends on arch. |
| private: |
| @@ -350,9 +355,14 @@ class RelocInfo BASE_EMBEDDED { |
| // lower addresses. |
| class RelocInfoWriter BASE_EMBEDDED { |
| public: |
| - RelocInfoWriter() : pos_(NULL), last_pc_(NULL), last_data_(0) {} |
| - RelocInfoWriter(byte* pos, byte* pc) : pos_(pos), last_pc_(pc), |
| - last_data_(0) {} |
| + RelocInfoWriter() : pos_(NULL), |
| + last_pc_(NULL), |
| + last_id_(0), |
| + last_position_(0) {} |
| + RelocInfoWriter(byte* pos, byte* pc) : pos_(pos), |
| + last_pc_(pc), |
| + last_id_(0), |
| + last_position_(0) {} |
| byte* pos() const { return pos_; } |
| byte* last_pc() const { return last_pc_; } |
| @@ -377,13 +387,15 @@ class RelocInfoWriter BASE_EMBEDDED { |
| inline uint32_t WriteVariableLengthPCJump(uint32_t pc_delta); |
| inline void WriteTaggedPC(uint32_t pc_delta, int tag); |
| inline void WriteExtraTaggedPC(uint32_t pc_delta, int extra_tag); |
| + inline void WriteExtraTaggedIntData(int data_delta, int top_tag); |
| inline void WriteExtraTaggedData(intptr_t data_delta, int top_tag); |
| inline void WriteTaggedData(intptr_t data_delta, int tag); |
| inline void WriteExtraTag(int extra_tag, int top_tag); |
| byte* pos_; |
| byte* last_pc_; |
| - intptr_t last_data_; |
| + int last_id_; |
| + int last_position_; |
| DISALLOW_COPY_AND_ASSIGN(RelocInfoWriter); |
| }; |
| @@ -425,12 +437,13 @@ class RelocIterator: public Malloced { |
| int GetTopTag(); |
| void ReadTaggedPC(); |
| void AdvanceReadPC(); |
| + void AdvanceReadId(); |
| + void AdvanceReadPosition(); |
| void AdvanceReadData(); |
| void AdvanceReadVariableLengthPCJump(); |
| - int GetPositionTypeTag(); |
| - void ReadTaggedData(); |
| - |
| - static RelocInfo::Mode DebugInfoModeFromTag(int tag); |
| + int GetLocatableTypeTag(); |
| + void ReadTaggedId(); |
| + void ReadTaggedPosition(); |
| // If the given mode is wanted, set it in rinfo_ and return true. |
| // Else return false. Used for efficiently skipping unwanted modes. |
| @@ -443,6 +456,8 @@ class RelocIterator: public Malloced { |
| RelocInfo rinfo_; |
| bool done_; |
| int mode_mask_; |
| + int last_id_; |
| + int last_position_; |
| DISALLOW_COPY_AND_ASSIGN(RelocIterator); |
| }; |