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

Unified Diff: src/objects.cc

Issue 304143002: Add support for extended constant pool arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Sync Created 6 years, 7 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/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 38d4bd1f45834522309563b4da3d039af59fa632..ddd97c6c450f17e7942c0cce781021dfe535c26f 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9863,13 +9863,36 @@ bool Map::EquivalentToForNormalization(Map* other,
void ConstantPoolArray::ConstantPoolIterateBody(ObjectVisitor* v) {
- for (int i = 0; i < count_of_code_ptr_entries(); i++) {
- int index = first_code_ptr_index() + i;
- v->VisitCodeEntry(reinterpret_cast<Address>(RawFieldOfElementAt(index)));
+ ConstantPoolArray::Iterator code_iter(this, ConstantPoolArray::CODE_PTR);
+ while (!code_iter.is_finished()) {
+ v->VisitCodeEntry(reinterpret_cast<Address>(
+ RawFieldOfElementAt(code_iter.next_index())));
}
- for (int i = 0; i < count_of_heap_ptr_entries(); i++) {
- int index = first_heap_ptr_index() + i;
- v->VisitPointer(RawFieldOfElementAt(index));
+
+ ConstantPoolArray::Iterator heap_iter(this, ConstantPoolArray::HEAP_PTR);
+ while (!heap_iter.is_finished()) {
+ v->VisitPointer(RawFieldOfElementAt(heap_iter.next_index()));
+ }
+}
+
+
+void ConstantPoolArray::ClearPtrEntries(Isolate* isolate) {
+ Type type[] = { CODE_PTR, HEAP_PTR };
+ Address default_value[] = {
+ isolate->builtins()->builtin(Builtins::kIllegal)->entry(),
+ reinterpret_cast<Address>(isolate->heap()->undefined_value()) };
+
+ for (int i = 0; i < 2; ++i) {
+ for (int s = 0; s <= final_section(); ++s) {
+ LayoutSection section = static_cast<LayoutSection>(s);
+ if (number_of_entries(type[i], section) > 0) {
+ int offset = OffsetOfElementAt(first_index(type[i], section));
+ MemsetPointer(
+ reinterpret_cast<Address*>(HeapObject::RawField(this, offset)),
+ default_value[i],
+ number_of_entries(type[i], section));
+ }
+ }
}
}
« no previous file with comments | « src/objects.h ('k') | src/objects-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698