Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: include/v8.h

Issue 1410593005: Adds a scavenge GC pass to collect unmodified references (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Forgot a fix in the last patch Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** \mainpage V8 API Reference Guide 5 /** \mainpage V8 API Reference Guide
6 * 6 *
7 * V8 is Google's open source JavaScript engine. 7 * V8 is Google's open source JavaScript engine.
8 * 8 *
9 * This set of documents provides reference material generated from the 9 * This set of documents provides reference material generated from the
10 * V8 header file, include/v8.h. 10 * V8 header file, include/v8.h.
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 /** 596 /**
597 * Marks the reference to this object partially dependent. Partially dependent 597 * Marks the reference to this object partially dependent. Partially dependent
598 * handles only depend on other partially dependent handles and these 598 * handles only depend on other partially dependent handles and these
599 * dependencies are provided through object groups. It provides a way to build 599 * dependencies are provided through object groups. It provides a way to build
600 * smaller object groups for young objects that represent only a subset of all 600 * smaller object groups for young objects that represent only a subset of all
601 * external dependencies. This mark is automatically cleared after each 601 * external dependencies. This mark is automatically cleared after each
602 * garbage collection. 602 * garbage collection.
603 */ 603 */
604 V8_INLINE void MarkPartiallyDependent(); 604 V8_INLINE void MarkPartiallyDependent();
605 605
606 /**
607 * Marks the reference to this object as active. The scavenge garbage
608 * collection should not reclaim the objects marked as active.
609 * This bit is cleared after the each garbage collection pass.
610 */
611 V8_INLINE void MarkActive();
612
606 V8_INLINE bool IsIndependent() const; 613 V8_INLINE bool IsIndependent() const;
607 614
608 /** Checks if the handle holds the only reference to an object. */ 615 /** Checks if the handle holds the only reference to an object. */
609 V8_INLINE bool IsNearDeath() const; 616 V8_INLINE bool IsNearDeath() const;
610 617
611 /** Returns true if the handle's reference is weak. */ 618 /** Returns true if the handle's reference is weak. */
612 V8_INLINE bool IsWeak() const; 619 V8_INLINE bool IsWeak() const;
613 620
614 /** 621 /**
615 * Assigns a wrapper class ID to the handle. See RetainedObjectInfo interface 622 * Assigns a wrapper class ID to the handle. See RetainedObjectInfo interface
(...skipping 5304 matching lines...) Expand 10 before | Expand all | Expand 10 after
5920 5927
5921 /** 5928 /**
5922 * Iterates through all the persistent handles in the current isolate's heap 5929 * Iterates through all the persistent handles in the current isolate's heap
5923 * that have class_ids and are candidates to be marked as partially dependent 5930 * that have class_ids and are candidates to be marked as partially dependent
5924 * handles. This will visit handles to young objects created since the last 5931 * handles. This will visit handles to young objects created since the last
5925 * garbage collection but is free to visit an arbitrary superset of these 5932 * garbage collection but is free to visit an arbitrary superset of these
5926 * objects. 5933 * objects.
5927 */ 5934 */
5928 void VisitHandlesForPartialDependence(PersistentHandleVisitor* visitor); 5935 void VisitHandlesForPartialDependence(PersistentHandleVisitor* visitor);
5929 5936
5937 /**
5938 * Iterates through all the persistent handles in the current isolate's heap
5939 * that have class_ids and are weak to be marked as inactive if there is no
5940 * pending activity for the handle.
5941 */
5942 void VisitWeakHandles(PersistentHandleVisitor* visitor);
5943
5930 private: 5944 private:
5931 template <class K, class V, class Traits> 5945 template <class K, class V, class Traits>
5932 friend class PersistentValueMapBase; 5946 friend class PersistentValueMapBase;
5933 5947
5934 Isolate(); 5948 Isolate();
5935 Isolate(const Isolate&); 5949 Isolate(const Isolate&);
5936 ~Isolate(); 5950 ~Isolate();
5937 Isolate& operator=(const Isolate&); 5951 Isolate& operator=(const Isolate&);
5938 void* operator new(size_t size); 5952 void* operator new(size_t size);
5939 void operator delete(void*, size_t); 5953 void operator delete(void*, size_t);
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
7002 static const int kExternalAllocationLimit = 192 * 1024 * 1024; 7016 static const int kExternalAllocationLimit = 192 * 1024 * 1024;
7003 7017
7004 static const int kNodeClassIdOffset = 1 * kApiPointerSize; 7018 static const int kNodeClassIdOffset = 1 * kApiPointerSize;
7005 static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3; 7019 static const int kNodeFlagsOffset = 1 * kApiPointerSize + 3;
7006 static const int kNodeStateMask = 0x7; 7020 static const int kNodeStateMask = 0x7;
7007 static const int kNodeStateIsWeakValue = 2; 7021 static const int kNodeStateIsWeakValue = 2;
7008 static const int kNodeStateIsPendingValue = 3; 7022 static const int kNodeStateIsPendingValue = 3;
7009 static const int kNodeStateIsNearDeathValue = 4; 7023 static const int kNodeStateIsNearDeathValue = 4;
7010 static const int kNodeIsIndependentShift = 3; 7024 static const int kNodeIsIndependentShift = 3;
7011 static const int kNodeIsPartiallyDependentShift = 4; 7025 static const int kNodeIsPartiallyDependentShift = 4;
7026 static const int kNodeIsActiveShift = 4;
7012 7027
7013 static const int kJSObjectType = 0xb7; 7028 static const int kJSObjectType = 0xb7;
7014 static const int kFirstNonstringType = 0x80; 7029 static const int kFirstNonstringType = 0x80;
7015 static const int kOddballType = 0x83; 7030 static const int kOddballType = 0x83;
7016 static const int kForeignType = 0x87; 7031 static const int kForeignType = 0x87;
7017 7032
7018 static const int kUndefinedOddballKind = 5; 7033 static const int kUndefinedOddballKind = 5;
7019 static const int kNullOddballKind = 3; 7034 static const int kNullOddballKind = 3;
7020 7035
7021 static const uint32_t kNumIsolateDataSlots = 4; 7036 static const uint32_t kNumIsolateDataSlots = 4;
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
7329 void PersistentBase<T>::MarkPartiallyDependent() { 7344 void PersistentBase<T>::MarkPartiallyDependent() {
7330 typedef internal::Internals I; 7345 typedef internal::Internals I;
7331 if (this->IsEmpty()) return; 7346 if (this->IsEmpty()) return;
7332 I::UpdateNodeFlag(reinterpret_cast<internal::Object**>(this->val_), 7347 I::UpdateNodeFlag(reinterpret_cast<internal::Object**>(this->val_),
7333 true, 7348 true,
7334 I::kNodeIsPartiallyDependentShift); 7349 I::kNodeIsPartiallyDependentShift);
7335 } 7350 }
7336 7351
7337 7352
7338 template <class T> 7353 template <class T>
7354 void PersistentBase<T>::MarkActive() {
7355 typedef internal::Internals I;
7356 if (this->IsEmpty()) return;
7357 I::UpdateNodeFlag(reinterpret_cast<internal::Object**>(this->val_), true,
7358 I::kNodeIsActiveShift);
7359 }
7360
7361
7362 template <class T>
7339 void PersistentBase<T>::SetWrapperClassId(uint16_t class_id) { 7363 void PersistentBase<T>::SetWrapperClassId(uint16_t class_id) {
7340 typedef internal::Internals I; 7364 typedef internal::Internals I;
7341 if (this->IsEmpty()) return; 7365 if (this->IsEmpty()) return;
7342 internal::Object** obj = reinterpret_cast<internal::Object**>(this->val_); 7366 internal::Object** obj = reinterpret_cast<internal::Object**>(this->val_);
7343 uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + I::kNodeClassIdOffset; 7367 uint8_t* addr = reinterpret_cast<uint8_t*>(obj) + I::kNodeClassIdOffset;
7344 *reinterpret_cast<uint16_t*>(addr) = class_id; 7368 *reinterpret_cast<uint16_t*>(addr) = class_id;
7345 } 7369 }
7346 7370
7347 7371
7348 template <class T> 7372 template <class T>
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
8376 */ 8400 */
8377 8401
8378 8402
8379 } // namespace v8 8403 } // namespace v8
8380 8404
8381 8405
8382 #undef TYPE_CHECK 8406 #undef TYPE_CHECK
8383 8407
8384 8408
8385 #endif // V8_H_ 8409 #endif // V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698