Commit 100db758 authored by ulan's avatar ulan Committed by Commit bot

Load prototype from map in PropertyHandlerCompiler::CheckPrototypes.

BUG=v8:3629
LOG=N
TBR=verwaest@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#25490}
parent fc22bf2e
...@@ -438,17 +438,7 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -438,17 +438,7 @@ Register PropertyHandlerCompiler::CheckPrototypes(
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.
// Two possible reasons for loading the prototype from the map: __ ldr(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset));
// (1) Can't store references to new space in code.
// (2) Handler is shared for all receivers with the same prototype
// map (but not necessarily the same prototype instance).
bool load_prototype_from_map =
heap()->InNewSpace(*prototype) || depth == 1;
if (load_prototype_from_map) {
__ ldr(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset));
} else {
__ mov(reg, Operand(prototype));
}
} }
// Go to the next object in the prototype chain. // Go to the next object in the prototype chain.
......
...@@ -457,12 +457,6 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -457,12 +457,6 @@ Register PropertyHandlerCompiler::CheckPrototypes(
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.
__ Ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset)); __ Ldr(reg, FieldMemOperand(scratch1, Map::kPrototypeOffset));
} else { } else {
// Two possible reasons for loading the prototype from the map:
// (1) Can't store references to new space in code.
// (2) Handler is shared for all receivers with the same prototype
// map (but not necessarily the same prototype instance).
bool load_prototype_from_map =
heap()->InNewSpace(*prototype) || depth == 1;
Register map_reg = scratch1; Register map_reg = scratch1;
__ Ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset)); __ Ldr(map_reg, FieldMemOperand(reg, HeapObject::kMapOffset));
...@@ -486,11 +480,7 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -486,11 +480,7 @@ Register PropertyHandlerCompiler::CheckPrototypes(
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.
if (load_prototype_from_map) { __ Ldr(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset));
__ Ldr(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset));
} else {
__ Mov(reg, Operand(prototype));
}
} }
// Go to the next object in the prototype chain. // Go to the next object in the prototype chain.
......
...@@ -415,12 +415,6 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -415,12 +415,6 @@ Register PropertyHandlerCompiler::CheckPrototypes(
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(scratch1, Map::kPrototypeOffset)); __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
} else { } else {
bool in_new_space = heap()->InNewSpace(*prototype);
// Two possible reasons for loading the prototype from the map:
// (1) Can't store references to new space in code.
// (2) Handler is shared for all receivers with the same prototype
// map (but not necessarily the same prototype instance).
bool load_prototype_from_map = in_new_space || depth == 1;
if (depth != 1 || check == CHECK_ALL_MAPS) { if (depth != 1 || check == CHECK_ALL_MAPS) {
__ CheckMap(reg, current_map, miss, DONT_DO_SMI_CHECK); __ CheckMap(reg, current_map, miss, DONT_DO_SMI_CHECK);
} }
...@@ -438,18 +432,9 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -438,18 +432,9 @@ Register PropertyHandlerCompiler::CheckPrototypes(
name, scratch2, miss); name, scratch2, miss);
} }
if (load_prototype_from_map) { __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
// Save the map in scratch1 for later.
__ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
}
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(scratch1, Map::kPrototypeOffset));
if (load_prototype_from_map) {
__ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
} else {
__ mov(reg, prototype);
}
} }
// Go to the next object in the prototype chain. // Go to the next object in the prototype chain.
......
...@@ -434,17 +434,7 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -434,17 +434,7 @@ Register PropertyHandlerCompiler::CheckPrototypes(
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.
// Two possible reasons for loading the prototype from the map: __ lw(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset));
// (1) Can't store references to new space in code.
// (2) Handler is shared for all receivers with the same prototype
// map (but not necessarily the same prototype instance).
bool load_prototype_from_map =
heap()->InNewSpace(*prototype) || depth == 1;
if (load_prototype_from_map) {
__ lw(reg, FieldMemOperand(map_reg, Map::kPrototypeOffset));
} else {
__ li(reg, Operand(prototype));
}
} }
// Go to the next object in the prototype chain. // Go to the next object in the prototype chain.
......
...@@ -413,16 +413,9 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -413,16 +413,9 @@ Register PropertyHandlerCompiler::CheckPrototypes(
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(scratch1, Map::kPrototypeOffset)); __ movp(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
} else { } else {
bool in_new_space = heap()->InNewSpace(*prototype); // Save the map in scratch1 for later.
// Two possible reasons for loading the prototype from the map: __ movp(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
// (1) Can't store references to new space in code.
// (2) Handler is shared for all receivers with the same prototype
// map (but not necessarily the same prototype instance).
bool load_prototype_from_map = in_new_space || depth == 1;
if (load_prototype_from_map) {
// Save the map in scratch1 for later.
__ movp(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
}
if (depth != 1 || check == CHECK_ALL_MAPS) { if (depth != 1 || check == CHECK_ALL_MAPS) {
__ CheckMap(reg, current_map, miss, DONT_DO_SMI_CHECK); __ CheckMap(reg, current_map, miss, DONT_DO_SMI_CHECK);
} }
...@@ -441,11 +434,7 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -441,11 +434,7 @@ Register PropertyHandlerCompiler::CheckPrototypes(
} }
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.
if (load_prototype_from_map) { __ movp(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
__ movp(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
} else {
__ Move(reg, prototype);
}
} }
// Go to the next object in the prototype chain. // Go to the next object in the prototype chain.
......
...@@ -415,12 +415,6 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -415,12 +415,6 @@ Register PropertyHandlerCompiler::CheckPrototypes(
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(scratch1, Map::kPrototypeOffset)); __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
} else { } else {
bool in_new_space = heap()->InNewSpace(*prototype);
// Two possible reasons for loading the prototype from the map:
// (1) Can't store references to new space in code.
// (2) Handler is shared for all receivers with the same prototype
// map (but not necessarily the same prototype instance).
bool load_prototype_from_map = in_new_space || depth == 1;
if (depth != 1 || check == CHECK_ALL_MAPS) { if (depth != 1 || check == CHECK_ALL_MAPS) {
__ CheckMap(reg, current_map, miss, DONT_DO_SMI_CHECK); __ CheckMap(reg, current_map, miss, DONT_DO_SMI_CHECK);
} }
...@@ -438,18 +432,11 @@ Register PropertyHandlerCompiler::CheckPrototypes( ...@@ -438,18 +432,11 @@ Register PropertyHandlerCompiler::CheckPrototypes(
name, scratch2, miss); name, scratch2, miss);
} }
if (load_prototype_from_map) { __ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
// Save the map in scratch1 for later.
__ mov(scratch1, FieldOperand(reg, HeapObject::kMapOffset));
}
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.
if (load_prototype_from_map) { __ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
__ mov(reg, FieldOperand(scratch1, Map::kPrototypeOffset));
} else {
__ mov(reg, prototype);
}
} }
// Go to the next object in the prototype chain. // Go to the next object in the prototype chain.
......
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