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

Unified Diff: src/objects-inl.h

Issue 3836001: Get rid of requested size in RetryAfterGC. (Closed)
Patch Set: Created 10 years, 2 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
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index f63d6725ec2981afdf13b294c8a7de8a76d51f31..8f1b09bbc2adc9b072235d1a91eed439d2852fa3 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -844,15 +844,6 @@ bool Failure::IsOutOfMemoryException() const {
}
-int Failure::requested() const {
- const int kShiftBits =
- kFailureTypeTagSize + kSpaceTagSize - kObjectAlignmentBits;
- STATIC_ASSERT(kShiftBits >= 0);
- ASSERT(type() == RETRY_AFTER_GC);
- return static_cast<int>(value() >> kShiftBits);
-}
-
-
AllocationSpace Failure::allocation_space() const {
ASSERT_EQ(RETRY_AFTER_GC, type());
return static_cast<AllocationSpace>((value() >> kFailureTypeTagSize)
@@ -881,20 +872,14 @@ intptr_t Failure::value() const {
}
-Failure* Failure::RetryAfterGC(int requested_bytes) {
- // Assert that the space encoding fits in the three bytes allotted for it.
- ASSERT((LAST_SPACE & ~kSpaceTagMask) == 0);
- uintptr_t requested =
- static_cast<uintptr_t>(requested_bytes >> kObjectAlignmentBits);
- int tag_bits = kSpaceTagSize + kFailureTypeTagSize + kFailureTagSize;
- if (((requested << tag_bits) >> tag_bits) != requested) {
- // No room for entire requested size in the bits. Round down to
- // maximally representable size.
- requested = static_cast<intptr_t>(
- (~static_cast<uintptr_t>(0)) >> (tag_bits + 1));
- }
- int value = static_cast<int>(requested << kSpaceTagSize) | NEW_SPACE;
- return Construct(RETRY_AFTER_GC, value);
+Failure* Failure::RetryAfterGC() {
+ return RetryAfterGC(NEW_SPACE);
+}
+
+
+Failure* Failure::RetryAfterGC(AllocationSpace space) {
+ ASSERT((space & ~kSpaceTagMask) == 0);
+ return Construct(RETRY_AFTER_GC, space);
}
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698