| Index: src/ia32/ic-ia32.cc
 | 
| ===================================================================
 | 
| --- src/ia32/ic-ia32.cc	(revision 5976)
 | 
| +++ src/ia32/ic-ia32.cc	(working copy)
 | 
| @@ -2049,23 +2049,13 @@
 | 
|  }
 | 
|  
 | 
|  
 | 
| -static bool HasInlinedSmiCode(Address address) {
 | 
| -  // The address of the instruction following the call.
 | 
| -  Address test_instruction_address =
 | 
| -      address + Assembler::kCallTargetAddressOffset;
 | 
| -
 | 
| -  // If the instruction following the call is not a test al, nothing
 | 
| -  // was inlined.
 | 
| -  return *test_instruction_address == Assembler::kTestAlByte;
 | 
| -}
 | 
| -
 | 
| -
 | 
|  void CompareIC::UpdateCaches(Handle<Object> x, Handle<Object> y) {
 | 
|    HandleScope scope;
 | 
|    Handle<Code> rewritten;
 | 
| +#ifdef DEBUG
 | 
|    State previous_state = GetState();
 | 
| -
 | 
| -  State state = TargetState(previous_state, HasInlinedSmiCode(address()), x, y);
 | 
| +#endif
 | 
| +  State state = TargetState(x, y);
 | 
|    if (state == GENERIC) {
 | 
|      CompareStub stub(GetCondition(), strict(), NO_COMPARE_FLAGS);
 | 
|      rewritten = stub.GetCode();
 | 
| @@ -2083,43 +2073,9 @@
 | 
|             Token::Name(op_));
 | 
|    }
 | 
|  #endif
 | 
| -
 | 
| -  // Activate inlined smi code.
 | 
| -  if (previous_state == UNINITIALIZED) {
 | 
| -    PatchInlinedSmiCode(address());
 | 
| -  }
 | 
|  }
 | 
|  
 | 
|  
 | 
| -void PatchInlinedSmiCode(Address address) {
 | 
| -  // The address of the instruction following the call.
 | 
| -  Address test_instruction_address =
 | 
| -      address + Assembler::kCallTargetAddressOffset;
 | 
| -
 | 
| -  // If the instruction following the call is not a test al, nothing
 | 
| -  // was inlined.
 | 
| -  if (*test_instruction_address != Assembler::kTestAlByte) {
 | 
| -    ASSERT(*test_instruction_address == Assembler::kNopByte);
 | 
| -    return;
 | 
| -  }
 | 
| -
 | 
| -  Address delta_address = test_instruction_address + 1;
 | 
| -  // The delta to the start of the map check instruction and the
 | 
| -  // condition code uses at the patched jump.
 | 
| -  int8_t delta = *reinterpret_cast<int8_t*>(delta_address);
 | 
| -  if (FLAG_trace_ic) {
 | 
| -    PrintF("[  patching ic at %p, test=%p, delta=%d\n",
 | 
| -           address, test_instruction_address, delta);
 | 
| -  }
 | 
| -
 | 
| -  // Patch with a short conditional jump. There must be an unconditional
 | 
| -  // short jump at this position.
 | 
| -  Address jmp_address = test_instruction_address - delta;
 | 
| -  ASSERT(*jmp_address == Assembler::kJmpShortOpcode);
 | 
| -  *jmp_address = static_cast<byte>(Assembler::kJccShortPrefix | not_zero);
 | 
| -}
 | 
| -
 | 
| -
 | 
|  } }  // namespace v8::internal
 | 
|  
 | 
|  #endif  // V8_TARGET_ARCH_IA32
 | 
| 
 |