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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 EXTERNAL_REFERENCE, // The address of an external C++ function. | 203 EXTERNAL_REFERENCE, // The address of an external C++ function. |
204 INTERNAL_REFERENCE, // An address inside the same function. | 204 INTERNAL_REFERENCE, // An address inside the same function. |
205 | 205 |
206 // Marks a constant pool. Only used on ARM. | 206 // Marks a constant pool. Only used on ARM. |
207 // It uses a custom noncompact encoding. | 207 // It uses a custom noncompact encoding. |
208 CONST_POOL, | 208 CONST_POOL, |
209 | 209 |
210 // add more as needed | 210 // add more as needed |
211 // Pseudo-types | 211 // Pseudo-types |
212 NUMBER_OF_MODES, // There are at most 15 modes with noncompact encoding. | 212 NUMBER_OF_MODES, // There are at most 15 modes with noncompact encoding. |
213 NONE, // never recorded | 213 NONE, // never recorded 32-bit value |
214 NONE64, // never recorded 64-bit value | |
214 LAST_CODE_ENUM = DEBUG_BREAK, | 215 LAST_CODE_ENUM = DEBUG_BREAK, |
215 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL, | 216 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL, |
216 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. | 217 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. |
217 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, | 218 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, |
218 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE | 219 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE |
219 }; | 220 }; |
220 | 221 |
221 | 222 |
222 RelocInfo() {} | 223 RelocInfo() {} |
223 | 224 |
224 RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host) | 225 explicit RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host) |
ulan
2012/10/22 09:18:25
No need for explicit here and below since the numb
| |
225 : pc_(pc), rmode_(rmode), data_(data), host_(host) { | 226 : pc_(pc), rmode_(rmode), data_(data), host_(host) { |
226 } | 227 } |
228 explicit RelocInfo(byte* pc, double data64) | |
229 : pc_(pc), rmode_(NONE64), data64_(data64), host_(NULL) { | |
230 } | |
227 | 231 |
228 static inline bool IsConstructCall(Mode mode) { | 232 static inline bool IsConstructCall(Mode mode) { |
229 return mode == CONSTRUCT_CALL; | 233 return mode == CONSTRUCT_CALL; |
230 } | 234 } |
231 static inline bool IsCodeTarget(Mode mode) { | 235 static inline bool IsCodeTarget(Mode mode) { |
232 return mode <= LAST_CODE_ENUM; | 236 return mode <= LAST_CODE_ENUM; |
233 } | 237 } |
234 static inline bool IsEmbeddedObject(Mode mode) { | 238 static inline bool IsEmbeddedObject(Mode mode) { |
235 return mode == EMBEDDED_OBJECT; | 239 return mode == EMBEDDED_OBJECT; |
236 } | 240 } |
(...skipping 18 matching lines...) Expand all Loading... | |
255 } | 259 } |
256 static inline bool IsExternalReference(Mode mode) { | 260 static inline bool IsExternalReference(Mode mode) { |
257 return mode == EXTERNAL_REFERENCE; | 261 return mode == EXTERNAL_REFERENCE; |
258 } | 262 } |
259 static inline bool IsInternalReference(Mode mode) { | 263 static inline bool IsInternalReference(Mode mode) { |
260 return mode == INTERNAL_REFERENCE; | 264 return mode == INTERNAL_REFERENCE; |
261 } | 265 } |
262 static inline bool IsDebugBreakSlot(Mode mode) { | 266 static inline bool IsDebugBreakSlot(Mode mode) { |
263 return mode == DEBUG_BREAK_SLOT; | 267 return mode == DEBUG_BREAK_SLOT; |
264 } | 268 } |
269 static inline bool IsNone(Mode mode) { | |
270 return mode == NONE || mode == NONE64; | |
271 } | |
265 static inline int ModeMask(Mode mode) { return 1 << mode; } | 272 static inline int ModeMask(Mode mode) { return 1 << mode; } |
266 | 273 |
267 // Accessors | 274 // Accessors |
268 byte* pc() const { return pc_; } | 275 byte* pc() const { return pc_; } |
269 void set_pc(byte* pc) { pc_ = pc; } | 276 void set_pc(byte* pc) { pc_ = pc; } |
270 Mode rmode() const { return rmode_; } | 277 Mode rmode() const { return rmode_; } |
271 intptr_t data() const { return data_; } | 278 intptr_t data() const { return data_; } |
279 double data64() const { return data64_; } | |
272 Code* host() const { return host_; } | 280 Code* host() const { return host_; } |
273 | 281 |
274 // Apply a relocation by delta bytes | 282 // Apply a relocation by delta bytes |
275 INLINE(void apply(intptr_t delta)); | 283 INLINE(void apply(intptr_t delta)); |
276 | 284 |
277 // Is the pointer this relocation info refers to coded like a plain pointer | 285 // Is the pointer this relocation info refers to coded like a plain pointer |
278 // or is it strange in some way (e.g. relative or patched into a series of | 286 // or is it strange in some way (e.g. relative or patched into a series of |
279 // instructions). | 287 // instructions). |
280 bool IsCodedSpecially(); | 288 bool IsCodedSpecially(); |
281 | 289 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
359 (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT); | 367 (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT); |
360 static const int kApplyMask; // Modes affected by apply. Depends on arch. | 368 static const int kApplyMask; // Modes affected by apply. Depends on arch. |
361 | 369 |
362 private: | 370 private: |
363 // On ARM, note that pc_ is the address of the constant pool entry | 371 // On ARM, note that pc_ is the address of the constant pool entry |
364 // to be relocated and not the address of the instruction | 372 // to be relocated and not the address of the instruction |
365 // referencing the constant pool entry (except when rmode_ == | 373 // referencing the constant pool entry (except when rmode_ == |
366 // comment). | 374 // comment). |
367 byte* pc_; | 375 byte* pc_; |
368 Mode rmode_; | 376 Mode rmode_; |
369 intptr_t data_; | 377 union { |
378 intptr_t data_; | |
379 double data64_; | |
380 }; | |
370 Code* host_; | 381 Code* host_; |
371 #ifdef V8_TARGET_ARCH_MIPS | 382 #ifdef V8_TARGET_ARCH_MIPS |
372 // Code and Embedded Object pointers in mips are stored split | 383 // Code and Embedded Object pointers in mips are stored split |
373 // across two consecutive 32-bit instructions. Heap management | 384 // across two consecutive 32-bit instructions. Heap management |
374 // routines expect to access these pointers indirectly. The following | 385 // routines expect to access these pointers indirectly. The following |
375 // location provides a place for these pointers to exist natually | 386 // location provides a place for these pointers to exist natually |
376 // when accessed via the Iterator. | 387 // when accessed via the Iterator. |
377 Object* reconstructed_obj_ptr_; | 388 Object* reconstructed_obj_ptr_; |
378 // External-reference pointers are also split across instruction-pairs | 389 // External-reference pointers are also split across instruction-pairs |
379 // in mips, but are accessed via indirect pointers. This location | 390 // in mips, but are accessed via indirect pointers. This location |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
889 public: | 900 public: |
890 NullCallWrapper() { } | 901 NullCallWrapper() { } |
891 virtual ~NullCallWrapper() { } | 902 virtual ~NullCallWrapper() { } |
892 virtual void BeforeCall(int call_size) const { } | 903 virtual void BeforeCall(int call_size) const { } |
893 virtual void AfterCall() const { } | 904 virtual void AfterCall() const { } |
894 }; | 905 }; |
895 | 906 |
896 } } // namespace v8::internal | 907 } } // namespace v8::internal |
897 | 908 |
898 #endif // V8_ASSEMBLER_H_ | 909 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |