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

Side by Side Diff: src/unique.h

Issue 1178853002: [heap] Unify the immortal immovable root detection mechanism. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use the right predicate during code generation. Created 5 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 unified diff | Download patch
« no previous file with comments | « src/snapshot/serialize.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_HYDROGEN_UNIQUE_H_ 5 #ifndef V8_HYDROGEN_UNIQUE_H_
6 #define V8_HYDROGEN_UNIQUE_H_ 6 #define V8_HYDROGEN_UNIQUE_H_
7 7
8 #include <ostream> // NOLINT(readability/streams) 8 #include <ostream> // NOLINT(readability/streams)
9 9
10 #include "src/base/functional.h" 10 #include "src/base/functional.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 // TODO(titzer): this is a hack to migrate to Unique<T> incrementally. 123 // TODO(titzer): this is a hack to migrate to Unique<T> incrementally.
124 static Unique<T> CreateUninitialized(Handle<T> handle) { 124 static Unique<T> CreateUninitialized(Handle<T> handle) {
125 return Unique<T>(NULL, handle); 125 return Unique<T>(NULL, handle);
126 } 126 }
127 127
128 static Unique<T> CreateImmovable(Handle<T> handle) { 128 static Unique<T> CreateImmovable(Handle<T> handle) {
129 return Unique<T>(reinterpret_cast<Address>(*handle), handle); 129 return Unique<T>(reinterpret_cast<Address>(*handle), handle);
130 } 130 }
131 131
132 T* GetRawAddress() const {
133 DCHECK(IsInitialized());
134 return reinterpret_cast<T*>(raw_address_);
135 }
136
132 friend class UniqueSet<T>; // Uses internal details for speed. 137 friend class UniqueSet<T>; // Uses internal details for speed.
133 template <class U> 138 template <class U>
134 friend class Unique; // For comparing raw_address values. 139 friend class Unique; // For comparing raw_address values.
135 140
136 protected: 141 protected:
137 Address raw_address_; 142 Address raw_address_;
138 Handle<T> handle_; 143 Handle<T> handle_;
139 144
140 friend class SideEffectsTracker; 145 friend class SideEffectsTracker;
141 }; 146 };
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 } 360 }
356 capacity_ = new_capacity; 361 capacity_ = new_capacity;
357 array_ = new_array; 362 array_ = new_array;
358 } 363 }
359 } 364 }
360 }; 365 };
361 366
362 } } // namespace v8::internal 367 } } // namespace v8::internal
363 368
364 #endif // V8_HYDROGEN_UNIQUE_H_ 369 #endif // V8_HYDROGEN_UNIQUE_H_
OLDNEW
« no previous file with comments | « src/snapshot/serialize.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698