Commit 6af7ca6b authored by verwaest's avatar verwaest Committed by Commit bot

Skip the mapcheck on the global object since the global proxy and cell are...

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}
parent 8db3ce1d
...@@ -473,15 +473,14 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -473,15 +473,14 @@ Register PropertyHandlerCompiler::CheckPrototypes(
} else { } else {
Register map_reg = scratch1; Register map_reg = scratch1;
__ ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); __ 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()) { if (current_map->IsJSGlobalObjectMap()) {
GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current),
name, scratch2, miss); 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. reg = holder_reg; // From now on the object will be in holder_reg.
...@@ -494,6 +493,8 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -494,6 +493,8 @@ Register PropertyHandlerCompiler::CheckPrototypes(
current_map = handle(current->map()); current_map = handle(current->map());
} }
DCHECK(!current_map->IsJSGlobalProxyMap());
// Log the check depth. // Log the check depth.
LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
......
...@@ -523,15 +523,13 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -523,15 +523,13 @@ Register PropertyHandlerCompiler::CheckPrototypes(
Register map_reg = scratch1; Register map_reg = scratch1;
__ Ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); __ 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()) { if (current_map->IsJSGlobalObjectMap()) {
GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current), GenerateCheckPropertyCell(masm(), Handle<JSGlobalObject>::cast(current),
name, scratch2, miss); 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. reg = holder_reg; // From now on the object will be in holder_reg.
...@@ -544,6 +542,8 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -544,6 +542,8 @@ Register PropertyHandlerCompiler::CheckPrototypes(
current_map = handle(current->map()); current_map = handle(current->map());
} }
DCHECK(!current_map->IsJSGlobalProxyMap());
// Log the check depth. // Log the check depth.
LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
......
...@@ -476,16 +476,15 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -476,16 +476,15 @@ Register PropertyHandlerCompiler::CheckPrototypes(
} else { } else {
Register map_reg = scratch1; Register map_reg = scratch1;
__ mov(map_reg, FieldOperand(reg, HeapObject::kMapOffset)); __ 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); Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
__ CmpWeakValue(map_reg, cell, scratch2); __ CmpWeakValue(map_reg, cell, scratch2);
__ j(not_equal, miss); __ 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. reg = holder_reg; // From now on the object will be in holder_reg.
__ mov(reg, FieldOperand(map_reg, Map::kPrototypeOffset)); __ mov(reg, FieldOperand(map_reg, Map::kPrototypeOffset));
} }
...@@ -495,6 +494,8 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -495,6 +494,8 @@ Register PropertyHandlerCompiler::CheckPrototypes(
current_map = handle(current->map()); current_map = handle(current->map());
} }
DCHECK(!current_map->IsJSGlobalProxyMap());
// Log the check depth. // Log the check depth.
LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
......
...@@ -477,16 +477,15 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -477,16 +477,15 @@ Register PropertyHandlerCompiler::CheckPrototypes(
Register map_reg = scratch1; Register map_reg = scratch1;
__ movp(map_reg, FieldOperand(reg, HeapObject::kMapOffset)); __ 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); Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
__ CmpWeakValue(map_reg, cell, scratch2); __ CmpWeakValue(map_reg, cell, scratch2);
__ j(not_equal, miss); __ 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. reg = holder_reg; // From now on the object will be in holder_reg.
__ movp(reg, FieldOperand(map_reg, Map::kPrototypeOffset)); __ movp(reg, FieldOperand(map_reg, Map::kPrototypeOffset));
...@@ -497,6 +496,8 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -497,6 +496,8 @@ Register PropertyHandlerCompiler::CheckPrototypes(
current_map = handle(current->map()); current_map = handle(current->map());
} }
DCHECK(!current_map->IsJSGlobalProxyMap());
// Log the check depth. // Log the check depth.
LOG(isolate(), IntEvent("check-maps-depth", depth + 1)); LOG(isolate(), IntEvent("check-maps-depth", depth + 1));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment