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

Unified Diff: src/objects-inl.h

Issue 396803009: Tests that the GC doesn't mistake non-pointer constant pool entries as poitners. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add isOldSpace checks Created 6 years, 5 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 | test/cctest/test-constantpool.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index b26a857e1920fa691b2eceb244fd0272da285f58..39c4ba4db50a8c7b34f7f23e55303d64a45e8794 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -2539,6 +2539,7 @@ void ConstantPoolArray::set(int index, Address value) {
void ConstantPoolArray::set(int index, Object* value) {
ASSERT(map() == GetHeap()->constant_pool_array_map());
+ ASSERT(!GetHeap()->InNewSpace(value));
ASSERT(get_type(index) == HEAP_PTR);
WRITE_FIELD(this, OffsetOfElementAt(index), value);
WRITE_BARRIER(GetHeap(), this, OffsetOfElementAt(index), value);
@@ -2583,6 +2584,7 @@ void ConstantPoolArray::set_at_offset(int offset, Address value) {
void ConstantPoolArray::set_at_offset(int offset, Object* value) {
ASSERT(map() == GetHeap()->constant_pool_array_map());
+ ASSERT(!GetHeap()->InNewSpace(value));
ASSERT(offset_is_type(offset, HEAP_PTR));
WRITE_FIELD(this, offset, value);
WRITE_BARRIER(GetHeap(), this, offset, value);
« no previous file with comments | « no previous file | test/cctest/test-constantpool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698