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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 // Since Smi and Failure are subclasses of Object no | 783 // Since Smi and Failure are subclasses of Object no |
784 // data members can be present in Object. | 784 // data members can be present in Object. |
785 class Object BASE_EMBEDDED { | 785 class Object BASE_EMBEDDED { |
786 public: | 786 public: |
787 // Type testing. | 787 // Type testing. |
788 inline bool IsSmi(); | 788 inline bool IsSmi(); |
789 inline bool IsHeapObject(); | 789 inline bool IsHeapObject(); |
790 inline bool IsHeapNumber(); | 790 inline bool IsHeapNumber(); |
791 inline bool IsString(); | 791 inline bool IsString(); |
792 inline bool IsSymbol(); | 792 inline bool IsSymbol(); |
793 #ifdef DEBUG | |
794 // See objects-inl.h for more details | 793 // See objects-inl.h for more details |
795 inline bool IsSeqString(); | 794 inline bool IsSeqString(); |
796 inline bool IsSlicedString(); | 795 inline bool IsSlicedString(); |
797 inline bool IsExternalString(); | 796 inline bool IsExternalString(); |
798 inline bool IsExternalTwoByteString(); | 797 inline bool IsExternalTwoByteString(); |
799 inline bool IsExternalAsciiString(); | 798 inline bool IsExternalAsciiString(); |
800 inline bool IsSeqTwoByteString(); | 799 inline bool IsSeqTwoByteString(); |
801 inline bool IsSeqAsciiString(); | 800 inline bool IsSeqAsciiString(); |
802 #endif // DEBUG | |
803 inline bool IsConsString(); | 801 inline bool IsConsString(); |
804 | 802 |
805 inline bool IsNumber(); | 803 inline bool IsNumber(); |
806 inline bool IsByteArray(); | 804 inline bool IsByteArray(); |
807 inline bool IsPixelArray(); | 805 inline bool IsPixelArray(); |
808 inline bool IsExternalArray(); | 806 inline bool IsExternalArray(); |
809 inline bool IsExternalByteArray(); | 807 inline bool IsExternalByteArray(); |
810 inline bool IsExternalUnsignedByteArray(); | 808 inline bool IsExternalUnsignedByteArray(); |
811 inline bool IsExternalShortArray(); | 809 inline bool IsExternalShortArray(); |
812 inline bool IsExternalUnsignedShortArray(); | 810 inline bool IsExternalUnsignedShortArray(); |
(...skipping 3618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4431 // The underlying resource. | 4429 // The underlying resource. |
4432 inline Resource* resource(); | 4430 inline Resource* resource(); |
4433 inline void set_resource(Resource* buffer); | 4431 inline void set_resource(Resource* buffer); |
4434 | 4432 |
4435 // Dispatched behavior. | 4433 // Dispatched behavior. |
4436 uint16_t ExternalAsciiStringGet(int index); | 4434 uint16_t ExternalAsciiStringGet(int index); |
4437 | 4435 |
4438 // Casting. | 4436 // Casting. |
4439 static inline ExternalAsciiString* cast(Object* obj); | 4437 static inline ExternalAsciiString* cast(Object* obj); |
4440 | 4438 |
| 4439 // Garbage collection support. |
| 4440 void ExternalAsciiStringIterateBody(ObjectVisitor* v); |
| 4441 |
4441 // Support for StringInputBuffer. | 4442 // Support for StringInputBuffer. |
4442 const unibrow::byte* ExternalAsciiStringReadBlock(unsigned* remaining, | 4443 const unibrow::byte* ExternalAsciiStringReadBlock(unsigned* remaining, |
4443 unsigned* offset, | 4444 unsigned* offset, |
4444 unsigned chars); | 4445 unsigned chars); |
4445 inline void ExternalAsciiStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, | 4446 inline void ExternalAsciiStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, |
4446 unsigned* offset, | 4447 unsigned* offset, |
4447 unsigned chars); | 4448 unsigned chars); |
4448 | 4449 |
4449 // Identify the map for the external string/symbol with a particular length. | 4450 // Identify the map for the external string/symbol with a particular length. |
4450 static inline Map* StringMap(int length); | 4451 static inline Map* StringMap(int length); |
(...skipping 15 matching lines...) Expand all Loading... |
4466 | 4467 |
4467 // Dispatched behavior. | 4468 // Dispatched behavior. |
4468 uint16_t ExternalTwoByteStringGet(int index); | 4469 uint16_t ExternalTwoByteStringGet(int index); |
4469 | 4470 |
4470 // For regexp code. | 4471 // For regexp code. |
4471 const uint16_t* ExternalTwoByteStringGetData(unsigned start); | 4472 const uint16_t* ExternalTwoByteStringGetData(unsigned start); |
4472 | 4473 |
4473 // Casting. | 4474 // Casting. |
4474 static inline ExternalTwoByteString* cast(Object* obj); | 4475 static inline ExternalTwoByteString* cast(Object* obj); |
4475 | 4476 |
| 4477 // Garbage collection support. |
| 4478 void ExternalTwoByteStringIterateBody(ObjectVisitor* v); |
| 4479 |
4476 // Support for StringInputBuffer. | 4480 // Support for StringInputBuffer. |
4477 void ExternalTwoByteStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, | 4481 void ExternalTwoByteStringReadBlockIntoBuffer(ReadBlockBuffer* buffer, |
4478 unsigned* offset_ptr, | 4482 unsigned* offset_ptr, |
4479 unsigned chars); | 4483 unsigned chars); |
4480 | 4484 |
4481 // Identify the map for the external string/symbol with a particular length. | 4485 // Identify the map for the external string/symbol with a particular length. |
4482 static inline Map* StringMap(int length); | 4486 static inline Map* StringMap(int length); |
4483 static inline Map* SymbolMap(int length); | 4487 static inline Map* SymbolMap(int length); |
4484 private: | 4488 private: |
4485 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalTwoByteString); | 4489 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalTwoByteString); |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5097 | 5101 |
5098 // To allow lazy clearing of inline caches the visitor has | 5102 // To allow lazy clearing of inline caches the visitor has |
5099 // a rich interface for iterating over Code objects.. | 5103 // a rich interface for iterating over Code objects.. |
5100 | 5104 |
5101 // Visits a code target in the instruction stream. | 5105 // Visits a code target in the instruction stream. |
5102 virtual void VisitCodeTarget(RelocInfo* rinfo); | 5106 virtual void VisitCodeTarget(RelocInfo* rinfo); |
5103 | 5107 |
5104 // Visits a runtime entry in the instruction stream. | 5108 // Visits a runtime entry in the instruction stream. |
5105 virtual void VisitRuntimeEntry(RelocInfo* rinfo) {} | 5109 virtual void VisitRuntimeEntry(RelocInfo* rinfo) {} |
5106 | 5110 |
| 5111 // Visits the resource of an ASCII or two-byte string. |
| 5112 virtual void VisitExternalAsciiString( |
| 5113 v8::String::ExternalAsciiStringResource** resource) {} |
| 5114 virtual void VisitExternalTwoByteString( |
| 5115 v8::String::ExternalStringResource** resource) {} |
| 5116 |
5107 // Visits a debug call target in the instruction stream. | 5117 // Visits a debug call target in the instruction stream. |
5108 virtual void VisitDebugTarget(RelocInfo* rinfo); | 5118 virtual void VisitDebugTarget(RelocInfo* rinfo); |
5109 | 5119 |
5110 // Handy shorthand for visiting a single pointer. | 5120 // Handy shorthand for visiting a single pointer. |
5111 virtual void VisitPointer(Object** p) { VisitPointers(p, p + 1); } | 5121 virtual void VisitPointer(Object** p) { VisitPointers(p, p + 1); } |
5112 | 5122 |
5113 // Visits a contiguous arrays of external references (references to the C++ | 5123 // Visits a contiguous arrays of external references (references to the C++ |
5114 // heap) in the half-open range [start, end). Any or all of the values | 5124 // heap) in the half-open range [start, end). Any or all of the values |
5115 // may be modified on return. | 5125 // may be modified on return. |
5116 virtual void VisitExternalReferences(Address* start, Address* end) {} | 5126 virtual void VisitExternalReferences(Address* start, Address* end) {} |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5151 } else { | 5161 } else { |
5152 value &= ~(1 << bit_position); | 5162 value &= ~(1 << bit_position); |
5153 } | 5163 } |
5154 return value; | 5164 return value; |
5155 } | 5165 } |
5156 }; | 5166 }; |
5157 | 5167 |
5158 } } // namespace v8::internal | 5168 } } // namespace v8::internal |
5159 | 5169 |
5160 #endif // V8_OBJECTS_H_ | 5170 #endif // V8_OBJECTS_H_ |
OLD | NEW |