| 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 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1891   static const int kHeaderSize = kMapOffset + kPointerSize; | 1891   static const int kHeaderSize = kMapOffset + kPointerSize; | 
| 1892 | 1892 | 
| 1893   STATIC_CHECK(kMapOffset == Internals::kHeapObjectMapOffset); | 1893   STATIC_CHECK(kMapOffset == Internals::kHeapObjectMapOffset); | 
| 1894 | 1894 | 
| 1895  protected: | 1895  protected: | 
| 1896   // helpers for calling an ObjectVisitor to iterate over pointers in the | 1896   // helpers for calling an ObjectVisitor to iterate over pointers in the | 
| 1897   // half-open range [start, end) specified as integer offsets | 1897   // half-open range [start, end) specified as integer offsets | 
| 1898   inline void IteratePointers(ObjectVisitor* v, int start, int end); | 1898   inline void IteratePointers(ObjectVisitor* v, int start, int end); | 
| 1899   // as above, for the single element at "offset" | 1899   // as above, for the single element at "offset" | 
| 1900   inline void IteratePointer(ObjectVisitor* v, int offset); | 1900   inline void IteratePointer(ObjectVisitor* v, int offset); | 
|  | 1901   // as above, for the next code link of a code object. | 
|  | 1902   inline void IterateNextCodeLink(ObjectVisitor* v, int offset); | 
| 1901 | 1903 | 
| 1902  private: | 1904  private: | 
| 1903   DISALLOW_IMPLICIT_CONSTRUCTORS(HeapObject); | 1905   DISALLOW_IMPLICIT_CONSTRUCTORS(HeapObject); | 
| 1904 }; | 1906 }; | 
| 1905 | 1907 | 
| 1906 | 1908 | 
| 1907 // This class describes a body of an object of a fixed size | 1909 // This class describes a body of an object of a fixed size | 
| 1908 // in which all pointer fields are located in the [start_offset, end_offset) | 1910 // in which all pointer fields are located in the [start_offset, end_offset) | 
| 1909 // interval. | 1911 // interval. | 
| 1910 template<int start_offset, int end_offset, int size> | 1912 template<int start_offset, int end_offset, int size> | 
| (...skipping 3312 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5223   // [handler_table]: Fixed array containing offsets of exception handlers. | 5225   // [handler_table]: Fixed array containing offsets of exception handlers. | 
| 5224   DECL_ACCESSORS(handler_table, FixedArray) | 5226   DECL_ACCESSORS(handler_table, FixedArray) | 
| 5225 | 5227 | 
| 5226   // [deoptimization_data]: Array containing data for deopt. | 5228   // [deoptimization_data]: Array containing data for deopt. | 
| 5227   DECL_ACCESSORS(deoptimization_data, FixedArray) | 5229   DECL_ACCESSORS(deoptimization_data, FixedArray) | 
| 5228 | 5230 | 
| 5229   // [raw_type_feedback_info]: This field stores various things, depending on | 5231   // [raw_type_feedback_info]: This field stores various things, depending on | 
| 5230   // the kind of the code object. | 5232   // the kind of the code object. | 
| 5231   //   FUNCTION           => type feedback information. | 5233   //   FUNCTION           => type feedback information. | 
| 5232   //   STUB               => various things, e.g. a SMI | 5234   //   STUB               => various things, e.g. a SMI | 
| 5233   //   OPTIMIZED_FUNCTION => the next_code_link for optimized code list. |  | 
| 5234   DECL_ACCESSORS(raw_type_feedback_info, Object) | 5235   DECL_ACCESSORS(raw_type_feedback_info, Object) | 
| 5235   inline Object* type_feedback_info(); | 5236   inline Object* type_feedback_info(); | 
| 5236   inline void set_type_feedback_info( | 5237   inline void set_type_feedback_info( | 
| 5237       Object* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 5238       Object* value, WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 
| 5238   inline int stub_info(); | 5239   inline int stub_info(); | 
| 5239   inline void set_stub_info(int info); | 5240   inline void set_stub_info(int info); | 
| 5240 | 5241 | 
| 5241   // [next_code_link]: Link for lists of optimized or deoptimized code. | 5242   // [next_code_link]: Link for lists of optimized or deoptimized code. | 
| 5242   // Note that storage for this field is overlapped with typefeedback_info. | 5243   // Note that storage for this field is overlapped with typefeedback_info. | 
| 5243   DECL_ACCESSORS(next_code_link, Object) | 5244   DECL_ACCESSORS(next_code_link, Object) | 
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 5556   static const int kMaxLoopNestingMarker = 6; | 5557   static const int kMaxLoopNestingMarker = 6; | 
| 5557 | 5558 | 
| 5558   // Layout description. | 5559   // Layout description. | 
| 5559   static const int kInstructionSizeOffset = HeapObject::kHeaderSize; | 5560   static const int kInstructionSizeOffset = HeapObject::kHeaderSize; | 
| 5560   static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; | 5561   static const int kRelocationInfoOffset = kInstructionSizeOffset + kIntSize; | 
| 5561   static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; | 5562   static const int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize; | 
| 5562   static const int kDeoptimizationDataOffset = | 5563   static const int kDeoptimizationDataOffset = | 
| 5563       kHandlerTableOffset + kPointerSize; | 5564       kHandlerTableOffset + kPointerSize; | 
| 5564   static const int kTypeFeedbackInfoOffset = | 5565   static const int kTypeFeedbackInfoOffset = | 
| 5565       kDeoptimizationDataOffset + kPointerSize; | 5566       kDeoptimizationDataOffset + kPointerSize; | 
| 5566   static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset;  // Shared. | 5567   static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset + kPointerSize; | 
| 5567   static const int kGCMetadataOffset = kTypeFeedbackInfoOffset + kPointerSize; | 5568   static const int kGCMetadataOffset = kNextCodeLinkOffset + kPointerSize; | 
| 5568   static const int kICAgeOffset = | 5569   static const int kICAgeOffset = | 
| 5569       kGCMetadataOffset + kPointerSize; | 5570       kGCMetadataOffset + kPointerSize; | 
| 5570   static const int kFlagsOffset = kICAgeOffset + kIntSize; | 5571   static const int kFlagsOffset = kICAgeOffset + kIntSize; | 
| 5571   static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize; | 5572   static const int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize; | 
| 5572   static const int kKindSpecificFlags2Offset = | 5573   static const int kKindSpecificFlags2Offset = | 
| 5573       kKindSpecificFlags1Offset + kIntSize; | 5574       kKindSpecificFlags1Offset + kIntSize; | 
| 5574   // Note: We might be able to squeeze this into the flags above. | 5575   // Note: We might be able to squeeze this into the flags above. | 
| 5575   static const int kPrologueOffset = kKindSpecificFlags2Offset + kIntSize; | 5576   static const int kPrologueOffset = kKindSpecificFlags2Offset + kIntSize; | 
| 5576   static const int kConstantPoolOffset = kPrologueOffset + kPointerSize; | 5577   static const int kConstantPoolOffset = kPrologueOffset + kPointerSize; | 
| 5577 | 5578 | 
| (...skipping 5123 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 10701  public: | 10702  public: | 
| 10702   virtual ~ObjectVisitor() {} | 10703   virtual ~ObjectVisitor() {} | 
| 10703 | 10704 | 
| 10704   // Visits a contiguous arrays of pointers in the half-open range | 10705   // Visits a contiguous arrays of pointers in the half-open range | 
| 10705   // [start, end). Any or all of the values may be modified on return. | 10706   // [start, end). Any or all of the values may be modified on return. | 
| 10706   virtual void VisitPointers(Object** start, Object** end) = 0; | 10707   virtual void VisitPointers(Object** start, Object** end) = 0; | 
| 10707 | 10708 | 
| 10708   // Handy shorthand for visiting a single pointer. | 10709   // Handy shorthand for visiting a single pointer. | 
| 10709   virtual void VisitPointer(Object** p) { VisitPointers(p, p + 1); } | 10710   virtual void VisitPointer(Object** p) { VisitPointers(p, p + 1); } | 
| 10710 | 10711 | 
|  | 10712   // Visit weak next_code_link in Code object. | 
|  | 10713   virtual void VisitNextCodeLink(Object** p) { VisitPointers(p, p + 1); } | 
|  | 10714 | 
| 10711   // To allow lazy clearing of inline caches the visitor has | 10715   // To allow lazy clearing of inline caches the visitor has | 
| 10712   // a rich interface for iterating over Code objects.. | 10716   // a rich interface for iterating over Code objects.. | 
| 10713 | 10717 | 
| 10714   // Visits a code target in the instruction stream. | 10718   // Visits a code target in the instruction stream. | 
| 10715   virtual void VisitCodeTarget(RelocInfo* rinfo); | 10719   virtual void VisitCodeTarget(RelocInfo* rinfo); | 
| 10716 | 10720 | 
| 10717   // Visits a code entry in a JS function. | 10721   // Visits a code entry in a JS function. | 
| 10718   virtual void VisitCodeEntry(Address entry_address); | 10722   virtual void VisitCodeEntry(Address entry_address); | 
| 10719 | 10723 | 
| 10720   // Visits a global property cell reference in the instruction stream. | 10724   // Visits a global property cell reference in the instruction stream. | 
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 10786     } else { | 10790     } else { | 
| 10787       value &= ~(1 << bit_position); | 10791       value &= ~(1 << bit_position); | 
| 10788     } | 10792     } | 
| 10789     return value; | 10793     return value; | 
| 10790   } | 10794   } | 
| 10791 }; | 10795 }; | 
| 10792 | 10796 | 
| 10793 } }  // namespace v8::internal | 10797 } }  // namespace v8::internal | 
| 10794 | 10798 | 
| 10795 #endif  // V8_OBJECTS_H_ | 10799 #endif  // V8_OBJECTS_H_ | 
| OLD | NEW | 
|---|