diff --git a/src/ic/arm/handler-compiler-arm.cc b/src/ic/arm/handler-compiler-arm.cc index a4c0607905..3cf3a44afa 100644 --- a/src/ic/arm/handler-compiler-arm.cc +++ b/src/ic/arm/handler-compiler-arm.cc @@ -473,15 +473,14 @@ Register PropertyHandlerCompiler::CheckPrototypes( } else { Register map_reg = scratch1; __ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); - if (depth != 1 || check == CHECK_ALL_MAPS) { - Handle cell = Map::WeakCellForMap(current_map); - __ CmpWeakValue(map_reg, cell, scratch2); - __ b(ne, miss); - } if (current_map->IsJSGlobalObjectMap()) { GenerateCheckPropertyCell(masm(), Handle::cast(current), name, scratch2, miss); + } else if (depth != 1 || check == CHECK_ALL_MAPS) { + Handle cell = Map::WeakCellForMap(current_map); + __ CmpWeakValue(map_reg, cell, scratch2); + __ b(ne, miss); } reg = holder_reg; // From now on the object will be in holder_reg. @@ -494,6 +493,8 @@ Register PropertyHandlerCompiler::CheckPrototypes( current_map = handle(current->map()); } + DCHECK(!current_map->IsJSGlobalProxyMap()); + // Log the check depth. LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); diff --git a/src/ic/arm64/handler-compiler-arm64.cc b/src/ic/arm64/handler-compiler-arm64.cc index 53519179f2..de1b9f598f 100644 --- a/src/ic/arm64/handler-compiler-arm64.cc +++ b/src/ic/arm64/handler-compiler-arm64.cc @@ -523,15 +523,13 @@ Register PropertyHandlerCompiler::CheckPrototypes( Register map_reg = scratch1; __ Ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); - if (depth != 1 || check == CHECK_ALL_MAPS) { - Handle cell = Map::WeakCellForMap(current_map); - __ CmpWeakValue(map_reg, cell, scratch2); - __ B(ne, miss); - } - if (current_map->IsJSGlobalObjectMap()) { GenerateCheckPropertyCell(masm(), Handle::cast(current), name, scratch2, miss); + } else if (depth != 1 || check == CHECK_ALL_MAPS) { + Handle cell = Map::WeakCellForMap(current_map); + __ CmpWeakValue(map_reg, cell, scratch2); + __ B(ne, miss); } reg = holder_reg; // From now on the object will be in holder_reg. @@ -544,6 +542,8 @@ Register PropertyHandlerCompiler::CheckPrototypes( current_map = handle(current->map()); } + DCHECK(!current_map->IsJSGlobalProxyMap()); + // Log the check depth. LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); diff --git a/src/ic/ia32/handler-compiler-ia32.cc b/src/ic/ia32/handler-compiler-ia32.cc index 7bb426c61e..c02d83ce46 100644 --- a/src/ic/ia32/handler-compiler-ia32.cc +++ b/src/ic/ia32/handler-compiler-ia32.cc @@ -476,16 +476,15 @@ Register PropertyHandlerCompiler::CheckPrototypes( } else { Register map_reg = scratch1; __ mov(map_reg, FieldOperand(reg, HeapObject::kMapOffset)); - if (depth != 1 || check == CHECK_ALL_MAPS) { + if (current_map->IsJSGlobalObjectMap()) { + GenerateCheckPropertyCell(masm(), Handle::cast(current), + name, scratch2, miss); + } else if (depth != 1 || check == CHECK_ALL_MAPS) { Handle cell = Map::WeakCellForMap(current_map); __ CmpWeakValue(map_reg, cell, scratch2); __ j(not_equal, miss); } - if (current_map->IsJSGlobalObjectMap()) { - GenerateCheckPropertyCell(masm(), Handle::cast(current), - name, scratch2, miss); - } reg = holder_reg; // From now on the object will be in holder_reg. __ mov(reg, FieldOperand(map_reg, Map::kPrototypeOffset)); } @@ -495,6 +494,8 @@ Register PropertyHandlerCompiler::CheckPrototypes( current_map = handle(current->map()); } + DCHECK(!current_map->IsJSGlobalProxyMap()); + // Log the check depth. LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); diff --git a/src/ic/x64/handler-compiler-x64.cc b/src/ic/x64/handler-compiler-x64.cc index 4b066f2d42..23882dcb5c 100644 --- a/src/ic/x64/handler-compiler-x64.cc +++ b/src/ic/x64/handler-compiler-x64.cc @@ -477,16 +477,15 @@ Register PropertyHandlerCompiler::CheckPrototypes( Register map_reg = scratch1; __ movp(map_reg, FieldOperand(reg, HeapObject::kMapOffset)); - if (depth != 1 || check == CHECK_ALL_MAPS) { + if (current_map->IsJSGlobalObjectMap()) { + GenerateCheckPropertyCell(masm(), Handle::cast(current), + name, scratch2, miss); + } else if (depth != 1 || check == CHECK_ALL_MAPS) { Handle cell = Map::WeakCellForMap(current_map); __ CmpWeakValue(map_reg, cell, scratch2); __ j(not_equal, miss); } - if (current_map->IsJSGlobalObjectMap()) { - GenerateCheckPropertyCell(masm(), Handle::cast(current), - name, scratch2, miss); - } reg = holder_reg; // From now on the object will be in holder_reg. __ movp(reg, FieldOperand(map_reg, Map::kPrototypeOffset)); @@ -497,6 +496,8 @@ Register PropertyHandlerCompiler::CheckPrototypes( current_map = handle(current->map()); } + DCHECK(!current_map->IsJSGlobalProxyMap()); + // Log the check depth. LOG(isolate(), IntEvent("check-maps-depth", depth + 1));