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

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

Issue 10837303: Make stackmaps store their actual length. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
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/freelist.h" 8 #include "vm/freelist.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 } 201 }
202 case kPcDescriptorsCid: { 202 case kPcDescriptorsCid: {
203 const RawPcDescriptors* raw_descriptors = 203 const RawPcDescriptors* raw_descriptors =
204 reinterpret_cast<const RawPcDescriptors*>(this); 204 reinterpret_cast<const RawPcDescriptors*>(this);
205 intptr_t num_descriptors = Smi::Value(raw_descriptors->ptr()->length_); 205 intptr_t num_descriptors = Smi::Value(raw_descriptors->ptr()->length_);
206 instance_size = PcDescriptors::InstanceSize(num_descriptors); 206 instance_size = PcDescriptors::InstanceSize(num_descriptors);
207 break; 207 break;
208 } 208 }
209 case kStackmapCid: { 209 case kStackmapCid: {
210 const RawStackmap* map = reinterpret_cast<const RawStackmap*>(this); 210 const RawStackmap* map = reinterpret_cast<const RawStackmap*>(this);
211 intptr_t size_in_bytes = Smi::Value(map->ptr()->bitmap_size_in_bytes_); 211 intptr_t length = map->ptr()->length_;
212 instance_size = Stackmap::InstanceSize(size_in_bytes); 212 instance_size = Stackmap::InstanceSize(length);
213 break; 213 break;
214 } 214 }
215 case kLocalVarDescriptorsCid: { 215 case kLocalVarDescriptorsCid: {
216 const RawLocalVarDescriptors* raw_descriptors = 216 const RawLocalVarDescriptors* raw_descriptors =
217 reinterpret_cast<const RawLocalVarDescriptors*>(this); 217 reinterpret_cast<const RawLocalVarDescriptors*>(this);
218 intptr_t num_descriptors = raw_descriptors->ptr()->length_; 218 intptr_t num_descriptors = raw_descriptors->ptr()->length_;
219 instance_size = LocalVarDescriptors::InstanceSize(num_descriptors); 219 instance_size = LocalVarDescriptors::InstanceSize(num_descriptors);
220 break; 220 break;
221 } 221 }
222 case kExceptionHandlersCid: { 222 case kExceptionHandlersCid: {
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 RawPcDescriptors* obj = raw_obj->ptr(); 477 RawPcDescriptors* obj = raw_obj->ptr();
478 intptr_t length = Smi::Value(obj->length_); 478 intptr_t length = Smi::Value(obj->length_);
479 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_)); 479 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_));
480 return PcDescriptors::InstanceSize(length); 480 return PcDescriptors::InstanceSize(length);
481 } 481 }
482 482
483 483
484 intptr_t RawStackmap::VisitStackmapPointers(RawStackmap* raw_obj, 484 intptr_t RawStackmap::VisitStackmapPointers(RawStackmap* raw_obj,
485 ObjectPointerVisitor* visitor) { 485 ObjectPointerVisitor* visitor) {
486 RawStackmap* obj = raw_obj->ptr(); 486 RawStackmap* obj = raw_obj->ptr();
487 intptr_t size_in_bytes = Smi::Value(obj->bitmap_size_in_bytes_); 487 intptr_t length = obj->length_;
488 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 488 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->code_));
489 return Stackmap::InstanceSize(size_in_bytes); 489 return Stackmap::InstanceSize(length);
490 } 490 }
491 491
492 492
493 intptr_t RawLocalVarDescriptors::VisitLocalVarDescriptorsPointers( 493 intptr_t RawLocalVarDescriptors::VisitLocalVarDescriptorsPointers(
494 RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) { 494 RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) {
495 RawLocalVarDescriptors* obj = raw_obj->ptr(); 495 RawLocalVarDescriptors* obj = raw_obj->ptr();
496 intptr_t len = obj->length_; 496 intptr_t len = obj->length_;
497 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->names_)); 497 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->names_));
498 return LocalVarDescriptors::InstanceSize(len); 498 return LocalVarDescriptors::InstanceSize(len);
499 } 499 }
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 970
971 intptr_t RawWeakProperty::VisitWeakPropertyPointers( 971 intptr_t RawWeakProperty::VisitWeakPropertyPointers(
972 RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) { 972 RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) {
973 // Make sure that we got here with the tagged pointer as this. 973 // Make sure that we got here with the tagged pointer as this.
974 ASSERT(raw_obj->IsHeapObject()); 974 ASSERT(raw_obj->IsHeapObject());
975 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 975 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
976 return WeakProperty::InstanceSize(); 976 return WeakProperty::InstanceSize();
977 } 977 }
978 978
979 } // namespace dart 979 } // namespace dart
OLDNEW
« runtime/vm/object.cc ('K') | « runtime/vm/raw_object.h ('k') | runtime/vm/stack_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698