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

Unified Diff: src/heap/heap-inl.h

Issue 1312553003: [heap] Prevent direct access to ExternalStringTable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-heap-root-set-1
Patch Set: Addressed comments. Created 5 years, 4 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 | « src/heap/heap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap-inl.h
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h
index f40ac5616d159a33c638cca024d96fdab971ab59..a3785d0a9a4cc14f42b0b31a556abebdd6f13aff 100644
--- a/src/heap/heap-inl.h
+++ b/src/heap/heap-inl.h
@@ -323,6 +323,11 @@ void Heap::UpdateAllocationsHash(uint32_t value) {
}
+void Heap::RegisterExternalString(String* string) {
+ external_string_table_.AddString(string);
+}
+
+
void Heap::FinalizeExternalString(String* string) {
DCHECK(string->IsExternalString());
v8::String::ExternalStringResourceBase** resource_addr =
@@ -608,7 +613,7 @@ Isolate* Heap::isolate() {
CALL_AND_RETRY_OR_DIE(ISOLATE, FUNCTION_CALL, return, return)
-void ExternalStringTable::AddString(String* string) {
+void Heap::ExternalStringTable::AddString(String* string) {
DCHECK(string->IsExternalString());
if (heap_->InNewSpace(string)) {
new_space_strings_.Add(string);
@@ -618,7 +623,7 @@ void ExternalStringTable::AddString(String* string) {
}
-void ExternalStringTable::Iterate(ObjectVisitor* v) {
+void Heap::ExternalStringTable::Iterate(ObjectVisitor* v) {
if (!new_space_strings_.is_empty()) {
Object** start = &new_space_strings_[0];
v->VisitPointers(start, start + new_space_strings_.length());
@@ -632,7 +637,7 @@ void ExternalStringTable::Iterate(ObjectVisitor* v) {
// Verify() is inline to avoid ifdef-s around its calls in release
// mode.
-void ExternalStringTable::Verify() {
+void Heap::ExternalStringTable::Verify() {
#ifdef DEBUG
for (int i = 0; i < new_space_strings_.length(); ++i) {
Object* obj = Object::cast(new_space_strings_[i]);
@@ -648,14 +653,14 @@ void ExternalStringTable::Verify() {
}
-void ExternalStringTable::AddOldString(String* string) {
+void Heap::ExternalStringTable::AddOldString(String* string) {
DCHECK(string->IsExternalString());
DCHECK(!heap_->InNewSpace(string));
old_space_strings_.Add(string);
}
-void ExternalStringTable::ShrinkNewStrings(int position) {
+void Heap::ExternalStringTable::ShrinkNewStrings(int position) {
new_space_strings_.Rewind(position);
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698