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

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

Issue 6577036: [Isolates] Merge from bleeding_edge to isolates, revisions 6100-6300. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 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/objects-printer.cc ('k') | src/parser.h » ('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 2006-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 140
141 template<typename Callback> 141 template<typename Callback>
142 class VisitorDispatchTable { 142 class VisitorDispatchTable {
143 public: 143 public:
144 inline Callback GetVisitor(Map* map) { 144 inline Callback GetVisitor(Map* map) {
145 return callbacks_[map->visitor_id()]; 145 return callbacks_[map->visitor_id()];
146 } 146 }
147 147
148 void Register(StaticVisitorBase::VisitorId id, Callback callback) { 148 void Register(StaticVisitorBase::VisitorId id, Callback callback) {
149 ASSERT((0 <= id) && (id < StaticVisitorBase::kVisitorIdCount)); 149 ASSERT(id < StaticVisitorBase::kVisitorIdCount); // id is unsigned.
150 callbacks_[id] = callback; 150 callbacks_[id] = callback;
151 } 151 }
152 152
153 template<typename Visitor, 153 template<typename Visitor,
154 StaticVisitorBase::VisitorId base, 154 StaticVisitorBase::VisitorId base,
155 StaticVisitorBase::VisitorId generic, 155 StaticVisitorBase::VisitorId generic,
156 int object_size_in_words> 156 int object_size_in_words>
157 void RegisterSpecialization() { 157 void RegisterSpecialization() {
158 static const int size = object_size_in_words * kPointerSize; 158 static const int size = object_size_in_words * kPointerSize;
159 Register(StaticVisitorBase::GetVisitorIdForSize(base, generic, size), 159 Register(StaticVisitorBase::GetVisitorIdForSize(base, generic, size),
(...skipping 19 matching lines...) Expand all
179 } 179 }
180 180
181 private: 181 private:
182 Callback callbacks_[StaticVisitorBase::kVisitorIdCount]; 182 Callback callbacks_[StaticVisitorBase::kVisitorIdCount];
183 }; 183 };
184 184
185 185
186 template<typename StaticVisitor> 186 template<typename StaticVisitor>
187 class BodyVisitorBase : public AllStatic { 187 class BodyVisitorBase : public AllStatic {
188 public: 188 public:
189 static inline void IteratePointers(Heap* heap, 189 INLINE(static void IteratePointers(Heap* heap,
190 HeapObject* object, 190 HeapObject* object,
191 int start_offset, 191 int start_offset,
192 int end_offset) { 192 int end_offset)) {
193 Object** start_slot = reinterpret_cast<Object**>(object->address() + 193 Object** start_slot = reinterpret_cast<Object**>(object->address() +
194 start_offset); 194 start_offset);
195 Object** end_slot = reinterpret_cast<Object**>(object->address() + 195 Object** end_slot = reinterpret_cast<Object**>(object->address() +
196 end_offset); 196 end_offset);
197 StaticVisitor::VisitPointers(heap, start_slot, end_slot); 197 StaticVisitor::VisitPointers(heap, start_slot, end_slot);
198 } 198 }
199 }; 199 };
200 200
201 201
202 template<typename StaticVisitor, typename BodyDescriptor, typename ReturnType> 202 template<typename StaticVisitor, typename BodyDescriptor, typename ReturnType>
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 404
405 for (; !it.done(); it.next()) { 405 for (; !it.done(); it.next()) {
406 it.rinfo()->template Visit<StaticVisitor>(heap); 406 it.rinfo()->template Visit<StaticVisitor>(heap);
407 } 407 }
408 } 408 }
409 409
410 410
411 } } // namespace v8::internal 411 } } // namespace v8::internal
412 412
413 #endif // V8_OBJECTS_VISITING_H_ 413 #endif // V8_OBJECTS_VISITING_H_
OLDNEW
« no previous file with comments | « src/objects-printer.cc ('k') | src/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698