OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2725 static const char* Kind2String(Kind kind); | 2725 static const char* Kind2String(Kind kind); |
2726 static const char* ICState2String(InlineCacheState state); | 2726 static const char* ICState2String(InlineCacheState state); |
2727 static const char* PropertyType2String(PropertyType type); | 2727 static const char* PropertyType2String(PropertyType type); |
2728 void Disassemble(const char* name); | 2728 void Disassemble(const char* name); |
2729 #endif // ENABLE_DISASSEMBLER | 2729 #endif // ENABLE_DISASSEMBLER |
2730 | 2730 |
2731 // [instruction_size]: Size of the native instructions | 2731 // [instruction_size]: Size of the native instructions |
2732 inline int instruction_size(); | 2732 inline int instruction_size(); |
2733 inline void set_instruction_size(int value); | 2733 inline void set_instruction_size(int value); |
2734 | 2734 |
2735 // [relocation_size]: Size of relocation information. | 2735 // [relocation_info]: Code relocation information |
| 2736 DECL_ACCESSORS(relocation_info, ByteArray) |
| 2737 |
| 2738 // Unchecked accessor to be used during GC. |
| 2739 inline ByteArray* unchecked_relocation_info(); |
| 2740 |
2736 inline int relocation_size(); | 2741 inline int relocation_size(); |
2737 inline void set_relocation_size(int value); | |
2738 | 2742 |
2739 // [sinfo_size]: Size of scope information. | 2743 // [sinfo_size]: Size of scope information. |
2740 inline int sinfo_size(); | 2744 inline int sinfo_size(); |
2741 inline void set_sinfo_size(int value); | 2745 inline void set_sinfo_size(int value); |
2742 | 2746 |
2743 // [flags]: Various code flags. | 2747 // [flags]: Various code flags. |
2744 inline Flags flags(); | 2748 inline Flags flags(); |
2745 inline void set_flags(Flags flags); | 2749 inline void set_flags(Flags flags); |
2746 | 2750 |
2747 // [flags]: Access to specific code flags. | 2751 // [flags]: Access to specific code flags. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2783 static inline PropertyType ExtractTypeFromFlags(Flags flags); | 2787 static inline PropertyType ExtractTypeFromFlags(Flags flags); |
2784 static inline int ExtractArgumentsCountFromFlags(Flags flags); | 2788 static inline int ExtractArgumentsCountFromFlags(Flags flags); |
2785 static inline Flags RemoveTypeFromFlags(Flags flags); | 2789 static inline Flags RemoveTypeFromFlags(Flags flags); |
2786 | 2790 |
2787 // Convert a target address into a code object. | 2791 // Convert a target address into a code object. |
2788 static inline Code* GetCodeFromTargetAddress(Address address); | 2792 static inline Code* GetCodeFromTargetAddress(Address address); |
2789 | 2793 |
2790 // Returns the address of the first instruction. | 2794 // Returns the address of the first instruction. |
2791 inline byte* instruction_start(); | 2795 inline byte* instruction_start(); |
2792 | 2796 |
| 2797 // Returns the address right after the last instruction. |
| 2798 inline byte* instruction_end(); |
| 2799 |
2793 // Returns the size of the instructions, padding, and relocation information. | 2800 // Returns the size of the instructions, padding, and relocation information. |
2794 inline int body_size(); | 2801 inline int body_size(); |
2795 | 2802 |
2796 // Returns the address of the first relocation info (read backwards!). | 2803 // Returns the address of the first relocation info (read backwards!). |
2797 inline byte* relocation_start(); | 2804 inline byte* relocation_start(); |
2798 | 2805 |
2799 // Code entry point. | 2806 // Code entry point. |
2800 inline byte* entry(); | 2807 inline byte* entry(); |
2801 | 2808 |
2802 // Returns true if pc is inside this object's instructions. | 2809 // Returns true if pc is inside this object's instructions. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2843 void CodePrint(); | 2850 void CodePrint(); |
2844 void CodeVerify(); | 2851 void CodeVerify(); |
2845 #endif | 2852 #endif |
2846 // Code entry points are aligned to 32 bytes. | 2853 // Code entry points are aligned to 32 bytes. |
2847 static const int kCodeAlignmentBits = 5; | 2854 static const int kCodeAlignmentBits = 5; |
2848 static const int kCodeAlignment = 1 << kCodeAlignmentBits; | 2855 static const int kCodeAlignment = 1 << kCodeAlignmentBits; |
2849 static const int kCodeAlignmentMask = kCodeAlignment - 1; | 2856 static const int kCodeAlignmentMask = kCodeAlignment - 1; |
2850 | 2857 |
2851 // Layout description. | 2858 // Layout description. |
2852 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; | 2859 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; |
2853 static const int kRelocationSizeOffset = kInstructionSizeOffset + kIntSize; | 2860 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; |
2854 static const int kSInfoSizeOffset = kRelocationSizeOffset + kIntSize; | 2861 static const int kSInfoSizeOffset = kRelocationInfoOffset + kPointerSize; |
2855 static const int kFlagsOffset = kSInfoSizeOffset + kIntSize; | 2862 static const int kFlagsOffset = kSInfoSizeOffset + kIntSize; |
2856 static const int kKindSpecificFlagsOffset = kFlagsOffset + kIntSize; | 2863 static const int kKindSpecificFlagsOffset = kFlagsOffset + kIntSize; |
2857 // Add padding to align the instruction start following right after | 2864 // Add padding to align the instruction start following right after |
2858 // the Code object header. | 2865 // the Code object header. |
2859 static const int kHeaderSize = | 2866 static const int kHeaderSize = |
2860 (kKindSpecificFlagsOffset + kIntSize + kCodeAlignmentMask) & | 2867 (kKindSpecificFlagsOffset + kIntSize + kCodeAlignmentMask) & |
2861 ~kCodeAlignmentMask; | 2868 ~kCodeAlignmentMask; |
2862 | 2869 |
2863 // Byte offsets within kKindSpecificFlagsOffset. | 2870 // Byte offsets within kKindSpecificFlagsOffset. |
2864 static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset + 1; | 2871 static const int kStubMajorKeyOffset = kKindSpecificFlagsOffset + 1; |
(...skipping 2473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5338 } else { | 5345 } else { |
5339 value &= ~(1 << bit_position); | 5346 value &= ~(1 << bit_position); |
5340 } | 5347 } |
5341 return value; | 5348 return value; |
5342 } | 5349 } |
5343 }; | 5350 }; |
5344 | 5351 |
5345 } } // namespace v8::internal | 5352 } } // namespace v8::internal |
5346 | 5353 |
5347 #endif // V8_OBJECTS_H_ | 5354 #endif // V8_OBJECTS_H_ |
OLD | NEW |