OLD | NEW |
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/heap_profiler.h" | 5 #include "vm/heap_profiler.h" |
6 | 6 |
7 #include "vm/dart_api_state.h" | 7 #include "vm/dart_api_state.h" |
8 #include "vm/object.h" | 8 #include "vm/object.h" |
9 #include "vm/raw_object.h" | 9 #include "vm/raw_object.h" |
10 #include "vm/stack_frame.h" | 10 #include "vm/stack_frame.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 reinterpret_cast<RawField*>(raw_array->ptr()->data()[i]); | 506 reinterpret_cast<RawField*>(raw_array->ptr()->data()[i]); |
507 if (Field::StaticBit::decode(raw_field->ptr()->kind_bits_)) { | 507 if (Field::StaticBit::decode(raw_field->ptr()->kind_bits_)) { |
508 ++num_static_fields; | 508 ++num_static_fields; |
509 } else { | 509 } else { |
510 ++num_instance_fields; | 510 ++num_instance_fields; |
511 } | 511 } |
512 } | 512 } |
513 } | 513 } |
514 // instance size (in bytes) | 514 // instance size (in bytes) |
515 // TODO(cshapiro): properly account for variable sized objects | 515 // TODO(cshapiro): properly account for variable sized objects |
516 sub.Write32(raw_class->ptr()->instance_size_); | 516 sub.Write32(raw_class->ptr()->instance_size_in_words_); |
517 // size of constant pool and number of records that follow: | 517 // size of constant pool and number of records that follow: |
518 sub.Write16(0); | 518 sub.Write16(0); |
519 // Number of static fields | 519 // Number of static fields |
520 sub.Write16(num_static_fields); | 520 sub.Write16(num_static_fields); |
521 // Static fields: | 521 // Static fields: |
522 if (raw_array != Array::null()) { | 522 if (raw_array != Array::null()) { |
523 for (intptr_t i = 0; i < Smi::Value(raw_array->ptr()->length_); ++i) { | 523 for (intptr_t i = 0; i < Smi::Value(raw_array->ptr()->length_); ++i) { |
524 RawField* raw_field = | 524 RawField* raw_field = |
525 reinterpret_cast<RawField*>(raw_array->ptr()->data()[i]); | 525 reinterpret_cast<RawField*>(raw_array->ptr()->data()[i]); |
526 if (Field::StaticBit::decode(raw_field->ptr()->kind_bits_)) { | 526 if (Field::StaticBit::decode(raw_field->ptr()->kind_bits_)) { |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 RawObject* raw_obj = handle->raw(); | 702 RawObject* raw_obj = handle->raw(); |
703 visitor_->VisitPointer(&raw_obj); | 703 visitor_->VisitPointer(&raw_obj); |
704 } | 704 } |
705 | 705 |
706 | 706 |
707 void HeapProfilerObjectVisitor::VisitObject(RawObject* raw_obj) { | 707 void HeapProfilerObjectVisitor::VisitObject(RawObject* raw_obj) { |
708 profiler_->WriteObject(raw_obj); | 708 profiler_->WriteObject(raw_obj); |
709 } | 709 } |
710 | 710 |
711 } // namespace dart | 711 } // namespace dart |
OLD | NEW |