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

Unified Diff: src/zone.h

Issue 17827005: Get rid of ZoneScope completely. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Suggestions from danno Created 7 years, 6 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/stub-cache.cc ('k') | src/zone.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/zone.h
diff --git a/src/zone.h b/src/zone.h
index 128552a57a44c661fb7cb64b516b405e8e9f46d2..e6a200871c9aa3ef9a198c639c4ef95b2a5275e5 100644
--- a/src/zone.h
+++ b/src/zone.h
@@ -39,13 +39,6 @@ namespace v8 {
namespace internal {
-// Zone scopes are in one of two modes. Either they delete the zone
-// on exit or they do not.
-enum ZoneScopeMode {
- DELETE_ON_EXIT,
- DONT_DELETE_ON_EXIT
-};
-
class Segment;
class Isolate;
@@ -65,7 +58,7 @@ class Isolate;
class Zone {
public:
explicit Zone(Isolate* isolate);
- ~Zone() { DeleteKeptSegment(); }
+ ~Zone();
// Allocate 'size' bytes of memory in the Zone; expands the Zone by
// allocating new segments of memory on demand using malloc().
inline void* New(int size);
@@ -73,13 +66,6 @@ class Zone {
template <typename T>
inline T* NewArray(int length);
- // Deletes all objects and free all memory allocated in the Zone. Keeps one
- // small (size <= kMaximumKeptSegmentSize) segment around if it finds one.
- void DeleteAll();
-
- // Deletes the last small segment kept around by DeleteAll().
- void DeleteKeptSegment();
-
// Returns true if more memory has been allocated in zones than
// the limit allows.
inline bool excess_allocation();
@@ -92,7 +78,6 @@ class Zone {
private:
friend class Isolate;
- friend class ZoneScope;
// All pointers returned from New() have this alignment. In addition, if the
// object being allocated has a size that is divisible by 8 then its alignment
@@ -105,9 +90,6 @@ class Zone {
// Never allocate segments larger than this size in bytes.
static const int kMaximumSegmentSize = 1 * MB;
- // Never keep segments larger than this size in bytes around.
- static const int kMaximumKeptSegmentSize = 64 * KB;
-
// Report zone excess when allocation exceeds this limit.
int zone_excess_limit_;
@@ -138,8 +120,6 @@ class Zone {
Address position_;
Address limit_;
- int scope_nesting_;
-
Segment* segment_head_;
Isolate* isolate_;
};
@@ -232,33 +212,6 @@ class ZoneList: public List<T, ZoneAllocationPolicy> {
};
-// ZoneScopes keep track of the current parsing and compilation
-// nesting and cleans up generated ASTs in the Zone when exiting the
-// outer-most scope.
-class ZoneScope BASE_EMBEDDED {
- public:
- INLINE(ZoneScope(Zone* zone, ZoneScopeMode mode));
-
- virtual ~ZoneScope();
-
- Zone* zone() const { return zone_; }
-
- inline bool ShouldDeleteOnExit();
-
- // For ZoneScopes that do not delete on exit by default, call this
- // method to request deletion on exit.
- void DeleteOnExit() {
- mode_ = DELETE_ON_EXIT;
- }
-
- inline static int nesting();
-
- private:
- Zone* zone_;
- ZoneScopeMode mode_;
-};
-
-
// A zone splay tree. The config type parameter encapsulates the
// different configurations of a concrete splay tree (see splay-tree.h).
// The tree itself and all its elements are allocated in the Zone.
« no previous file with comments | « src/stub-cache.cc ('k') | src/zone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698