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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // Everything after runtime_entry (inclusive) is not GC'ed. | 269 // Everything after runtime_entry (inclusive) is not GC'ed. |
270 RUNTIME_ENTRY, | 270 RUNTIME_ENTRY, |
271 JS_RETURN, // Marks start of the ExitJSFrame code. | 271 JS_RETURN, // Marks start of the ExitJSFrame code. |
272 COMMENT, | 272 COMMENT, |
273 POSITION, // See comment for kNoPosition above. | 273 POSITION, // See comment for kNoPosition above. |
274 STATEMENT_POSITION, // See comment for kNoPosition above. | 274 STATEMENT_POSITION, // See comment for kNoPosition above. |
275 DEBUG_BREAK_SLOT, // Additional code inserted for debug break slot. | 275 DEBUG_BREAK_SLOT, // Additional code inserted for debug break slot. |
276 EXTERNAL_REFERENCE, // The address of an external C++ function. | 276 EXTERNAL_REFERENCE, // The address of an external C++ function. |
277 INTERNAL_REFERENCE, // An address inside the same function. | 277 INTERNAL_REFERENCE, // An address inside the same function. |
278 | 278 |
279 // Marks a constant pool. Only used on ARM. | 279 // Marks constant and veneer pools. Only used on ARM and A64. |
280 // It uses a custom noncompact encoding. | 280 // They use a custom noncompact encoding. |
281 CONST_POOL, | 281 CONST_POOL, |
| 282 VENEER_POOL, |
282 | 283 |
283 // add more as needed | 284 // add more as needed |
284 // Pseudo-types | 285 // Pseudo-types |
285 NUMBER_OF_MODES, // There are at most 15 modes with noncompact encoding. | 286 NUMBER_OF_MODES, // There are at most 15 modes with noncompact encoding. |
286 NONE32, // never recorded 32-bit value | 287 NONE32, // never recorded 32-bit value |
287 NONE64, // never recorded 64-bit value | 288 NONE64, // never recorded 64-bit value |
288 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by | 289 CODE_AGE_SEQUENCE, // Not stored in RelocInfo array, used explictly by |
289 // code aging. | 290 // code aging. |
290 FIRST_REAL_RELOC_MODE = CODE_TARGET, | 291 FIRST_REAL_RELOC_MODE = CODE_TARGET, |
291 LAST_REAL_RELOC_MODE = CONST_POOL, | 292 LAST_REAL_RELOC_MODE = VENEER_POOL, |
292 FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, | 293 FIRST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, |
293 LAST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, | 294 LAST_PSEUDO_RELOC_MODE = CODE_AGE_SEQUENCE, |
294 LAST_CODE_ENUM = DEBUG_BREAK, | 295 LAST_CODE_ENUM = DEBUG_BREAK, |
295 LAST_GCED_ENUM = CELL, | 296 LAST_GCED_ENUM = CELL, |
296 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. | 297 // Modes <= LAST_COMPACT_ENUM are guaranteed to have compact encoding. |
297 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, | 298 LAST_COMPACT_ENUM = CODE_TARGET_WITH_ID, |
298 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE | 299 LAST_STANDARD_NONCOMPACT_ENUM = INTERNAL_REFERENCE |
299 }; | 300 }; |
300 | 301 |
301 | 302 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 } | 336 } |
336 static inline bool IsJSReturn(Mode mode) { | 337 static inline bool IsJSReturn(Mode mode) { |
337 return mode == JS_RETURN; | 338 return mode == JS_RETURN; |
338 } | 339 } |
339 static inline bool IsComment(Mode mode) { | 340 static inline bool IsComment(Mode mode) { |
340 return mode == COMMENT; | 341 return mode == COMMENT; |
341 } | 342 } |
342 static inline bool IsConstPool(Mode mode) { | 343 static inline bool IsConstPool(Mode mode) { |
343 return mode == CONST_POOL; | 344 return mode == CONST_POOL; |
344 } | 345 } |
| 346 static inline bool IsVeneerPool(Mode mode) { |
| 347 return mode == VENEER_POOL; |
| 348 } |
345 static inline bool IsPosition(Mode mode) { | 349 static inline bool IsPosition(Mode mode) { |
346 return mode == POSITION || mode == STATEMENT_POSITION; | 350 return mode == POSITION || mode == STATEMENT_POSITION; |
347 } | 351 } |
348 static inline bool IsStatementPosition(Mode mode) { | 352 static inline bool IsStatementPosition(Mode mode) { |
349 return mode == STATEMENT_POSITION; | 353 return mode == STATEMENT_POSITION; |
350 } | 354 } |
351 static inline bool IsExternalReference(Mode mode) { | 355 static inline bool IsExternalReference(Mode mode) { |
352 return mode == EXTERNAL_REFERENCE; | 356 return mode == EXTERNAL_REFERENCE; |
353 } | 357 } |
354 static inline bool IsInternalReference(Mode mode) { | 358 static inline bool IsInternalReference(Mode mode) { |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 // On ia32 and arm this is 1 + 4 + 1 + 1 + 1 + 4 = 12. | 534 // On ia32 and arm this is 1 + 4 + 1 + 1 + 1 + 4 = 12. |
531 // On x64 this is 1 + 4 + 1 + 1 + 1 + 8 == 16; | 535 // On x64 this is 1 + 4 + 1 + 1 + 1 + 8 == 16; |
532 // Here we use the maximum of the two. | 536 // Here we use the maximum of the two. |
533 static const int kMaxSize = 16; | 537 static const int kMaxSize = 16; |
534 | 538 |
535 private: | 539 private: |
536 inline uint32_t WriteVariableLengthPCJump(uint32_t pc_delta); | 540 inline uint32_t WriteVariableLengthPCJump(uint32_t pc_delta); |
537 inline void WriteTaggedPC(uint32_t pc_delta, int tag); | 541 inline void WriteTaggedPC(uint32_t pc_delta, int tag); |
538 inline void WriteExtraTaggedPC(uint32_t pc_delta, int extra_tag); | 542 inline void WriteExtraTaggedPC(uint32_t pc_delta, int extra_tag); |
539 inline void WriteExtraTaggedIntData(int data_delta, int top_tag); | 543 inline void WriteExtraTaggedIntData(int data_delta, int top_tag); |
540 inline void WriteExtraTaggedConstPoolData(int data); | 544 inline void WriteExtraTaggedPoolData(int data, int pool_type); |
541 inline void WriteExtraTaggedData(intptr_t data_delta, int top_tag); | 545 inline void WriteExtraTaggedData(intptr_t data_delta, int top_tag); |
542 inline void WriteTaggedData(intptr_t data_delta, int tag); | 546 inline void WriteTaggedData(intptr_t data_delta, int tag); |
543 inline void WriteExtraTag(int extra_tag, int top_tag); | 547 inline void WriteExtraTag(int extra_tag, int top_tag); |
544 | 548 |
545 byte* pos_; | 549 byte* pos_; |
546 byte* last_pc_; | 550 byte* last_pc_; |
547 int last_id_; | 551 int last_id_; |
548 int last_position_; | 552 int last_position_; |
549 DISALLOW_COPY_AND_ASSIGN(RelocInfoWriter); | 553 DISALLOW_COPY_AND_ASSIGN(RelocInfoWriter); |
550 }; | 554 }; |
(...skipping 30 matching lines...) Expand all Loading... |
581 // Advance* moves the position before/after reading. | 585 // Advance* moves the position before/after reading. |
582 // *Read* reads from current byte(s) into rinfo_. | 586 // *Read* reads from current byte(s) into rinfo_. |
583 // *Get* just reads and returns info on current byte. | 587 // *Get* just reads and returns info on current byte. |
584 void Advance(int bytes = 1) { pos_ -= bytes; } | 588 void Advance(int bytes = 1) { pos_ -= bytes; } |
585 int AdvanceGetTag(); | 589 int AdvanceGetTag(); |
586 int GetExtraTag(); | 590 int GetExtraTag(); |
587 int GetTopTag(); | 591 int GetTopTag(); |
588 void ReadTaggedPC(); | 592 void ReadTaggedPC(); |
589 void AdvanceReadPC(); | 593 void AdvanceReadPC(); |
590 void AdvanceReadId(); | 594 void AdvanceReadId(); |
591 void AdvanceReadConstPoolData(); | 595 void AdvanceReadPoolData(); |
592 void AdvanceReadPosition(); | 596 void AdvanceReadPosition(); |
593 void AdvanceReadData(); | 597 void AdvanceReadData(); |
594 void AdvanceReadVariableLengthPCJump(); | 598 void AdvanceReadVariableLengthPCJump(); |
595 int GetLocatableTypeTag(); | 599 int GetLocatableTypeTag(); |
596 void ReadTaggedId(); | 600 void ReadTaggedId(); |
597 void ReadTaggedPosition(); | 601 void ReadTaggedPosition(); |
598 | 602 |
599 // If the given mode is wanted, set it in rinfo_ and return true. | 603 // If the given mode is wanted, set it in rinfo_ and return true. |
600 // Else return false. Used for efficiently skipping unwanted modes. | 604 // Else return false. Used for efficiently skipping unwanted modes. |
601 bool SetMode(RelocInfo::Mode mode) { | 605 bool SetMode(RelocInfo::Mode mode) { |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 public: | 1037 public: |
1034 NullCallWrapper() { } | 1038 NullCallWrapper() { } |
1035 virtual ~NullCallWrapper() { } | 1039 virtual ~NullCallWrapper() { } |
1036 virtual void BeforeCall(int call_size) const { } | 1040 virtual void BeforeCall(int call_size) const { } |
1037 virtual void AfterCall() const { } | 1041 virtual void AfterCall() const { } |
1038 }; | 1042 }; |
1039 | 1043 |
1040 } } // namespace v8::internal | 1044 } } // namespace v8::internal |
1041 | 1045 |
1042 #endif // V8_ASSEMBLER_H_ | 1046 #endif // V8_ASSEMBLER_H_ |
OLD | NEW |