Index: src/x64/macro-assembler-x64.cc |
=================================================================== |
--- src/x64/macro-assembler-x64.cc (revision 5040) |
+++ src/x64/macro-assembler-x64.cc (working copy) |
@@ -2322,101 +2322,6 @@ |
} |
-Register MacroAssembler::CheckMaps(JSObject* object, |
- Register object_reg, |
- JSObject* holder, |
- Register holder_reg, |
- Register scratch, |
- int save_at_depth, |
- Label* miss) { |
- // Make sure there's no overlap between scratch and the other |
- // registers. |
- ASSERT(!scratch.is(object_reg) && !scratch.is(holder_reg)); |
- |
- // Keep track of the current object in register reg. On the first |
- // iteration, reg is an alias for object_reg, on later iterations, |
- // it is an alias for holder_reg. |
- Register reg = object_reg; |
- int depth = 0; |
- |
- if (save_at_depth == depth) { |
- movq(Operand(rsp, kPointerSize), object_reg); |
- } |
- |
- // Check the maps in the prototype chain. |
- // Traverse the prototype chain from the object and do map checks. |
- while (object != holder) { |
- depth++; |
- |
- // Only global objects and objects that do not require access |
- // checks are allowed in stubs. |
- ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); |
- |
- JSObject* prototype = JSObject::cast(object->GetPrototype()); |
- if (Heap::InNewSpace(prototype)) { |
- // Get the map of the current object. |
- movq(scratch, FieldOperand(reg, HeapObject::kMapOffset)); |
- Cmp(scratch, Handle<Map>(object->map())); |
- // Branch on the result of the map check. |
- j(not_equal, miss); |
- // Check access rights to the global object. This has to happen |
- // after the map check so that we know that the object is |
- // actually a global object. |
- if (object->IsJSGlobalProxy()) { |
- CheckAccessGlobalProxy(reg, scratch, miss); |
- |
- // Restore scratch register to be the map of the object. |
- // We load the prototype from the map in the scratch register. |
- movq(scratch, FieldOperand(reg, HeapObject::kMapOffset)); |
- } |
- // The prototype is in new space; we cannot store a reference |
- // to it in the code. Load it from the map. |
- reg = holder_reg; // from now the object is in holder_reg |
- movq(reg, FieldOperand(scratch, Map::kPrototypeOffset)); |
- |
- } else { |
- // Check the map of the current object. |
- Cmp(FieldOperand(reg, HeapObject::kMapOffset), |
- Handle<Map>(object->map())); |
- // Branch on the result of the map check. |
- j(not_equal, miss); |
- // Check access rights to the global object. This has to happen |
- // after the map check so that we know that the object is |
- // actually a global object. |
- if (object->IsJSGlobalProxy()) { |
- CheckAccessGlobalProxy(reg, scratch, miss); |
- } |
- // The prototype is in old space; load it directly. |
- reg = holder_reg; // from now the object is in holder_reg |
- Move(reg, Handle<JSObject>(prototype)); |
- } |
- |
- if (save_at_depth == depth) { |
- movq(Operand(rsp, kPointerSize), reg); |
- } |
- |
- // Go to the next object in the prototype chain. |
- object = prototype; |
- } |
- |
- // Check the holder map. |
- Cmp(FieldOperand(reg, HeapObject::kMapOffset), Handle<Map>(holder->map())); |
- j(not_equal, miss); |
- |
- // Log the check depth. |
- LOG(IntEvent("check-maps-depth", depth + 1)); |
- |
- // Perform security check for access to the global object and return |
- // the holder register. |
- ASSERT(object == holder); |
- ASSERT(object->IsJSGlobalProxy() || !object->IsAccessCheckNeeded()); |
- if (object->IsJSGlobalProxy()) { |
- CheckAccessGlobalProxy(reg, scratch, miss); |
- } |
- return reg; |
-} |
- |
- |
void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg, |
Register scratch, |
Label* miss) { |