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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 EXTERNAL_REFERENCE, // The address of an external C++ function. | 241 EXTERNAL_REFERENCE, // The address of an external C++ function. |
242 INTERNAL_REFERENCE, // An address inside the same function. | 242 INTERNAL_REFERENCE, // An address inside the same function. |
243 | 243 |
244 // Marks a constant pool. Only used on ARM. | 244 // Marks a constant pool. Only used on ARM. |
245 // It uses a custom noncompact encoding. | 245 // It uses a custom noncompact encoding. |
246 CONST_POOL, | 246 CONST_POOL, |
247 | 247 |
248 // add more as needed | 248 // add more as needed |
249 // Pseudo-types | 249 // Pseudo-types |
250 NUMBER_OF_MODES, // There are at most 15 modes with noncompact encoding. | 250 NUMBER_OF_MODES, // There are at most 15 modes with noncompact encoding. |
251 NONE, // never recorded | 251 NONE, // never recorded 32-bit value |
| 252 NONE64, // never recorded 64-bit value |
252 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by | 253 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by |
253 // code aging. | 254 // code aging. |
254 FIRST_REAL_RELOC_MODE = CODE_TARGET, | 255 FIRST_REAL_RELOC_MODE = CODE_TARGET, |
255 LAST_REAL_RELOC_MODE = CONST_POOL, | 256 LAST_REAL_RELOC_MODE = CONST_POOL, |
256 FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, | 257 FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, |
257 LAST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, | 258 LAST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, |
258 LAST_CODE_ENUM = DEBUG_BREAK, | 259 LAST_CODE_ENUM = DEBUG_BREAK, |
259 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL, | 260 LAST_GCED_ENUM = GLOBAL_PROPERTY_CELL, |
260 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. | 261 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. |
261 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, | 262 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, |
262 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE | 263 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE |
263 }; | 264 }; |
264 | 265 |
265 | 266 |
266 RelocInfo() {} | 267 RelocInfo() {} |
267 | 268 |
268 RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host) | 269 RelocInfo(byte* pc, Mode rmode, intptr_t data, Code* host) |
269 : pc_(pc), rmode_(rmode), data_(data), host_(host) { | 270 : pc_(pc), rmode_(rmode), data_(data), host_(host) { |
270 } | 271 } |
| 272 RelocInfo(byte* pc, double data64) |
| 273 : pc_(pc), rmode_(NONE64), data64_(data64), host_(NULL) { |
| 274 } |
271 | 275 |
272 static inline bool IsRealRelocMode(Mode mode) { | 276 static inline bool IsRealRelocMode(Mode mode) { |
273 return mode >= FIRST_REAL_RELOC_MODE && | 277 return mode >= FIRST_REAL_RELOC_MODE && |
274 mode <= LAST_REAL_RELOC_MODE; | 278 mode <= LAST_REAL_RELOC_MODE; |
275 } | 279 } |
276 static inline bool IsPseudoRelocMode(Mode mode) { | 280 static inline bool IsPseudoRelocMode(Mode mode) { |
277 ASSERT(!IsRealRelocMode(mode)); | 281 ASSERT(!IsRealRelocMode(mode)); |
278 return mode >= FIRST_PSEUDO_RELOC_MODE && | 282 return mode >= FIRST_PSEUDO_RELOC_MODE && |
279 mode <= LAST_PSEUDO_RELOC_MODE; | 283 mode <= LAST_PSEUDO_RELOC_MODE; |
280 } | 284 } |
(...skipping 27 matching lines...) Expand all Loading... |
308 } | 312 } |
309 static inline bool IsExternalReference(Mode mode) { | 313 static inline bool IsExternalReference(Mode mode) { |
310 return mode == EXTERNAL_REFERENCE; | 314 return mode == EXTERNAL_REFERENCE; |
311 } | 315 } |
312 static inline bool IsInternalReference(Mode mode) { | 316 static inline bool IsInternalReference(Mode mode) { |
313 return mode == INTERNAL_REFERENCE; | 317 return mode == INTERNAL_REFERENCE; |
314 } | 318 } |
315 static inline bool IsDebugBreakSlot(Mode mode) { | 319 static inline bool IsDebugBreakSlot(Mode mode) { |
316 return mode == DEBUG_BREAK_SLOT; | 320 return mode == DEBUG_BREAK_SLOT; |
317 } | 321 } |
| 322 static inline bool IsNone(Mode mode) { |
| 323 return mode == NONE || mode == NONE64; |
| 324 } |
318 static inline bool IsCodeAgeSequence(Mode mode) { | 325 static inline bool IsCodeAgeSequence(Mode mode) { |
319 return mode == CODE_AGE_SEQUENCE; | 326 return mode == CODE_AGE_SEQUENCE; |
320 } | 327 } |
321 static inline int ModeMask(Mode mode) { return 1 << mode; } | 328 static inline int ModeMask(Mode mode) { return 1 << mode; } |
322 | 329 |
323 // Accessors | 330 // Accessors |
324 byte* pc() const { return pc_; } | 331 byte* pc() const { return pc_; } |
325 void set_pc(byte* pc) { pc_ = pc; } | 332 void set_pc(byte* pc) { pc_ = pc; } |
326 Mode rmode() const { return rmode_; } | 333 Mode rmode() const { return rmode_; } |
327 intptr_t data() const { return data_; } | 334 intptr_t data() const { return data_; } |
| 335 double data64() const { return data64_; } |
328 Code* host() const { return host_; } | 336 Code* host() const { return host_; } |
329 | 337 |
330 // Apply a relocation by delta bytes | 338 // Apply a relocation by delta bytes |
331 INLINE(void apply(intptr_t delta)); | 339 INLINE(void apply(intptr_t delta)); |
332 | 340 |
333 // Is the pointer this relocation info refers to coded like a plain pointer | 341 // Is the pointer this relocation info refers to coded like a plain pointer |
334 // or is it strange in some way (e.g. relative or patched into a series of | 342 // or is it strange in some way (e.g. relative or patched into a series of |
335 // instructions). | 343 // instructions). |
336 bool IsCodedSpecially(); | 344 bool IsCodedSpecially(); |
337 | 345 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT); | 424 (1 << CODE_TARGET_WITH_ID) | kPositionMask | (1 << COMMENT); |
417 static const int kApplyMask; // Modes affected by apply. Depends on arch. | 425 static const int kApplyMask; // Modes affected by apply. Depends on arch. |
418 | 426 |
419 private: | 427 private: |
420 // On ARM, note that pc_ is the address of the constant pool entry | 428 // On ARM, note that pc_ is the address of the constant pool entry |
421 // to be relocated and not the address of the instruction | 429 // to be relocated and not the address of the instruction |
422 // referencing the constant pool entry (except when rmode_ == | 430 // referencing the constant pool entry (except when rmode_ == |
423 // comment). | 431 // comment). |
424 byte* pc_; | 432 byte* pc_; |
425 Mode rmode_; | 433 Mode rmode_; |
426 intptr_t data_; | 434 union { |
| 435 intptr_t data_; |
| 436 double data64_; |
| 437 }; |
427 Code* host_; | 438 Code* host_; |
428 // Code and Embedded Object pointers on some platforms are stored split | 439 // Code and Embedded Object pointers on some platforms are stored split |
429 // across two consecutive 32-bit instructions. Heap management | 440 // across two consecutive 32-bit instructions. Heap management |
430 // routines expect to access these pointers indirectly. The following | 441 // routines expect to access these pointers indirectly. The following |
431 // location provides a place for these pointers to exist naturally | 442 // location provides a place for these pointers to exist naturally |
432 // when accessed via the Iterator. | 443 // when accessed via the Iterator. |
433 Object* reconstructed_obj_ptr_; | 444 Object* reconstructed_obj_ptr_; |
434 // External-reference pointers are also split across instruction-pairs | 445 // External-reference pointers are also split across instruction-pairs |
435 // on some platforms, but are accessed via indirect pointers. This location | 446 // on some platforms, but are accessed via indirect pointers. This location |
436 // provides a place for that pointer to exist naturally. Its address | 447 // provides a place for that pointer to exist naturally. Its address |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 public: | 967 public: |
957 NullCallWrapper() { } | 968 NullCallWrapper() { } |
958 virtual ~NullCallWrapper() { } | 969 virtual ~NullCallWrapper() { } |
959 virtual void BeforeCall(int call_size) const { } | 970 virtual void BeforeCall(int call_size) const { } |
960 virtual void AfterCall() const { } | 971 virtual void AfterCall() const { } |
961 }; | 972 }; |
962 | 973 |
963 } } // namespace v8::internal | 974 } } // namespace v8::internal |
964 | 975 |
965 #endif // V8_ASSEMBLER_H_ | 976 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |