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

Unified Diff: src/address-map.cc

Issue 2490783004: [serializer] small fixes for blink snapshot. (Closed)
Patch Set: rebase and fix 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
« no previous file with comments | « src/address-map.h ('k') | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/address-map.cc
diff --git a/src/address-map.cc b/src/address-map.cc
index 3122b33693488e5e27c1e36881d89d8fa7fc9b1e..79f8e62d5454f23ceb173e19b01993828a2d90e0 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,12 @@ 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) {
+ Maybe<uint32_t> maybe_index = map_->Get(heap_object);
+ if (maybe_index.IsJust()) {
// Some are initialized to a previous value in the root list.
- DCHECK_LT(GetValue(entry), i);
+ DCHECK_LT(maybe_index.FromJust(), 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
« no previous file with comments | « src/address-map.h ('k') | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698