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

Side by Side Diff: vm/raw_object.cc

Issue 9701010: First step towards implementing stack map descriptions for the optimizing compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « vm/raw_object.h ('k') | vm/raw_object_snapshot.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/freelist.h" 7 #include "vm/freelist.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/visitor.h" 10 #include "vm/visitor.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 instance_size = TypeArguments::InstanceSize(array_length); 130 instance_size = TypeArguments::InstanceSize(array_length);
131 break; 131 break;
132 } 132 }
133 case kPcDescriptors: { 133 case kPcDescriptors: {
134 const RawPcDescriptors* raw_descriptors = 134 const RawPcDescriptors* raw_descriptors =
135 reinterpret_cast<const RawPcDescriptors*>(this); 135 reinterpret_cast<const RawPcDescriptors*>(this);
136 intptr_t num_descriptors = Smi::Value(raw_descriptors->ptr()->length_); 136 intptr_t num_descriptors = Smi::Value(raw_descriptors->ptr()->length_);
137 instance_size = PcDescriptors::InstanceSize(num_descriptors); 137 instance_size = PcDescriptors::InstanceSize(num_descriptors);
138 break; 138 break;
139 } 139 }
140 case kStackmap: {
141 const RawStackmap* map = reinterpret_cast<const RawStackmap*>(this);
142 intptr_t size_in_bytes = Smi::Value(map->ptr()->bitmap_size_in_bytes_);
143 instance_size = Stackmap::InstanceSize(size_in_bytes);
144 break;
145 }
140 case kLocalVarDescriptors: { 146 case kLocalVarDescriptors: {
141 const RawLocalVarDescriptors* raw_descriptors = 147 const RawLocalVarDescriptors* raw_descriptors =
142 reinterpret_cast<const RawLocalVarDescriptors*>(this); 148 reinterpret_cast<const RawLocalVarDescriptors*>(this);
143 intptr_t num_descriptors = raw_descriptors->ptr()->length_; 149 intptr_t num_descriptors = raw_descriptors->ptr()->length_;
144 instance_size = LocalVarDescriptors::InstanceSize(num_descriptors); 150 instance_size = LocalVarDescriptors::InstanceSize(num_descriptors);
145 break; 151 break;
146 } 152 }
147 case kExceptionHandlers: { 153 case kExceptionHandlers: {
148 const RawExceptionHandlers* raw_handlers = 154 const RawExceptionHandlers* raw_handlers =
149 reinterpret_cast<const RawExceptionHandlers*>(this); 155 reinterpret_cast<const RawExceptionHandlers*>(this);
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 371
366 intptr_t RawPcDescriptors::VisitPcDescriptorsPointers( 372 intptr_t RawPcDescriptors::VisitPcDescriptorsPointers(
367 RawPcDescriptors* raw_obj, ObjectPointerVisitor* visitor) { 373 RawPcDescriptors* raw_obj, ObjectPointerVisitor* visitor) {
368 RawPcDescriptors* obj = raw_obj->ptr(); 374 RawPcDescriptors* obj = raw_obj->ptr();
369 intptr_t length = Smi::Value(obj->length_); 375 intptr_t length = Smi::Value(obj->length_);
370 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_)); 376 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_));
371 return PcDescriptors::InstanceSize(length); 377 return PcDescriptors::InstanceSize(length);
372 } 378 }
373 379
374 380
381 intptr_t RawStackmap::VisitStackmapPointers(RawStackmap* raw_obj,
382 ObjectPointerVisitor* visitor) {
383 RawStackmap* obj = raw_obj->ptr();
384 intptr_t size_in_bytes = Smi::Value(obj->bitmap_size_in_bytes_);
385 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
386 return Stackmap::InstanceSize(size_in_bytes);
387 }
388
389
375 intptr_t RawLocalVarDescriptors::VisitLocalVarDescriptorsPointers( 390 intptr_t RawLocalVarDescriptors::VisitLocalVarDescriptorsPointers(
376 RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) { 391 RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) {
377 RawLocalVarDescriptors* obj = raw_obj->ptr(); 392 RawLocalVarDescriptors* obj = raw_obj->ptr();
378 intptr_t len = obj->length_; 393 intptr_t len = obj->length_;
379 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->names_)); 394 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->names_));
380 return LocalVarDescriptors::InstanceSize(len); 395 return LocalVarDescriptors::InstanceSize(len);
381 } 396 }
382 397
383 398
384 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers( 399 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers(
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 669
655 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, 670 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj,
656 ObjectPointerVisitor* visitor) { 671 ObjectPointerVisitor* visitor) {
657 // Make sure that we got here with the tagged pointer as this. 672 // Make sure that we got here with the tagged pointer as this.
658 ASSERT(raw_obj->IsHeapObject()); 673 ASSERT(raw_obj->IsHeapObject());
659 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); 674 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_);
660 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 675 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
661 return JSRegExp::InstanceSize(length); 676 return JSRegExp::InstanceSize(length);
662 } 677 }
663 678
664
665 } // namespace dart 679 } // namespace dart
OLDNEW
« no previous file with comments | « vm/raw_object.h ('k') | vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698