Chromium Code Reviews| Index: src/objects.cc |
| diff --git a/src/objects.cc b/src/objects.cc |
| index 0825b64c3367e5d2d92bcd5a8374b3ec616eef6e..34b981f7fdf41f3c5a37c3bae3a6efaa3a839041 100644 |
| --- a/src/objects.cc |
| +++ b/src/objects.cc |
| @@ -9208,6 +9208,23 @@ void Code::Disassemble(const char* name, FILE* out) { |
| #endif // ENABLE_DISASSEMBLER |
| +#ifdef VERIFY_HEAP |
| +void Code::VerifyEmbeddedMaps() { |
|
Michael Starzinger
2013/01/31 14:27:50
This whole implementation belongs into objects-deb
ulan
2013/02/04 09:54:06
Done.
|
| + int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT); |
| + for (RelocIterator it(this, mode_mask); !it.done(); it.next()) { |
| + RelocInfo::Mode mode = it.rinfo()->rmode(); |
| + if (mode == RelocInfo::EMBEDDED_OBJECT && |
| + it.rinfo()->target_object()->IsMap()) { |
| + Map* map = Map::cast(it.rinfo()->target_object()); |
|
Michael Starzinger
2013/01/31 14:27:50
Indentation is off.
ulan
2013/02/04 09:54:06
Done.
|
| + if (map->CanTransition()) { |
| + CHECK(map->dependent_codes()->Contains(this)); |
| + } |
| + } |
| + } |
| +} |
| +#endif |
| + |
| + |
| MaybeObject* JSObject::SetFastElementsCapacityAndLength( |
| int capacity, |
| int length, |
| @@ -9508,6 +9525,15 @@ Handle<DependentCodes> DependentCodes::Append(Handle<DependentCodes> codes, |
| } |
| +bool DependentCodes::Contains(Code* code) { |
| + int limit = number_of_codes(); |
| + for (int i = 0; i < limit; i++) { |
| + if (code_at(i) == code) return true; |
| + } |
| + return false; |
| +} |
| + |
| + |
| MaybeObject* JSReceiver::SetPrototype(Object* value, |
| bool skip_hidden_prototypes) { |
| #ifdef DEBUG |