| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // invalid/uninitialized position value. | 114 // invalid/uninitialized position value. |
| 115 static const int kNoPosition = -1; | 115 static const int kNoPosition = -1; |
| 116 | 116 |
| 117 enum Mode { | 117 enum Mode { |
| 118 // Please note the order is important (see IsCodeTarget, IsGCRelocMode). | 118 // Please note the order is important (see IsCodeTarget, IsGCRelocMode). |
| 119 CONSTRUCT_CALL, // code target that is a call to a JavaScript constructor. | 119 CONSTRUCT_CALL, // code target that is a call to a JavaScript constructor. |
| 120 CODE_TARGET_CONTEXT, // code target used for contextual loads. | 120 CODE_TARGET_CONTEXT, // code target used for contextual loads. |
| 121 DEBUG_BREAK, | 121 DEBUG_BREAK, |
| 122 CODE_TARGET, // code target which is not any of the above. | 122 CODE_TARGET, // code target which is not any of the above. |
| 123 EMBEDDED_OBJECT, | 123 EMBEDDED_OBJECT, |
| 124 EMBEDDED_STRING, | |
| 125 | 124 |
| 126 // Everything after runtime_entry (inclusive) is not GC'ed. | 125 // Everything after runtime_entry (inclusive) is not GC'ed. |
| 127 RUNTIME_ENTRY, | 126 RUNTIME_ENTRY, |
| 128 JS_RETURN, // Marks start of the ExitJSFrame code. | 127 JS_RETURN, // Marks start of the ExitJSFrame code. |
| 129 COMMENT, | 128 COMMENT, |
| 130 POSITION, // See comment for kNoPosition above. | 129 POSITION, // See comment for kNoPosition above. |
| 131 STATEMENT_POSITION, // See comment for kNoPosition above. | 130 STATEMENT_POSITION, // See comment for kNoPosition above. |
| 132 EXTERNAL_REFERENCE, // The address of an external C++ function. | 131 EXTERNAL_REFERENCE, // The address of an external C++ function. |
| 133 INTERNAL_REFERENCE, // An address inside the same function. | 132 INTERNAL_REFERENCE, // An address inside the same function. |
| 134 | 133 |
| 135 // add more as needed | 134 // add more as needed |
| 136 // Pseudo-types | 135 // Pseudo-types |
| 137 NUMBER_OF_MODES, // must be no greater than 14 - see RelocInfoWriter | 136 NUMBER_OF_MODES, // must be no greater than 14 - see RelocInfoWriter |
| 138 NONE, // never recorded | 137 NONE, // never recorded |
| 139 LAST_CODE_ENUM = CODE_TARGET, | 138 LAST_CODE_ENUM = CODE_TARGET, |
| 140 LAST_GCED_ENUM = EMBEDDED_STRING | 139 LAST_GCED_ENUM = EMBEDDED_OBJECT |
| 141 }; | 140 }; |
| 142 | 141 |
| 143 | 142 |
| 144 RelocInfo() {} | 143 RelocInfo() {} |
| 145 RelocInfo(byte* pc, Mode rmode, intptr_t data) | 144 RelocInfo(byte* pc, Mode rmode, intptr_t data) |
| 146 : pc_(pc), rmode_(rmode), data_(data) { | 145 : pc_(pc), rmode_(rmode), data_(data) { |
| 147 } | 146 } |
| 148 | 147 |
| 149 static inline bool IsConstructCall(Mode mode) { | 148 static inline bool IsConstructCall(Mode mode) { |
| 150 return mode == CONSTRUCT_CALL; | 149 return mode == CONSTRUCT_CALL; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 178 | 177 |
| 179 // Accessors | 178 // Accessors |
| 180 byte* pc() const { return pc_; } | 179 byte* pc() const { return pc_; } |
| 181 void set_pc(byte* pc) { pc_ = pc; } | 180 void set_pc(byte* pc) { pc_ = pc; } |
| 182 Mode rmode() const { return rmode_; } | 181 Mode rmode() const { return rmode_; } |
| 183 intptr_t data() const { return data_; } | 182 intptr_t data() const { return data_; } |
| 184 | 183 |
| 185 // Apply a relocation by delta bytes | 184 // Apply a relocation by delta bytes |
| 186 INLINE(void apply(intptr_t delta)); | 185 INLINE(void apply(intptr_t delta)); |
| 187 | 186 |
| 187 // Is the pointer this relocation info refers to coded like a plain pointer |
| 188 // or is it strange in some way (eg relative or patched into a series of |
| 189 // instructions). |
| 190 bool IsCodedSpecially(); |
| 191 |
| 188 // Read/modify the code target in the branch/call instruction | 192 // Read/modify the code target in the branch/call instruction |
| 189 // this relocation applies to; | 193 // this relocation applies to; |
| 190 // can only be called if IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY | 194 // can only be called if IsCodeTarget(rmode_) || rmode_ == RUNTIME_ENTRY |
| 191 INLINE(Address target_address()); | 195 INLINE(Address target_address()); |
| 192 INLINE(void set_target_address(Address target)); | 196 INLINE(void set_target_address(Address target)); |
| 193 INLINE(Object* target_object()); | 197 INLINE(Object* target_object()); |
| 194 INLINE(Handle<Object> target_object_handle(Assembler* origin)); | 198 INLINE(Handle<Object> target_object_handle(Assembler* origin)); |
| 195 INLINE(Object** target_object_address()); | 199 INLINE(Object** target_object_address()); |
| 196 INLINE(void set_target_object(Object* target)); | 200 INLINE(void set_target_object(Object* target)); |
| 197 | 201 |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 unsigned int num_bits_set; | 539 unsigned int num_bits_set; |
| 536 for (num_bits_set = 0; x; x >>= 1) { | 540 for (num_bits_set = 0; x; x >>= 1) { |
| 537 num_bits_set += x & 1; | 541 num_bits_set += x & 1; |
| 538 } | 542 } |
| 539 return num_bits_set; | 543 return num_bits_set; |
| 540 } | 544 } |
| 541 | 545 |
| 542 } } // namespace v8::internal | 546 } } // namespace v8::internal |
| 543 | 547 |
| 544 #endif // V8_ASSEMBLER_H_ | 548 #endif // V8_ASSEMBLER_H_ |
| OLD | NEW |