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

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

Issue 8217002: Disable short-circuiting of cons-strings when compaction is pending. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 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/heap.cc ('k') | no next file » | 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 public: 150 public:
151 void CopyFrom(VisitorDispatchTable* other) { 151 void CopyFrom(VisitorDispatchTable* other) {
152 // We are not using memcpy to guarantee that during update 152 // We are not using memcpy to guarantee that during update
153 // every element of callbacks_ array will remain correct 153 // every element of callbacks_ array will remain correct
154 // pointer (memcpy might be implemented as a byte copying loop). 154 // pointer (memcpy might be implemented as a byte copying loop).
155 for (int i = 0; i < StaticVisitorBase::kVisitorIdCount; i++) { 155 for (int i = 0; i < StaticVisitorBase::kVisitorIdCount; i++) {
156 NoBarrier_Store(&callbacks_[i], other->callbacks_[i]); 156 NoBarrier_Store(&callbacks_[i], other->callbacks_[i]);
157 } 157 }
158 } 158 }
159 159
160 inline Callback GetVisitorById(StaticVisitorBase::VisitorId id) {
161 return reinterpret_cast<Callback>(callbacks_[id]);
162 }
163
160 inline Callback GetVisitor(Map* map) { 164 inline Callback GetVisitor(Map* map) {
161 return reinterpret_cast<Callback>(callbacks_[map->visitor_id()]); 165 return reinterpret_cast<Callback>(callbacks_[map->visitor_id()]);
162 } 166 }
163 167
164 void Register(StaticVisitorBase::VisitorId id, Callback callback) { 168 void Register(StaticVisitorBase::VisitorId id, Callback callback) {
165 ASSERT(id < StaticVisitorBase::kVisitorIdCount); // id is unsigned. 169 ASSERT(id < StaticVisitorBase::kVisitorIdCount); // id is unsigned.
166 callbacks_[id] = reinterpret_cast<AtomicWord>(callback); 170 callbacks_[id] = reinterpret_cast<AtomicWord>(callback);
167 } 171 }
168 172
169 template<typename Visitor, 173 template<typename Visitor,
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 343
340 344
341 template<typename StaticVisitor> 345 template<typename StaticVisitor>
342 VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback> 346 VisitorDispatchTable<typename StaticNewSpaceVisitor<StaticVisitor>::Callback>
343 StaticNewSpaceVisitor<StaticVisitor>::table_; 347 StaticNewSpaceVisitor<StaticVisitor>::table_;
344 348
345 349
346 } } // namespace v8::internal 350 } } // namespace v8::internal
347 351
348 #endif // V8_OBJECTS_VISITING_H_ 352 #endif // V8_OBJECTS_VISITING_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698