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

Unified Diff: src/heap/spaces.h

Issue 2314783002: [heap] Removes spaces.h include from heap.h (Closed)
Patch Set: No more spaces.h Created 4 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« src/heap/heap.cc ('K') | « src/heap/heap-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index 964c9d2c5fb164d0d1d5e46eec480c1b12332bc5..372f5cddf134f3e8662e7a1a21d067883b52ee2e 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -17,6 +17,7 @@
#include "src/base/platform/mutex.h"
#include "src/flags.h"
#include "src/globals.h"
+#include "src/heap/heap.h"
#include "src/heap/marking.h"
#include "src/list.h"
#include "src/objects.h"
@@ -1868,50 +1869,6 @@ class FreeList {
DISALLOW_IMPLICIT_CONSTRUCTORS(FreeList);
};
-
-class AllocationResult {
- public:
- // Implicit constructor from Object*.
- AllocationResult(Object* object) // NOLINT
- : object_(object) {
- // AllocationResults can't return Smis, which are used to represent
- // failure and the space to retry in.
- CHECK(!object->IsSmi());
- }
-
- AllocationResult() : object_(Smi::FromInt(NEW_SPACE)) {}
-
- static inline AllocationResult Retry(AllocationSpace space = NEW_SPACE) {
- return AllocationResult(space);
- }
-
- inline bool IsRetry() { return object_->IsSmi(); }
-
- template <typename T>
- bool To(T** obj) {
- if (IsRetry()) return false;
- *obj = T::cast(object_);
- return true;
- }
-
- Object* ToObjectChecked() {
- CHECK(!IsRetry());
- return object_;
- }
-
- inline AllocationSpace RetrySpace();
-
- private:
- explicit AllocationResult(AllocationSpace space)
- : object_(Smi::FromInt(static_cast<int>(space))) {}
-
- Object* object_;
-};
-
-
-STATIC_ASSERT(sizeof(AllocationResult) == kPointerSize);
-
-
// LocalAllocationBuffer represents a linear allocation area that is created
// from a given {AllocationResult} and can be used to allocate memory without
// synchronization.
« src/heap/heap.cc ('K') | « src/heap/heap-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698