Skip the mapcheck on the global object since the global proxy and cell are already checked (or the global object map for contextual global loads).

BUG=

Review URL: https://codereview.chromium.org/961693002

Cr-Commit-Position: refs/heads/master@{#26886}
This commit is contained in:
verwaest 2015-02-26 07:12:01 -08:00 committed by Commit bot
parent 8db3ce1dba
commit 6af7ca6be4
4 changed files with 24 additions and 21 deletions

View File

@ -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<WeakCell> cell = Map::WeakCellForMap(current_map);
__ CmpWeakValue(map_reg, cell, scratch2);
__ b(ne, miss);
}
if (current_map->IsJSGlobalObjectMap()) {
GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current),
name, scratch2, miss);
} else if (depth != 1 || check == CHECK_ALL_MAPS) {
Handle<WeakCell> 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));

View File

@ -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<WeakCell> cell = Map::WeakCellForMap(current_map);
__ CmpWeakValue(map_reg, cell, scratch2);
__ B(ne, miss);
}
if (current_map->IsJSGlobalObjectMap()) {
GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current),
name, scratch2, miss);
} else if (depth != 1 || check == CHECK_ALL_MAPS) {
Handle<WeakCell> 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));

View File

@ -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<JSGlobalObject>::cast(current),
name, scratch2, miss);
} else if (depth != 1 || check == CHECK_ALL_MAPS) {
Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
__ CmpWeakValue(map_reg, cell, scratch2);
__ j(not_equal, miss);
}
if (current_map->IsJSGlobalObjectMap()) {
GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::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));

View File

@ -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<JSGlobalObject>::cast(current),
name, scratch2, miss);
} else if (depth != 1 || check == CHECK_ALL_MAPS) {
Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
__ CmpWeakValue(map_reg, cell, scratch2);
__ j(not_equal, miss);
}
if (current_map->IsJSGlobalObjectMap()) {
GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::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));