Commit e7efc885 authored by balazs.kilvady's avatar balazs.kilvady Committed by Commit bot

MIPS: CheckPrototypes uses weak cells to embed maps.

Port 062a032f

BUG=v8:3629
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#25645}
parent e86a933a
......@@ -412,11 +412,11 @@ Register PropertyHandlerCompiler::CheckPrototypes(
__ lw(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
} else {
Register map_reg = scratch1;
__ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
if (depth != 1 || check == CHECK_ALL_MAPS) {
// CheckMap implicitly loads the map of |reg| into |map_reg|.
__ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK);
} else {
__ lw(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
__ CmpWeakValue(scratch2, map_reg, cell);
__ Branch(miss, ne, scratch2, Operand(zero_reg));
}
// Check access rights to the global object. This has to happen after
......@@ -447,7 +447,10 @@ Register PropertyHandlerCompiler::CheckPrototypes(
if (depth != 0 || check == CHECK_ALL_MAPS) {
// Check the holder map.
__ CheckMap(reg, scratch1, current_map, miss, DONT_DO_SMI_CHECK);
__ lw(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
__ CmpWeakValue(scratch2, scratch1, cell);
__ Branch(miss, ne, scratch2, Operand(zero_reg));
}
// Perform security check for access to the global object.
......
......@@ -412,11 +412,11 @@ Register PropertyHandlerCompiler::CheckPrototypes(
__ ld(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
} else {
Register map_reg = scratch1;
__ ld(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
if (depth != 1 || check == CHECK_ALL_MAPS) {
// CheckMap implicitly loads the map of |reg| into |map_reg|.
__ CheckMap(reg, map_reg, current_map, miss, DONT_DO_SMI_CHECK);
} else {
__ ld(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
__ CmpWeakValue(scratch2, map_reg, cell);
__ Branch(miss, ne, scratch2, Operand(zero_reg));
}
// Check access rights to the global object. This has to happen after
......@@ -447,7 +447,10 @@ Register PropertyHandlerCompiler::CheckPrototypes(
if (depth != 0 || check == CHECK_ALL_MAPS) {
// Check the holder map.
__ CheckMap(reg, scratch1, current_map, miss, DONT_DO_SMI_CHECK);
__ ld(scratch1, FieldMemOperand(reg, HeapObject::kMapOffset));
Handle<WeakCell> cell = Map::WeakCellForMap(current_map);
__ CmpWeakValue(scratch2, scratch1, cell);
__ Branch(miss, ne, scratch2, Operand(zero_reg));
}
// Perform security check for access to the global object.
......
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