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

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

Issue 575663002: Eliminate 99% of allocated ExceptionHandler objects (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
« runtime/vm/object.cc ('K') | « runtime/vm/raw_object.h ('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 #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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
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()->num_entries_; 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()->num_entries_;
167 instance_size = ExceptionHandlers::InstanceSize(num_handlers); 167 instance_size = ExceptionHandlers::InstanceSize(num_handlers);
168 break; 168 break;
169 } 169 }
170 case kDeoptInfoCid: { 170 case kDeoptInfoCid: {
171 const RawDeoptInfo* raw_deopt_info = 171 const RawDeoptInfo* raw_deopt_info =
172 reinterpret_cast<const RawDeoptInfo*>(this); 172 reinterpret_cast<const RawDeoptInfo*>(this);
173 intptr_t num_entries = Smi::Value(raw_deopt_info->ptr()->length_); 173 intptr_t num_entries = Smi::Value(raw_deopt_info->ptr()->length_);
174 instance_size = DeoptInfo::InstanceSize(num_entries); 174 instance_size = DeoptInfo::InstanceSize(num_entries);
175 break; 175 break;
176 } 176 }
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) { 524 RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) {
525 intptr_t num_entries = raw_obj->ptr()->num_entries_; 525 intptr_t num_entries = raw_obj->ptr()->num_entries_;
526 visitor->VisitPointers(raw_obj->from(), raw_obj->to(num_entries)); 526 visitor->VisitPointers(raw_obj->from(), raw_obj->to(num_entries));
527 return LocalVarDescriptors::InstanceSize(num_entries); 527 return LocalVarDescriptors::InstanceSize(num_entries);
528 } 528 }
529 529
530 530
531 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers( 531 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers(
532 RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) { 532 RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) {
533 RawExceptionHandlers* obj = raw_obj->ptr(); 533 RawExceptionHandlers* obj = raw_obj->ptr();
534 intptr_t len = obj->length_; 534 intptr_t len = obj->num_entries_;
535 visitor->VisitPointer( 535 visitor->VisitPointer(
536 reinterpret_cast<RawObject**>(&obj->handled_types_data_)); 536 reinterpret_cast<RawObject**>(&obj->handled_types_data_));
537 return ExceptionHandlers::InstanceSize(len); 537 return ExceptionHandlers::InstanceSize(len);
538 } 538 }
539 539
540 540
541 intptr_t RawDeoptInfo::VisitDeoptInfoPointers( 541 intptr_t RawDeoptInfo::VisitDeoptInfoPointers(
542 RawDeoptInfo* raw_obj, ObjectPointerVisitor* visitor) { 542 RawDeoptInfo* raw_obj, ObjectPointerVisitor* visitor) {
543 RawDeoptInfo* obj = raw_obj->ptr(); 543 RawDeoptInfo* obj = raw_obj->ptr();
544 intptr_t length = Smi::Value(obj->length_); 544 intptr_t length = Smi::Value(obj->length_);
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 intptr_t RawUserTag::VisitUserTagPointers( 883 intptr_t RawUserTag::VisitUserTagPointers(
884 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) { 884 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) {
885 // 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.
886 ASSERT(raw_obj->IsHeapObject()); 886 ASSERT(raw_obj->IsHeapObject());
887 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 887 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
888 return UserTag::InstanceSize(); 888 return UserTag::InstanceSize();
889 } 889 }
890 890
891 891
892 } // namespace dart 892 } // namespace dart
OLDNEW
« runtime/vm/object.cc ('K') | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698