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

Side by Side Diff: src/objects.h

Issue 1099103003: Compact weak fixed arrays before serializing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fi Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/objects.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 #ifndef V8_OBJECTS_H_ 5 #ifndef V8_OBJECTS_H_
6 #define V8_OBJECTS_H_ 6 #define V8_OBJECTS_H_
7 7
8 #include <iosfwd> 8 #include <iosfwd>
9 9
10 #include "src/allocation.h" 10 #include "src/allocation.h"
(...skipping 2607 matching lines...) Expand 10 before | Expand all | Expand 10 after
2618 public: 2618 public:
2619 enum SearchForDuplicates { kAlwaysAdd, kAddIfNotFound }; 2619 enum SearchForDuplicates { kAlwaysAdd, kAddIfNotFound };
2620 2620
2621 // If |maybe_array| is not a WeakFixedArray, a fresh one will be allocated. 2621 // If |maybe_array| is not a WeakFixedArray, a fresh one will be allocated.
2622 static Handle<WeakFixedArray> Add( 2622 static Handle<WeakFixedArray> Add(
2623 Handle<Object> maybe_array, Handle<HeapObject> value, 2623 Handle<Object> maybe_array, Handle<HeapObject> value,
2624 SearchForDuplicates search_for_duplicates = kAlwaysAdd); 2624 SearchForDuplicates search_for_duplicates = kAlwaysAdd);
2625 2625
2626 void Remove(Handle<HeapObject> value); 2626 void Remove(Handle<HeapObject> value);
2627 2627
2628 void Compact();
2629
2628 inline Object* Get(int index) const; 2630 inline Object* Get(int index) const;
2629 inline int Length() const; 2631 inline int Length() const;
2630 2632
2631 static Object* Empty() { return Smi::FromInt(0); } 2633 static Object* Empty() { return Smi::FromInt(0); }
2632 2634
2633 DECLARE_CAST(WeakFixedArray) 2635 DECLARE_CAST(WeakFixedArray)
2634 2636
2635 private: 2637 private:
2636 static const int kLastUsedIndexIndex = 0; 2638 static const int kLastUsedIndexIndex = 0;
2637 static const int kFirstIndex = 1; 2639 static const int kFirstIndex = 1;
(...skipping 8449 matching lines...) Expand 10 before | Expand all | Expand 10 after
11087 } else { 11089 } else {
11088 value &= ~(1 << bit_position); 11090 value &= ~(1 << bit_position);
11089 } 11091 }
11090 return value; 11092 return value;
11091 } 11093 }
11092 }; 11094 };
11093 11095
11094 } } // namespace v8::internal 11096 } } // namespace v8::internal
11095 11097
11096 #endif // V8_OBJECTS_H_ 11098 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698