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

Unified Diff: src/address-map.cc

Issue 2490783004: [serializer] small fixes for blink snapshot. (Closed)
Patch Set: more fixes Created 4 years, 1 month 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
Index: src/address-map.cc
diff --git a/src/address-map.cc b/src/address-map.cc
index 3122b33693488e5e27c1e36881d89d8fa7fc9b1e..add832b3798a026ad8654c7802172d02a892e82b 100644
--- a/src/address-map.cc
+++ b/src/address-map.cc
@@ -13,7 +13,7 @@ namespace internal {
RootIndexMap::RootIndexMap(Isolate* isolate) {
map_ = isolate->root_index_map();
if (map_ != NULL) return;
- map_ = new base::HashMap();
+ map_ = new HeapObjectToIndexHashMap();
for (uint32_t i = 0; i < Heap::kStrongRootListLength; i++) {
Heap::RootListIndex root_index = static_cast<Heap::RootListIndex>(i);
Object* root = isolate->heap()->root(root_index);
@@ -22,12 +22,11 @@ RootIndexMap::RootIndexMap(Isolate* isolate) {
// not be referenced through the root list in the snapshot.
if (isolate->heap()->RootCanBeTreatedAsConstant(root_index)) {
HeapObject* heap_object = HeapObject::cast(root);
- base::HashMap::Entry* entry = LookupEntry(map_, heap_object, false);
- if (entry != NULL) {
+ if (map_->Has(heap_object)) {
// Some are initialized to a previous value in the root list.
- DCHECK_LT(GetValue(entry), i);
+ DCHECK_LT(map_->Get(heap_object), i);
} else {
- SetValue(LookupEntry(map_, heap_object, true), i);
+ map_->Set(heap_object, i);
}
} else {
// Immortal immovable root objects are constant and allocated on the first

Powered by Google App Engine
This is Rietveld 408576698