Index: src/ia32/macro-assembler-ia32.cc |
=================================================================== |
--- src/ia32/macro-assembler-ia32.cc (revision 5007) |
+++ src/ia32/macro-assembler-ia32.cc (working copy) |
@@ -542,97 +542,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. |
- Register reg = object_reg; |
- int depth = 0; |
- |
- if (save_at_depth == depth) { |
- mov(Operand(esp, 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. |
- mov(scratch, FieldOperand(reg, HeapObject::kMapOffset)); |
- cmp(Operand(scratch), Immediate(Handle<Map>(object->map()))); |
- // Branch on the result of the map check. |
- j(not_equal, miss, not_taken); |
- // 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. |
- mov(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 |
- mov(reg, FieldOperand(scratch, Map::kPrototypeOffset)); |
- } else { |
- // Check the map of the current object. |
- cmp(FieldOperand(reg, HeapObject::kMapOffset), |
- Immediate(Handle<Map>(object->map()))); |
- // Branch on the result of the map check. |
- j(not_equal, miss, not_taken); |
- // 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 |
- mov(reg, Handle<JSObject>(prototype)); |
- } |
- |
- if (save_at_depth == depth) { |
- mov(Operand(esp, kPointerSize), reg); |
- } |
- |
- // Go to the next object in the prototype chain. |
- object = prototype; |
- } |
- |
- // Check the holder map. |
- cmp(FieldOperand(reg, HeapObject::kMapOffset), |
- Immediate(Handle<Map>(holder->map()))); |
- j(not_equal, miss, not_taken); |
- |
- // 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) { |