Removing BinaryOpIC::Clear. This method relied on some less-than-obvious hack,
authorkaznacheev@chromium.org <kaznacheev@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 8 Apr 2010 13:41:11 +0000 (13:41 +0000)
committerkaznacheev@chromium.org <kaznacheev@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 8 Apr 2010 13:41:11 +0000 (13:41 +0000)
and there was zero (or small negative) performance advantage.

Review URL: http://codereview.chromium.org/1623005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4362 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/ia32/codegen-ia32.cc
src/ic.cc
src/x64/codegen-x64.cc

index a51edb3..4a2f3fd 100644 (file)
@@ -9518,13 +9518,6 @@ void GenericBinaryOpStub::Generate(MacroAssembler* masm) {
     default:
       UNREACHABLE();
   }
-
-  // Generate an unreachable reference to the DEFAULT stub so that it can be
-  // found at the end of this stub when clearing ICs at GC.
-  if (runtime_operands_type_ != BinaryOpIC::DEFAULT) {
-    GenericBinaryOpStub uninit(MinorKey(), BinaryOpIC::DEFAULT);
-    __ TailCallStub(&uninit);
-  }
 }
 
 
index a6d2020..0f7072b 100644 (file)
--- a/src/ic.cc
+++ b/src/ic.cc
@@ -224,7 +224,8 @@ void IC::Clear(Address address) {
     case Code::STORE_IC: return StoreIC::Clear(address, target);
     case Code::KEYED_STORE_IC: return KeyedStoreIC::Clear(address, target);
     case Code::CALL_IC: return CallIC::Clear(address, target);
-    case Code::BINARY_OP_IC: return BinaryOpIC::Clear(address, target);
+    case Code::BINARY_OP_IC: return;  // Clearing these is tricky and does not
+                                      // make any performance difference.
     default: UNREACHABLE();
   }
 }
@@ -1404,25 +1405,6 @@ void BinaryOpIC::patch(Code* code) {
 }
 
 
-void BinaryOpIC::Clear(Address address, Code* target) {
-  if (target->ic_state() == UNINITIALIZED) return;
-
-  // At the end of a fast case stub there should be a reference to
-  // a corresponding UNINITIALIZED stub, so look for the last reloc info item.
-  RelocInfo* rinfo = NULL;
-  for (RelocIterator it(target, RelocInfo::kCodeTargetMask);
-       !it.done(); it.next()) {
-    rinfo = it.rinfo();
-  }
-
-  ASSERT(rinfo != NULL);
-  Code* uninit_stub = Code::GetCodeFromTargetAddress(rinfo->target_address());
-  ASSERT(uninit_stub->ic_state() == UNINITIALIZED &&
-         uninit_stub->kind() == Code::BINARY_OP_IC);
-  SetTargetAtAddress(address, uninit_stub);
-}
-
-
 const char* BinaryOpIC::GetName(TypeInfo type_info) {
   switch (type_info) {
     case DEFAULT: return "Default";
index 3b03477..3bf604d 100644 (file)
@@ -9068,15 +9068,6 @@ void GenericBinaryOpStub::Generate(MacroAssembler* masm) {
     default:
       UNREACHABLE();
   }
-
-  // TODO(kaznacheev) Remove this (along with clearing) if it does not harm
-  // performance.
-  // Generate an unreachable reference to the DEFAULT stub so that it can be
-  // found at the end of this stub when clearing ICs at GC.
-  if (runtime_operands_type_ != BinaryOpIC::DEFAULT) {
-    GenericBinaryOpStub uninit(MinorKey(), BinaryOpIC::DEFAULT);
-    __ TailCallStub(&uninit);
-  }
 }