| 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/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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 return Namespace::InstanceSize(); | 422 return Namespace::InstanceSize(); |
| 423 } | 423 } |
| 424 | 424 |
| 425 | 425 |
| 426 intptr_t RawCode::VisitCodePointers(RawCode* raw_obj, | 426 intptr_t RawCode::VisitCodePointers(RawCode* raw_obj, |
| 427 ObjectPointerVisitor* visitor) { | 427 ObjectPointerVisitor* visitor) { |
| 428 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 428 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 429 | 429 |
| 430 RawCode* obj = raw_obj->ptr(); | 430 RawCode* obj = raw_obj->ptr(); |
| 431 intptr_t length = obj->pointer_offsets_length_; | 431 intptr_t length = obj->pointer_offsets_length_; |
| 432 if (obj->is_alive_ == 1) { | 432 if (Code::AliveBit::decode(obj->state_bits_)) { |
| 433 // Also visit all the embedded pointers in the corresponding instructions. | 433 // Also visit all the embedded pointers in the corresponding instructions. |
| 434 uword entry_point = reinterpret_cast<uword>(obj->instructions_->ptr()) + | 434 uword entry_point = reinterpret_cast<uword>(obj->instructions_->ptr()) + |
| 435 Instructions::HeaderSize(); | 435 Instructions::HeaderSize(); |
| 436 for (intptr_t i = 0; i < length; i++) { | 436 for (intptr_t i = 0; i < length; i++) { |
| 437 int32_t offset = obj->data_[i]; | 437 int32_t offset = obj->data_[i]; |
| 438 visitor->VisitPointer( | 438 visitor->VisitPointer( |
| 439 reinterpret_cast<RawObject**>(entry_point + offset)); | 439 reinterpret_cast<RawObject**>(entry_point + offset)); |
| 440 } | 440 } |
| 441 } | 441 } |
| 442 return Code::InstanceSize(length); | 442 return Code::InstanceSize(length); |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 | 802 |
| 803 intptr_t RawMirrorReference::VisitMirrorReferencePointers( | 803 intptr_t RawMirrorReference::VisitMirrorReferencePointers( |
| 804 RawMirrorReference* raw_obj, ObjectPointerVisitor* visitor) { | 804 RawMirrorReference* raw_obj, ObjectPointerVisitor* visitor) { |
| 805 // Make sure that we got here with the tagged pointer as this. | 805 // Make sure that we got here with the tagged pointer as this. |
| 806 ASSERT(raw_obj->IsHeapObject()); | 806 ASSERT(raw_obj->IsHeapObject()); |
| 807 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 807 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 808 return MirrorReference::InstanceSize(); | 808 return MirrorReference::InstanceSize(); |
| 809 } | 809 } |
| 810 | 810 |
| 811 } // namespace dart | 811 } // namespace dart |
| OLD | NEW |