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

Unified Diff: src/serialize.h

Issue 825933004: Use back reference map to find references to global proxy. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | src/serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/serialize.h
diff --git a/src/serialize.h b/src/serialize.h
index 53dc6eb87376707b9240d71a846d05f2b8aac93e..cc267aa5fa21ea9fa1cf9a54a3b2aea586ffac49 100644
--- a/src/serialize.h
+++ b/src/serialize.h
@@ -193,6 +193,10 @@ class BackReference {
static BackReference SourceReference() { return BackReference(kSourceValue); }
+ static BackReference GlobalProxyReference() {
+ return BackReference(kGlobalProxyValue);
+ }
+
static BackReference LargeObjectReference(uint32_t index) {
return BackReference(SpaceBits::encode(LO_SPACE) |
ChunkOffsetBits::encode(index));
@@ -209,6 +213,7 @@ class BackReference {
bool is_valid() const { return bitfield_ != kInvalidValue; }
bool is_source() const { return bitfield_ == kSourceValue; }
+ bool is_global_proxy() const { return bitfield_ == kGlobalProxyValue; }
AllocationSpace space() const {
DCHECK(is_valid());
@@ -235,6 +240,7 @@ class BackReference {
private:
static const uint32_t kInvalidValue = 0xFFFFFFFF;
static const uint32_t kSourceValue = 0xFFFFFFFE;
+ static const uint32_t kGlobalProxyValue = 0xFFFFFFFD;
static const int kChunkOffsetSize = kPageSizeBits - kObjectAlignmentBits;
static const int kChunkIndexSize = 32 - kChunkOffsetSize - kSpaceTagSize;
@@ -278,6 +284,10 @@ class BackReferenceMap : public AddressMapBase {
Add(string, BackReference::SourceReference());
}
+ void AddGlobalProxy(HeapObject* global_proxy) {
+ Add(global_proxy, BackReference::GlobalProxyReference());
+ }
+
private:
DisallowHeapAllocation no_allocation_;
HashMap* map_;
@@ -751,8 +761,7 @@ class PartialSerializer : public Serializer {
: Serializer(isolate, sink),
startup_serializer_(startup_snapshot_serializer),
outdated_contexts_(0),
- global_object_(NULL),
- global_proxy_(NULL) {
+ global_object_(NULL) {
InitializeCodeAddressMap();
}
@@ -781,7 +790,6 @@ class PartialSerializer : public Serializer {
Serializer* startup_serializer_;
List<BackReference> outdated_contexts_;
Object* global_object_;
- Object* global_proxy_;
DISALLOW_COPY_AND_ASSIGN(PartialSerializer);
};
« no previous file with comments | « no previous file | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698