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

Side by Side Diff: runtime/vm/raw_object.cc

Issue 577443003: Save more memory by compacting LocalVarDescriptors (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « runtime/vm/raw_object.h ('k') | runtime/vm/scopes.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 (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 #include "vm/raw_object.h" 5 #include "vm/raw_object.h"
6 6
7 #include "vm/class_table.h" 7 #include "vm/class_table.h"
8 #include "vm/dart.h" 8 #include "vm/dart.h"
9 #include "vm/freelist.h" 9 #include "vm/freelist.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 } 149 }
150 case kStackmapCid: { 150 case kStackmapCid: {
151 const RawStackmap* map = reinterpret_cast<const RawStackmap*>(this); 151 const RawStackmap* map = reinterpret_cast<const RawStackmap*>(this);
152 intptr_t length = map->ptr()->length_; 152 intptr_t length = map->ptr()->length_;
153 instance_size = Stackmap::InstanceSize(length); 153 instance_size = Stackmap::InstanceSize(length);
154 break; 154 break;
155 } 155 }
156 case kLocalVarDescriptorsCid: { 156 case kLocalVarDescriptorsCid: {
157 const RawLocalVarDescriptors* raw_descriptors = 157 const RawLocalVarDescriptors* raw_descriptors =
158 reinterpret_cast<const RawLocalVarDescriptors*>(this); 158 reinterpret_cast<const RawLocalVarDescriptors*>(this);
159 intptr_t num_descriptors = raw_descriptors->ptr()->length_; 159 intptr_t num_descriptors = raw_descriptors->ptr()->num_entries_;
160 instance_size = LocalVarDescriptors::InstanceSize(num_descriptors); 160 instance_size = LocalVarDescriptors::InstanceSize(num_descriptors);
161 break; 161 break;
162 } 162 }
163 case kExceptionHandlersCid: { 163 case kExceptionHandlersCid: {
164 const RawExceptionHandlers* raw_handlers = 164 const RawExceptionHandlers* raw_handlers =
165 reinterpret_cast<const RawExceptionHandlers*>(this); 165 reinterpret_cast<const RawExceptionHandlers*>(this);
166 intptr_t num_handlers = raw_handlers->ptr()->length_; 166 intptr_t num_handlers = raw_handlers->ptr()->length_;
167 instance_size = ExceptionHandlers::InstanceSize(num_handlers); 167 instance_size = ExceptionHandlers::InstanceSize(num_handlers);
168 break; 168 break;
169 } 169 }
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 515
516 516
517 intptr_t RawStackmap::VisitStackmapPointers(RawStackmap* raw_obj, 517 intptr_t RawStackmap::VisitStackmapPointers(RawStackmap* raw_obj,
518 ObjectPointerVisitor* visitor) { 518 ObjectPointerVisitor* visitor) {
519 return Stackmap::InstanceSize(raw_obj->ptr()->length_); 519 return Stackmap::InstanceSize(raw_obj->ptr()->length_);
520 } 520 }
521 521
522 522
523 intptr_t RawLocalVarDescriptors::VisitLocalVarDescriptorsPointers( 523 intptr_t RawLocalVarDescriptors::VisitLocalVarDescriptorsPointers(
524 RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) { 524 RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) {
525 RawLocalVarDescriptors* obj = raw_obj->ptr(); 525 intptr_t num_entries = raw_obj->ptr()->num_entries_;
526 intptr_t len = obj->length_; 526 visitor->VisitPointers(raw_obj->from(), raw_obj->to(num_entries));
527 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->names_)); 527 return LocalVarDescriptors::InstanceSize(num_entries);
528 return LocalVarDescriptors::InstanceSize(len);
529 } 528 }
530 529
531 530
532 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers( 531 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers(
533 RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) { 532 RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) {
534 RawExceptionHandlers* obj = raw_obj->ptr(); 533 RawExceptionHandlers* obj = raw_obj->ptr();
535 intptr_t len = obj->length_; 534 intptr_t len = obj->length_;
536 visitor->VisitPointer( 535 visitor->VisitPointer(
537 reinterpret_cast<RawObject**>(&obj->handled_types_data_)); 536 reinterpret_cast<RawObject**>(&obj->handled_types_data_));
538 return ExceptionHandlers::InstanceSize(len); 537 return ExceptionHandlers::InstanceSize(len);
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 intptr_t RawUserTag::VisitUserTagPointers( 883 intptr_t RawUserTag::VisitUserTagPointers(
885 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) { 884 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) {
886 // Make sure that we got here with the tagged pointer as this. 885 // Make sure that we got here with the tagged pointer as this.
887 ASSERT(raw_obj->IsHeapObject()); 886 ASSERT(raw_obj->IsHeapObject());
888 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 887 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
889 return UserTag::InstanceSize(); 888 return UserTag::InstanceSize();
890 } 889 }
891 890
892 891
893 } // namespace dart 892 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698