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

Side by Side Diff: src/objects-visiting-inl.h

Issue 7841036: Fix several bugs in compaction: (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mark-compact.cc ('k') | src/spaces.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 void Code::CodeIterateBody(ObjectVisitor* v) { 93 void Code::CodeIterateBody(ObjectVisitor* v) {
94 int mode_mask = RelocInfo::kCodeTargetMask | 94 int mode_mask = RelocInfo::kCodeTargetMask |
95 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | 95 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
96 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | 96 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) |
97 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | 97 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
98 RelocInfo::ModeMask(RelocInfo::JS_RETURN) | 98 RelocInfo::ModeMask(RelocInfo::JS_RETURN) |
99 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) | 99 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) |
100 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); 100 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
101 101
102 // Use the relocation info pointer before it is visited by
103 // the heap compaction in the next statement.
104 RelocIterator it(this, mode_mask);
105
106 IteratePointer(v, kRelocationInfoOffset); 102 IteratePointer(v, kRelocationInfoOffset);
107 IteratePointer(v, kDeoptimizationDataOffset); 103 IteratePointer(v, kDeoptimizationDataOffset);
108 104
105 RelocIterator it(this, mode_mask);
109 for (; !it.done(); it.next()) { 106 for (; !it.done(); it.next()) {
110 it.rinfo()->Visit(v); 107 it.rinfo()->Visit(v);
111 } 108 }
112 } 109 }
113 110
114 111
115 template<typename StaticVisitor> 112 template<typename StaticVisitor>
116 void Code::CodeIterateBody(Heap* heap) { 113 void Code::CodeIterateBody(Heap* heap) {
117 int mode_mask = RelocInfo::kCodeTargetMask | 114 int mode_mask = RelocInfo::kCodeTargetMask |
118 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) | 115 RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT) |
119 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) | 116 RelocInfo::ModeMask(RelocInfo::GLOBAL_PROPERTY_CELL) |
120 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) | 117 RelocInfo::ModeMask(RelocInfo::EXTERNAL_REFERENCE) |
121 RelocInfo::ModeMask(RelocInfo::JS_RETURN) | 118 RelocInfo::ModeMask(RelocInfo::JS_RETURN) |
122 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) | 119 RelocInfo::ModeMask(RelocInfo::DEBUG_BREAK_SLOT) |
123 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY); 120 RelocInfo::ModeMask(RelocInfo::RUNTIME_ENTRY);
124 121
125 // Use the relocation info pointer before it is visited by
126 // the heap compaction in the next statement.
127 RelocIterator it(this, mode_mask);
128
129 StaticVisitor::VisitPointer( 122 StaticVisitor::VisitPointer(
130 heap, 123 heap,
131 reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset)); 124 reinterpret_cast<Object**>(this->address() + kRelocationInfoOffset));
132 StaticVisitor::VisitPointer( 125 StaticVisitor::VisitPointer(
133 heap, 126 heap,
134 reinterpret_cast<Object**>(this->address() + kDeoptimizationDataOffset)); 127 reinterpret_cast<Object**>(this->address() + kDeoptimizationDataOffset));
135 128
129 RelocIterator it(this, mode_mask);
136 for (; !it.done(); it.next()) { 130 for (; !it.done(); it.next()) {
137 it.rinfo()->template Visit<StaticVisitor>(heap); 131 it.rinfo()->template Visit<StaticVisitor>(heap);
138 } 132 }
139 } 133 }
140 134
141 135
142 } } // namespace v8::internal 136 } } // namespace v8::internal
143 137
144 #endif // V8_OBJECTS_VISITING_INL_H_ 138 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/mark-compact.cc ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698