Chromium Code Reviews| 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 428 RawLibraryPrefix* raw_obj, ObjectPointerVisitor* visitor) { | 428 RawLibraryPrefix* raw_obj, ObjectPointerVisitor* visitor) { |
| 429 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 429 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 430 return LibraryPrefix::InstanceSize(); | 430 return LibraryPrefix::InstanceSize(); |
| 431 } | 431 } |
| 432 | 432 |
| 433 | 433 |
| 434 intptr_t RawCode::VisitCodePointers(RawCode* raw_obj, | 434 intptr_t RawCode::VisitCodePointers(RawCode* raw_obj, |
| 435 ObjectPointerVisitor* visitor) { | 435 ObjectPointerVisitor* visitor) { |
| 436 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 436 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 437 | 437 |
| 438 // Also visit all the embedded pointers in the corresponding instructions. | |
| 439 RawCode* obj = raw_obj->ptr(); | 438 RawCode* obj = raw_obj->ptr(); |
| 440 intptr_t length = obj->pointer_offsets_length_; | 439 intptr_t length = obj->pointer_offsets_length_; |
| 441 uword entry_point = reinterpret_cast<uword>(obj->instructions_->ptr()) + | 440 if (obj->is_alive_ == 1) { |
| 442 Instructions::HeaderSize(); | 441 // Also visit all the embedded pointers in the corresponding instructions. |
| 443 for (intptr_t i = 0; i < length; i++) { | 442 uword entry_point = reinterpret_cast<uword>(obj->instructions_->ptr()) + |
| 444 int32_t offset = obj->data_[i]; | 443 Instructions::HeaderSize(); |
| 445 visitor->VisitPointer(reinterpret_cast<RawObject**>(entry_point + offset)); | 444 for (intptr_t i = 0; i < length; i++) { |
| 445 int32_t offset = obj->data_[i]; | |
| 446 visitor->VisitPointer( | |
| 447 reinterpret_cast<RawObject**>(entry_point + offset)); | |
| 448 } | |
| 446 } | 449 } |
|
siva
2012/09/06 16:57:55
I am assuming the change to mark an object as not
srdjan
2012/09/06 17:06:03
Correct.
| |
| 447 return Code::InstanceSize(length); | 450 return Code::InstanceSize(length); |
| 448 } | 451 } |
| 449 | 452 |
| 450 | 453 |
| 451 intptr_t RawInstructions::VisitInstructionsPointers( | 454 intptr_t RawInstructions::VisitInstructionsPointers( |
| 452 RawInstructions* raw_obj, ObjectPointerVisitor* visitor) { | 455 RawInstructions* raw_obj, ObjectPointerVisitor* visitor) { |
| 453 RawInstructions* obj = raw_obj->ptr(); | 456 RawInstructions* obj = raw_obj->ptr(); |
| 454 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->code_)); | 457 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->code_)); |
| 455 return Instructions::InstanceSize(obj->size_); | 458 return Instructions::InstanceSize(obj->size_); |
| 456 } | 459 } |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 978 | 981 |
| 979 intptr_t RawWeakProperty::VisitWeakPropertyPointers( | 982 intptr_t RawWeakProperty::VisitWeakPropertyPointers( |
| 980 RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) { | 983 RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) { |
| 981 // Make sure that we got here with the tagged pointer as this. | 984 // Make sure that we got here with the tagged pointer as this. |
| 982 ASSERT(raw_obj->IsHeapObject()); | 985 ASSERT(raw_obj->IsHeapObject()); |
| 983 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 986 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 984 return WeakProperty::InstanceSize(); | 987 return WeakProperty::InstanceSize(); |
| 985 } | 988 } |
| 986 | 989 |
| 987 } // namespace dart | 990 } // namespace dart |
| OLD | NEW |