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

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

Issue 10830131: Adding deopt info to code object. (Closed) Base URL: http://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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 instance_size = LocalVarDescriptors::InstanceSize(num_descriptors); 223 instance_size = LocalVarDescriptors::InstanceSize(num_descriptors);
224 break; 224 break;
225 } 225 }
226 case kExceptionHandlers: { 226 case kExceptionHandlers: {
227 const RawExceptionHandlers* raw_handlers = 227 const RawExceptionHandlers* raw_handlers =
228 reinterpret_cast<const RawExceptionHandlers*>(this); 228 reinterpret_cast<const RawExceptionHandlers*>(this);
229 intptr_t num_handlers = Smi::Value(raw_handlers->ptr()->length_); 229 intptr_t num_handlers = Smi::Value(raw_handlers->ptr()->length_);
230 instance_size = ExceptionHandlers::InstanceSize(num_handlers); 230 instance_size = ExceptionHandlers::InstanceSize(num_handlers);
231 break; 231 break;
232 } 232 }
233 case kDeoptInfo: {
234 const RawDeoptInfo* raw_handlers =
235 reinterpret_cast<const RawDeoptInfo*>(this);
236 intptr_t num_handlers = Smi::Value(raw_handlers->ptr()->length_);
siva 2012/08/02 16:57:37 num_handlers => num_entries ? as these are not exc
srdjan 2012/08/02 17:51:44 Done.
237 instance_size = DeoptInfo::InstanceSize(num_handlers);
238 break;
239 }
233 case kJSRegExp: { 240 case kJSRegExp: {
234 const RawJSRegExp* raw_jsregexp = 241 const RawJSRegExp* raw_jsregexp =
235 reinterpret_cast<const RawJSRegExp*>(this); 242 reinterpret_cast<const RawJSRegExp*>(this);
236 intptr_t data_length = Smi::Value(raw_jsregexp->ptr()->data_length_); 243 intptr_t data_length = Smi::Value(raw_jsregexp->ptr()->data_length_);
237 instance_size = JSRegExp::InstanceSize(data_length); 244 instance_size = JSRegExp::InstanceSize(data_length);
238 break; 245 break;
239 } 246 }
240 case kFreeListElement: { 247 case kFreeListElement: {
241 ASSERT(FreeBit::decode(ptr()->tags_)); 248 ASSERT(FreeBit::decode(ptr()->tags_));
242 uword addr = RawObject::ToAddr(const_cast<RawObject*>(this)); 249 uword addr = RawObject::ToAddr(const_cast<RawObject*>(this));
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 508
502 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers( 509 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers(
503 RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) { 510 RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) {
504 RawExceptionHandlers* obj = raw_obj->ptr(); 511 RawExceptionHandlers* obj = raw_obj->ptr();
505 intptr_t length = Smi::Value(obj->length_); 512 intptr_t length = Smi::Value(obj->length_);
506 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_)); 513 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_));
507 return ExceptionHandlers::InstanceSize(length); 514 return ExceptionHandlers::InstanceSize(length);
508 } 515 }
509 516
510 517
518 intptr_t RawDeoptInfo::VisitDeoptInfoPointers(
519 RawDeoptInfo* raw_obj, ObjectPointerVisitor* visitor) {
520 RawDeoptInfo* obj = raw_obj->ptr();
521 intptr_t length = Smi::Value(obj->length_);
522 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_));
523 return DeoptInfo::InstanceSize(length);
524 }
525
526
511 intptr_t RawContext::VisitContextPointers(RawContext* raw_obj, 527 intptr_t RawContext::VisitContextPointers(RawContext* raw_obj,
512 ObjectPointerVisitor* visitor) { 528 ObjectPointerVisitor* visitor) {
513 intptr_t num_variables = raw_obj->ptr()->num_variables_; 529 intptr_t num_variables = raw_obj->ptr()->num_variables_;
514 visitor->VisitPointers(raw_obj->from(), raw_obj->to(num_variables)); 530 visitor->VisitPointers(raw_obj->from(), raw_obj->to(num_variables));
515 return Context::InstanceSize(num_variables); 531 return Context::InstanceSize(num_variables);
516 } 532 }
517 533
518 534
519 intptr_t RawContextScope::VisitContextScopePointers( 535 intptr_t RawContextScope::VisitContextScopePointers(
520 RawContextScope* raw_obj, ObjectPointerVisitor* visitor) { 536 RawContextScope* raw_obj, ObjectPointerVisitor* visitor) {
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, 969 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj,
954 ObjectPointerVisitor* visitor) { 970 ObjectPointerVisitor* visitor) {
955 // Make sure that we got here with the tagged pointer as this. 971 // Make sure that we got here with the tagged pointer as this.
956 ASSERT(raw_obj->IsHeapObject()); 972 ASSERT(raw_obj->IsHeapObject());
957 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); 973 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_);
958 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 974 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
959 return JSRegExp::InstanceSize(length); 975 return JSRegExp::InstanceSize(length);
960 } 976 }
961 977
962 } // namespace dart 978 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698