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 10322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10333 // Abstract base class for visiting, and optionally modifying, the | 10333 // Abstract base class for visiting, and optionally modifying, the |
10334 // pointers contained in Objects. Used in GC and serialization/deserialization. | 10334 // pointers contained in Objects. Used in GC and serialization/deserialization. |
10335 class ObjectVisitor BASE_EMBEDDED { | 10335 class ObjectVisitor BASE_EMBEDDED { |
10336 public: | 10336 public: |
10337 virtual ~ObjectVisitor() {} | 10337 virtual ~ObjectVisitor() {} |
10338 | 10338 |
10339 // Visits a contiguous arrays of pointers in the half-open range | 10339 // Visits a contiguous arrays of pointers in the half-open range |
10340 // [start, end). Any or all of the values may be modified on return. | 10340 // [start, end). Any or all of the values may be modified on return. |
10341 virtual void VisitPointers(Object** start, Object** end) = 0; | 10341 virtual void VisitPointers(Object** start, Object** end) = 0; |
10342 | 10342 |
| 10343 // Handy shorthand for visiting a single pointer. |
| 10344 virtual void VisitPointer(Object** p) { VisitPointers(p, p + 1); } |
| 10345 |
10343 // To allow lazy clearing of inline caches the visitor has | 10346 // To allow lazy clearing of inline caches the visitor has |
10344 // a rich interface for iterating over Code objects.. | 10347 // a rich interface for iterating over Code objects.. |
10345 | 10348 |
10346 // Visits a code target in the instruction stream. | 10349 // Visits a code target in the instruction stream. |
10347 virtual void VisitCodeTarget(RelocInfo* rinfo); | 10350 virtual void VisitCodeTarget(RelocInfo* rinfo); |
10348 | 10351 |
10349 // Visits a code entry in a JS function. | 10352 // Visits a code entry in a JS function. |
10350 virtual void VisitCodeEntry(Address entry_address); | 10353 virtual void VisitCodeEntry(Address entry_address); |
10351 | 10354 |
10352 // Visits a global property cell reference in the instruction stream. | 10355 // Visits a global property cell reference in the instruction stream. |
10353 virtual void VisitCell(RelocInfo* rinfo); | 10356 virtual void VisitCell(RelocInfo* rinfo); |
10354 | 10357 |
10355 // Visits a runtime entry in the instruction stream. | 10358 // Visits a runtime entry in the instruction stream. |
10356 virtual void VisitRuntimeEntry(RelocInfo* rinfo) {} | 10359 virtual void VisitRuntimeEntry(RelocInfo* rinfo) {} |
10357 | 10360 |
10358 // Visits the resource of an ASCII or two-byte string. | 10361 // Visits the resource of an ASCII or two-byte string. |
10359 virtual void VisitExternalAsciiString( | 10362 virtual void VisitExternalAsciiString( |
10360 v8::String::ExternalAsciiStringResource** resource) {} | 10363 v8::String::ExternalAsciiStringResource** resource) {} |
10361 virtual void VisitExternalTwoByteString( | 10364 virtual void VisitExternalTwoByteString( |
10362 v8::String::ExternalStringResource** resource) {} | 10365 v8::String::ExternalStringResource** resource) {} |
10363 | 10366 |
10364 // Visits a debug call target in the instruction stream. | 10367 // Visits a debug call target in the instruction stream. |
10365 virtual void VisitDebugTarget(RelocInfo* rinfo); | 10368 virtual void VisitDebugTarget(RelocInfo* rinfo); |
10366 | 10369 |
10367 // Visits the byte sequence in a function's prologue that contains information | 10370 // Visits the byte sequence in a function's prologue that contains information |
10368 // about the code's age. | 10371 // about the code's age. |
10369 virtual void VisitCodeAgeSequence(RelocInfo* rinfo); | 10372 virtual void VisitCodeAgeSequence(RelocInfo* rinfo); |
10370 | 10373 |
10371 // Handy shorthand for visiting a single pointer. | |
10372 virtual void VisitPointer(Object** p) { VisitPointers(p, p + 1); } | |
10373 | |
10374 // Visit pointer embedded into a code object. | 10374 // Visit pointer embedded into a code object. |
10375 virtual void VisitEmbeddedPointer(RelocInfo* rinfo); | 10375 virtual void VisitEmbeddedPointer(RelocInfo* rinfo); |
10376 | 10376 |
10377 // Visits a contiguous arrays of external references (references to the C++ | 10377 // Visits an external reference embedded into a code object. |
10378 // heap) in the half-open range [start, end). Any or all of the values | |
10379 // may be modified on return. | |
10380 virtual void VisitExternalReferences(Address* start, Address* end) {} | |
10381 | |
10382 virtual void VisitExternalReference(RelocInfo* rinfo); | 10378 virtual void VisitExternalReference(RelocInfo* rinfo); |
10383 | 10379 |
10384 inline void VisitExternalReference(Address* p) { | 10380 // Visits an external reference. The value may be modified on return. |
10385 VisitExternalReferences(p, p + 1); | 10381 virtual void VisitExternalReference(Address* p) {} |
10386 } | |
10387 | 10382 |
10388 // Visits a handle that has an embedder-assigned class ID. | 10383 // Visits a handle that has an embedder-assigned class ID. |
10389 virtual void VisitEmbedderReference(Object** p, uint16_t class_id) {} | 10384 virtual void VisitEmbedderReference(Object** p, uint16_t class_id) {} |
10390 | 10385 |
10391 // Intended for serialization/deserialization checking: insert, or | 10386 // Intended for serialization/deserialization checking: insert, or |
10392 // check for the presence of, a tag at this position in the stream. | 10387 // check for the presence of, a tag at this position in the stream. |
10393 // Also used for marking up GC roots in heap snapshots. | 10388 // Also used for marking up GC roots in heap snapshots. |
10394 virtual void Synchronize(VisitorSynchronization::SyncTag tag) {} | 10389 virtual void Synchronize(VisitorSynchronization::SyncTag tag) {} |
10395 }; | 10390 }; |
10396 | 10391 |
(...skipping 29 matching lines...) Expand all Loading... |
10426 } else { | 10421 } else { |
10427 value &= ~(1 << bit_position); | 10422 value &= ~(1 << bit_position); |
10428 } | 10423 } |
10429 return value; | 10424 return value; |
10430 } | 10425 } |
10431 }; | 10426 }; |
10432 | 10427 |
10433 } } // namespace v8::internal | 10428 } } // namespace v8::internal |
10434 | 10429 |
10435 #endif // V8_OBJECTS_H_ | 10430 #endif // V8_OBJECTS_H_ |
OLD | NEW |