| Index: src/objects-debug.cc
|
| diff --git a/src/objects-debug.cc b/src/objects-debug.cc
|
| index ba9ff65be0c4883b97685076fdeef82e9f528671..6f9b31b6abb98722a065641adee8612443594070 100644
|
| --- a/src/objects-debug.cc
|
| +++ b/src/objects-debug.cc
|
| @@ -640,15 +640,29 @@ void Code::CodeVerify() {
|
| }
|
|
|
|
|
| +static bool CodeListContains(Object* head, Code* code) {
|
| + while (!head->IsUndefined()) {
|
| + if (head == code) return true;
|
| + head = Code::cast(head)->next_code_link();
|
| + }
|
| + return false;
|
| +}
|
| +
|
| +
|
| void Code::VerifyEmbeddedObjectsDependency() {
|
| + if (!CanContainWeakObjects()) return;
|
| int mode_mask = RelocInfo::ModeMask(RelocInfo::EMBEDDED_OBJECT);
|
| for (RelocIterator it(this, mode_mask); !it.done(); it.next()) {
|
| Object* obj = it.rinfo()->target_object();
|
| if (IsWeakObject(obj)) {
|
| if (obj->IsMap()) {
|
| Map* map = Map::cast(obj);
|
| - CHECK(map->dependent_code()->Contains(
|
| - DependentCode::kWeaklyEmbeddedGroup, this));
|
| + if (is_optimized_code()) {
|
| + CHECK(map->dependent_code()->Contains(
|
| + DependentCode::kWeaklyEmbeddedGroup, this));
|
| + } else {
|
| + CHECK(CodeListContains(map->dependent_ic(), this));
|
| + }
|
| } else if (obj->IsJSObject()) {
|
| Object* raw_table = GetIsolate()->heap()->weak_object_to_code_table();
|
| WeakHashTable* table = WeakHashTable::cast(raw_table);
|
|
|