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

Side by Side Diff: src/heap-inl.h

Issue 660245: Faster moving FixedArray elements around. (Closed)
Patch Set: Next round Created 10 years, 9 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
« no previous file with comments | « src/heap.h ('k') | src/objects.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-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 181
182 void Heap::RecordWrite(Address address, int offset) { 182 void Heap::RecordWrite(Address address, int offset) {
183 if (new_space_.Contains(address)) return; 183 if (new_space_.Contains(address)) return;
184 ASSERT(!new_space_.FromSpaceContains(address)); 184 ASSERT(!new_space_.FromSpaceContains(address));
185 SLOW_ASSERT(Contains(address + offset)); 185 SLOW_ASSERT(Contains(address + offset));
186 Page::SetRSet(address, offset); 186 Page::SetRSet(address, offset);
187 } 187 }
188 188
189 189
190 void Heap::RecordWrites(Address address, int start, int len) {
191 if (new_space_.Contains(address)) return;
192 ASSERT(!new_space_.FromSpaceContains(address));
193 for (int offset = start;
194 offset < start + len * kPointerSize;
195 offset += kPointerSize) {
196 SLOW_ASSERT(Contains(address + offset));
197 Page::SetRSet(address, offset);
198 }
199 }
200
201
190 OldSpace* Heap::TargetSpace(HeapObject* object) { 202 OldSpace* Heap::TargetSpace(HeapObject* object) {
191 InstanceType type = object->map()->instance_type(); 203 InstanceType type = object->map()->instance_type();
192 AllocationSpace space = TargetSpaceId(type); 204 AllocationSpace space = TargetSpaceId(type);
193 return (space == OLD_POINTER_SPACE) 205 return (space == OLD_POINTER_SPACE)
194 ? old_pointer_space_ 206 ? old_pointer_space_
195 : old_data_space_; 207 : old_data_space_;
196 } 208 }
197 209
198 210
199 AllocationSpace Heap::TargetSpaceId(InstanceType type) { 211 AllocationSpace Heap::TargetSpaceId(InstanceType type) {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 414
403 415
404 void ExternalStringTable::ShrinkNewStrings(int position) { 416 void ExternalStringTable::ShrinkNewStrings(int position) {
405 new_space_strings_.Rewind(position); 417 new_space_strings_.Rewind(position);
406 Verify(); 418 Verify();
407 } 419 }
408 420
409 } } // namespace v8::internal 421 } } // namespace v8::internal
410 422
411 #endif // V8_HEAP_INL_H_ 423 #endif // V8_HEAP_INL_H_
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698