| 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 4575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4586 private: | 4586 private: |
| 4587 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalTwoByteString); | 4587 DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalTwoByteString); |
| 4588 }; | 4588 }; |
| 4589 | 4589 |
| 4590 | 4590 |
| 4591 // Utility superclass for stack-allocated objects that must be updated | 4591 // Utility superclass for stack-allocated objects that must be updated |
| 4592 // on gc. It provides two ways for the gc to update instances, either | 4592 // on gc. It provides two ways for the gc to update instances, either |
| 4593 // iterating or updating after gc. | 4593 // iterating or updating after gc. |
| 4594 class Relocatable BASE_EMBEDDED { | 4594 class Relocatable BASE_EMBEDDED { |
| 4595 public: | 4595 public: |
| 4596 inline Relocatable() : prev_(top_) { top_ = this; } | 4596 inline Relocatable(); |
| 4597 virtual ~Relocatable() { | 4597 inline virtual ~Relocatable(); |
| 4598 ASSERT_EQ(top_, this); | |
| 4599 top_ = prev_; | |
| 4600 } | |
| 4601 virtual void IterateInstance(ObjectVisitor* v) { } | 4598 virtual void IterateInstance(ObjectVisitor* v) { } |
| 4602 virtual void PostGarbageCollection() { } | 4599 virtual void PostGarbageCollection() { } |
| 4603 | 4600 |
| 4604 static void PostGarbageCollectionProcessing(); | 4601 static void PostGarbageCollectionProcessing(); |
| 4605 static int ArchiveSpacePerThread(); | 4602 static int ArchiveSpacePerThread(); |
| 4606 static char* ArchiveState(char* to); | 4603 static char* ArchiveState(char* to); |
| 4607 static char* RestoreState(char* from); | 4604 static char* RestoreState(char* from); |
| 4608 static void Iterate(ObjectVisitor* v); | 4605 static void Iterate(ObjectVisitor* v); |
| 4609 static void Iterate(ObjectVisitor* v, Relocatable* top); | 4606 static void Iterate(ObjectVisitor* v, Relocatable* top); |
| 4610 static char* Iterate(ObjectVisitor* v, char* t); | 4607 static char* Iterate(ObjectVisitor* v, char* t); |
| 4611 private: | 4608 private: |
| 4612 static Relocatable* top_; | |
| 4613 Relocatable* prev_; | 4609 Relocatable* prev_; |
| 4614 }; | 4610 }; |
| 4615 | 4611 |
| 4616 | 4612 |
| 4617 // A flat string reader provides random access to the contents of a | 4613 // A flat string reader provides random access to the contents of a |
| 4618 // string independent of the character width of the string. The handle | 4614 // string independent of the character width of the string. The handle |
| 4619 // must be valid as long as the reader is being used. | 4615 // must be valid as long as the reader is being used. |
| 4620 class FlatStringReader : public Relocatable { | 4616 class FlatStringReader : public Relocatable { |
| 4621 public: | 4617 public: |
| 4622 explicit FlatStringReader(Handle<String> str); | 4618 explicit FlatStringReader(Handle<String> str); |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5283 } else { | 5279 } else { |
| 5284 value &= ~(1 << bit_position); | 5280 value &= ~(1 << bit_position); |
| 5285 } | 5281 } |
| 5286 return value; | 5282 return value; |
| 5287 } | 5283 } |
| 5288 }; | 5284 }; |
| 5289 | 5285 |
| 5290 } } // namespace v8::internal | 5286 } } // namespace v8::internal |
| 5291 | 5287 |
| 5292 #endif // V8_OBJECTS_H_ | 5288 #endif // V8_OBJECTS_H_ |
| OLD | NEW |