| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1886 static const int kHeaderSize = kMapOffset + kPointerSize; | 1886 static const int kHeaderSize = kMapOffset + kPointerSize; |
| 1887 | 1887 |
| 1888 STATIC_CHECK(kMapOffset == Internals::kHeapObjectMapOffset); | 1888 STATIC_CHECK(kMapOffset == Internals::kHeapObjectMapOffset); |
| 1889 | 1889 |
| 1890 protected: | 1890 protected: |
| 1891 // helpers for calling an ObjectVisitor to iterate over pointers in the | 1891 // helpers for calling an ObjectVisitor to iterate over pointers in the |
| 1892 // half-open range [start, end) specified as integer offsets | 1892 // half-open range [start, end) specified as integer offsets |
| 1893 inline void IteratePointers(ObjectVisitor* v, int start, int end); | 1893 inline void IteratePointers(ObjectVisitor* v, int start, int end); |
| 1894 // as above, for the single element at "offset" | 1894 // as above, for the single element at "offset" |
| 1895 inline void IteratePointer(ObjectVisitor* v, int offset); | 1895 inline void IteratePointer(ObjectVisitor* v, int offset); |
| 1896 // as above, for the next code link of a code object. |
| 1897 inline void IterateNextCodeLink(ObjectVisitor* v, int offset); |
| 1896 | 1898 |
| 1897 private: | 1899 private: |
| 1898 DISALLOW_IMPLICIT_CONSTRUCTORS(HeapObject); | 1900 DISALLOW_IMPLICIT_CONSTRUCTORS(HeapObject); |
| 1899 }; | 1901 }; |
| 1900 | 1902 |
| 1901 | 1903 |
| 1902 // This class describes a body of an object of a fixed size | 1904 // This class describes a body of an object of a fixed size |
| 1903 // in which all pointer fields are located in the [start_offset, end_offset) | 1905 // in which all pointer fields are located in the [start_offset, end_offset) |
| 1904 // interval. | 1906 // interval. |
| 1905 template<int start_offset, int end_offset, int size> | 1907 template<int start_offset, int end_offset, int size> |
| (...skipping 3285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5191 // [handler_table]: Fixed array containing offsets of exception handlers. | 5193 // [handler_table]: Fixed array containing offsets of exception handlers. |
| 5192 DECL_ACCESSORS(handler_table, FixedArray) | 5194 DECL_ACCESSORS(handler_table, FixedArray) |
| 5193 | 5195 |
| 5194 // [deoptimization_data]: Array containing data for deopt. | 5196 // [deoptimization_data]: Array containing data for deopt. |
| 5195 DECL_ACCESSORS(deoptimization_data, FixedArray) | 5197 DECL_ACCESSORS(deoptimization_data, FixedArray) |
| 5196 | 5198 |
| 5197 // [raw_type_feedback_info]: This field stores various things, depending on | 5199 // [raw_type_feedback_info]: This field stores various things, depending on |
| 5198 // the kind of the code object. | 5200 // the kind of the code object. |
| 5199 // FUNCTION => type feedback information. | 5201 // FUNCTION => type feedback information. |
| 5200 // STUB => various things, e.g. a SMI | 5202 // STUB => various things, e.g. a SMI |
| 5201 // OPTIMIZED_FUNCTION => the next_code_link for optimized code list. | |
| 5202 DECL_ACCESSORS(raw_type_feedback_info, Object) | 5203 DECL_ACCESSORS(raw_type_feedback_info, Object) |
| 5203 inline Object* type_feedback_info(); | 5204 inline Object* type_feedback_info(); |
| 5204 inline void set_type_feedback_info( | 5205 inline void set_type_feedback_info( |
| 5205 Object* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 5206 Object* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
| 5206 inline int stub_info(); | 5207 inline int stub_info(); |
| 5207 inline void set_stub_info(int info); | 5208 inline void set_stub_info(int info); |
| 5208 | 5209 |
| 5209 // [next_code_link]: Link for lists of optimized or deoptimized code. | 5210 // [next_code_link]: Link for lists of optimized or deoptimized code. |
| 5210 // Note that storage for this field is overlapped with typefeedback_info. | 5211 // Note that storage for this field is overlapped with typefeedback_info. |
| 5211 DECL_ACCESSORS(next_code_link, Object) | 5212 DECL_ACCESSORS(next_code_link, Object) |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5521 static const int kMaxLoopNestingMarker = 6; | 5522 static const int kMaxLoopNestingMarker = 6; |
| 5522 | 5523 |
| 5523 // Layout description. | 5524 // Layout description. |
| 5524 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; | 5525 static const int kInstructionSizeOffset = HeapObject::kHeaderSize; |
| 5525 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; | 5526 static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; |
| 5526 static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; | 5527 static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; |
| 5527 static const int kDeoptimizationDataOffset = | 5528 static const int kDeoptimizationDataOffset = |
| 5528 kHandlerTableOffset + kPointerSize; | 5529 kHandlerTableOffset + kPointerSize; |
| 5529 static const int kTypeFeedbackInfoOffset = | 5530 static const int kTypeFeedbackInfoOffset = |
| 5530 kDeoptimizationDataOffset + kPointerSize; | 5531 kDeoptimizationDataOffset + kPointerSize; |
| 5531 static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset; // Shared. | 5532 static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset + kPointerSize; |
| 5532 static const int kGCMetadataOffset = kTypeFeedbackInfoOffset + kPointerSize; | 5533 static const int kGCMetadataOffset = kNextCodeLinkOffset + kPointerSize; |
| 5533 static const int kICAgeOffset = | 5534 static const int kICAgeOffset = |
| 5534 kGCMetadataOffset + kPointerSize; | 5535 kGCMetadataOffset + kPointerSize; |
| 5535 static const int kFlagsOffset = kICAgeOffset + kIntSize; | 5536 static const int kFlagsOffset = kICAgeOffset + kIntSize; |
| 5536 static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize; | 5537 static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize; |
| 5537 static const int kKindSpecificFlags2Offset = | 5538 static const int kKindSpecificFlags2Offset = |
| 5538 kKindSpecificFlags1Offset + kIntSize; | 5539 kKindSpecificFlags1Offset + kIntSize; |
| 5539 // Note: We might be able to squeeze this into the flags above. | 5540 // Note: We might be able to squeeze this into the flags above. |
| 5540 static const int kPrologueOffset = kKindSpecificFlags2Offset + kIntSize; | 5541 static const int kPrologueOffset = kKindSpecificFlags2Offset + kIntSize; |
| 5541 static const int kConstantPoolOffset = kPrologueOffset + kPointerSize; | 5542 static const int kConstantPoolOffset = kPrologueOffset + kPointerSize; |
| 5542 | 5543 |
| (...skipping 5149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10692 public: | 10693 public: |
| 10693 virtual ~ObjectVisitor() {} | 10694 virtual ~ObjectVisitor() {} |
| 10694 | 10695 |
| 10695 // Visits a contiguous arrays of pointers in the half-open range | 10696 // Visits a contiguous arrays of pointers in the half-open range |
| 10696 // [start, end). Any or all of the values may be modified on return. | 10697 // [start, end). Any or all of the values may be modified on return. |
| 10697 virtual void VisitPointers(Object** start, Object** end) = 0; | 10698 virtual void VisitPointers(Object** start, Object** end) = 0; |
| 10698 | 10699 |
| 10699 // Handy shorthand for visiting a single pointer. | 10700 // Handy shorthand for visiting a single pointer. |
| 10700 virtual void VisitPointer(Object** p) { VisitPointers(p, p + 1); } | 10701 virtual void VisitPointer(Object** p) { VisitPointers(p, p + 1); } |
| 10701 | 10702 |
| 10703 // Visit weak next_code_link in Code object. |
| 10704 virtual void VisitNextCodeLink(Object** p) { VisitPointers(p, p + 1); } |
| 10705 |
| 10702 // To allow lazy clearing of inline caches the visitor has | 10706 // To allow lazy clearing of inline caches the visitor has |
| 10703 // a rich interface for iterating over Code objects.. | 10707 // a rich interface for iterating over Code objects.. |
| 10704 | 10708 |
| 10705 // Visits a code target in the instruction stream. | 10709 // Visits a code target in the instruction stream. |
| 10706 virtual void VisitCodeTarget(RelocInfo* rinfo); | 10710 virtual void VisitCodeTarget(RelocInfo* rinfo); |
| 10707 | 10711 |
| 10708 // Visits a code entry in a JS function. | 10712 // Visits a code entry in a JS function. |
| 10709 virtual void VisitCodeEntry(Address entry_address); | 10713 virtual void VisitCodeEntry(Address entry_address); |
| 10710 | 10714 |
| 10711 // Visits a global property cell reference in the instruction stream. | 10715 // Visits a global property cell reference in the instruction stream. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10777 } else { | 10781 } else { |
| 10778 value &= ~(1 << bit_position); | 10782 value &= ~(1 << bit_position); |
| 10779 } | 10783 } |
| 10780 return value; | 10784 return value; |
| 10781 } | 10785 } |
| 10782 }; | 10786 }; |
| 10783 | 10787 |
| 10784 } } // namespace v8::internal | 10788 } } // namespace v8::internal |
| 10785 | 10789 |
| 10786 #endif // V8_OBJECTS_H_ | 10790 #endif // V8_OBJECTS_H_ |
| OLD | NEW |