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

Unified Diff: src/objects.h

Issue 980523004: Retain maps embedded in optimized code for several garbage collections. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Check constructor. Created 5 years, 9 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/lithium.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index c3344ec98759a28b767e29f5ba440065f210fe21..a74db7b590c7680293e653ffee8fc04b600baaf8 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -941,6 +941,7 @@ template <class C> inline bool Is(Object* obj);
V(FixedArray) \
V(FixedDoubleArray) \
V(WeakFixedArray) \
+ V(ArrayList) \
V(ConstantPoolArray) \
V(Context) \
V(ScriptContextTable) \
@@ -2627,6 +2628,28 @@ class WeakFixedArray : public FixedArray {
};
+// Generic array grows dynamically with O(1) amortized insertion.
+class ArrayList : public FixedArray {
+ public:
+ static Handle<ArrayList> Add(Handle<ArrayList> array, Handle<Object> obj);
+ static Handle<ArrayList> Add(Handle<ArrayList> array, Handle<Object> obj1,
+ Handle<Object> obj2);
+ inline int Length();
+ inline void SetLength(int length);
+ inline Object* Get(int index);
+ inline Object** Slot(int index);
+ inline void Set(int index, Object* obj);
+ inline void Clear(int index, Object* undefined);
+ DECLARE_CAST(ArrayList)
+
+ private:
+ static Handle<ArrayList> EnsureSpace(Handle<ArrayList> array, int length);
+ static const int kLengthIndex = 0;
+ static const int kFirstIndex = 1;
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ArrayList);
+};
+
+
// ConstantPoolArray describes a fixed-sized array containing constant pool
// entries.
//
« no previous file with comments | « src/lithium.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698