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/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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 535 return false; | 535 return false; |
| 536 } | 536 } |
| 537 | 537 |
| 538 | 538 |
| 539 intptr_t RawCode::VisitCodePointers(RawCode* raw_obj, | 539 intptr_t RawCode::VisitCodePointers(RawCode* raw_obj, |
| 540 ObjectPointerVisitor* visitor) { | 540 ObjectPointerVisitor* visitor) { |
| 541 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 541 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 542 | 542 |
| 543 RawCode* obj = raw_obj->ptr(); | 543 RawCode* obj = raw_obj->ptr(); |
| 544 intptr_t length = Code::PtrOffBits::decode(obj->state_bits_); | 544 intptr_t length = Code::PtrOffBits::decode(obj->state_bits_); |
| 545 #if defined(TARGET_ARCH_IA32) | |
|
Florian Schneider
2016/03/19 09:51:47
Maybe add a comment why this is only needed on ia3
rmacnak
2016/03/21 17:48:48
Done.
| |
| 545 if (Code::AliveBit::decode(obj->state_bits_)) { | 546 if (Code::AliveBit::decode(obj->state_bits_)) { |
| 546 // Also visit all the embedded pointers in the corresponding instructions. | 547 // Also visit all the embedded pointers in the corresponding instructions. |
| 547 uword entry_point = reinterpret_cast<uword>(obj->instructions_->ptr()) + | 548 uword entry_point = reinterpret_cast<uword>(obj->instructions_->ptr()) + |
| 548 Instructions::HeaderSize(); | 549 Instructions::HeaderSize(); |
| 549 for (intptr_t i = 0; i < length; i++) { | 550 for (intptr_t i = 0; i < length; i++) { |
| 550 int32_t offset = obj->data()[i]; | 551 int32_t offset = obj->data()[i]; |
| 551 visitor->VisitPointer( | 552 visitor->VisitPointer( |
| 552 reinterpret_cast<RawObject**>(entry_point + offset)); | 553 reinterpret_cast<RawObject**>(entry_point + offset)); |
| 553 } | 554 } |
| 554 } | 555 } |
| 555 return Code::InstanceSize(length); | 556 return Code::InstanceSize(length); |
| 557 #else | |
| 558 ASSERT(length == 0); | |
| 559 return Code::InstanceSize(0); | |
| 560 #endif | |
| 556 } | 561 } |
| 557 | 562 |
| 558 | 563 |
| 559 intptr_t RawObjectPool::VisitObjectPoolPointers( | 564 intptr_t RawObjectPool::VisitObjectPoolPointers( |
| 560 RawObjectPool* raw_obj, ObjectPointerVisitor* visitor) { | 565 RawObjectPool* raw_obj, ObjectPointerVisitor* visitor) { |
| 561 visitor->VisitPointer( | 566 visitor->VisitPointer( |
| 562 reinterpret_cast<RawObject**>(&raw_obj->ptr()->info_array_)); | 567 reinterpret_cast<RawObject**>(&raw_obj->ptr()->info_array_)); |
| 563 const intptr_t len = raw_obj->ptr()->length_; | 568 const intptr_t len = raw_obj->ptr()->length_; |
| 564 RawTypedData* info_array = raw_obj->ptr()->info_array_->ptr(); | 569 RawTypedData* info_array = raw_obj->ptr()->info_array_->ptr(); |
| 565 Entry* first = raw_obj->first_entry(); | 570 Entry* first = raw_obj->first_entry(); |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 961 intptr_t RawUserTag::VisitUserTagPointers( | 966 intptr_t RawUserTag::VisitUserTagPointers( |
| 962 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) { | 967 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) { |
| 963 // Make sure that we got here with the tagged pointer as this. | 968 // Make sure that we got here with the tagged pointer as this. |
| 964 ASSERT(raw_obj->IsHeapObject()); | 969 ASSERT(raw_obj->IsHeapObject()); |
| 965 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 970 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 966 return UserTag::InstanceSize(); | 971 return UserTag::InstanceSize(); |
| 967 } | 972 } |
| 968 | 973 |
| 969 | 974 |
| 970 } // namespace dart | 975 } // namespace dart |
| OLD | NEW |