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

Side by Side Diff: runtime/vm/handles_impl.h

Issue 11778013: Cleanup handles more efficiently, ensures we don't have to iterate over them (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 | « runtime/vm/compiler.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_HANDLES_IMPL_H_ 5 #ifndef VM_HANDLES_IMPL_H_
6 #define VM_HANDLES_IMPL_H_ 6 #define VM_HANDLES_IMPL_H_
7 7
8 #include "vm/heap.h" 8 #include "vm/heap.h"
9 #include "vm/heap_trace.h" 9 #include "vm/heap_trace.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 20 matching lines...) Expand all
31 31
32 32
33 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr> 33 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
34 void Handles<kHandleSizeInWords, 34 void Handles<kHandleSizeInWords,
35 kHandlesPerChunk, 35 kHandlesPerChunk,
36 kOffsetOfRawPtr>::VisitScopedHandles( 36 kOffsetOfRawPtr>::VisitScopedHandles(
37 ObjectPointerVisitor* visitor) { 37 ObjectPointerVisitor* visitor) {
38 HandlesBlock* block = &first_scoped_block_; 38 HandlesBlock* block = &first_scoped_block_;
39 do { 39 do {
40 block->VisitObjectPointers(visitor); 40 block->VisitObjectPointers(visitor);
41 if (block == scoped_blocks_) {
42 return;
43 }
41 block = block->next_block(); 44 block = block->next_block();
42 } while (block != NULL); 45 } while (block != NULL);
46 UNREACHABLE();
43 } 47 }
44 48
45 49
46 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr> 50 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
47 void Handles<kHandleSizeInWords, 51 void Handles<kHandleSizeInWords,
48 kHandlesPerChunk, 52 kHandlesPerChunk,
49 kOffsetOfRawPtr>::VisitUnvisitedScopedHandles( 53 kOffsetOfRawPtr>::VisitUnvisitedScopedHandles(
50 ObjectPointerVisitor* visitor) { 54 ObjectPointerVisitor* visitor) {
51 HandlesBlock* block = &first_scoped_block_; 55 HandlesBlock* block = &first_scoped_block_;
52 while (block != NULL && block != last_visited_block_) { 56 while (block != NULL && block != last_visited_block_) {
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr> 393 template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
390 int Handles<kHandleSizeInWords, 394 int Handles<kHandleSizeInWords,
391 kHandlesPerChunk, 395 kHandlesPerChunk,
392 kOffsetOfRawPtr>::HandlesBlock::HandleCount() const { 396 kOffsetOfRawPtr>::HandlesBlock::HandleCount() const {
393 return (next_handle_slot_ / kHandleSizeInWords); 397 return (next_handle_slot_ / kHandleSizeInWords);
394 } 398 }
395 399
396 } // namespace dart 400 } // namespace dart
397 401
398 #endif // VM_HANDLES_IMPL_H_ 402 #endif // VM_HANDLES_IMPL_H_
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698