Chromium Code Reviews| Index: src/ic.cc |
| diff --git a/src/ic.cc b/src/ic.cc |
| index 643fa884139fa1d041d94d7d7092feb748a508d9..1f46f0ee6668ae5621e49c729c7c59a517eafa88 100644 |
| --- a/src/ic.cc |
| +++ b/src/ic.cc |
| @@ -352,9 +352,9 @@ void IC::Clear(Address address) { |
| return KeyedStoreIC::Clear(address, target); |
| case Code::CALL_IC: return CallIC::Clear(address, target); |
| case Code::KEYED_CALL_IC: return KeyedCallIC::Clear(address, target); |
| + case Code::COMPARE_IC: return CompareIC::Clear(address, target); |
| case Code::UNARY_OP_IC: |
| case Code::BINARY_OP_IC: |
| - case Code::COMPARE_IC: |
| case Code::TO_BOOLEAN_IC: |
| // Clearing these is tricky and does not |
| // make any performance difference. |
| @@ -365,9 +365,8 @@ void IC::Clear(Address address) { |
| void CallICBase::Clear(Address address, Code* target) { |
| + if (target->ic_state() == UNINITIALIZED) return; |
| bool contextual = CallICBase::Contextual::decode(target->extra_ic_state()); |
| - State state = target->ic_state(); |
| - if (state == UNINITIALIZED) return; |
| Code* code = |
| Isolate::Current()->stub_cache()->FindCallInitialize( |
| target->arguments_count(), |
| @@ -410,6 +409,16 @@ void KeyedStoreIC::Clear(Address address, Code* target) { |
| } |
| +void CompareIC::Clear(Address address, Code* target) { |
| + // Only clear ICCompareStubs, we currently cannot clear generic CompareStubs. |
| + if (target->major_key() != CodeStub::CompareIC) return; |
| + if (target->compare_state() == UNINITIALIZED) return; |
|
Vyacheslav Egorov (Chromium)
2012/04/30 14:27:10
We can limit clearing to those states that can ret
Michael Starzinger
2012/05/02 11:07:23
Done.
|
| + Token::Value op = CompareIC::ComputeOperation(target); |
| + SetTargetAtAddress(address, initialize_stub(op)); |
| + PatchInlinedSmiCode(address, DISABLE_INLINED_SMI_CHECK); |
| +} |
| + |
| + |
| static bool HasInterceptorGetter(JSObject* object) { |
| return !object->GetNamedInterceptor()->getter()->IsUndefined(); |
| } |
| @@ -2396,7 +2405,7 @@ RUNTIME_FUNCTION(MaybeObject*, BinaryOp_Patch) { |
| // Activate inlined smi code. |
| if (previous_type == BinaryOpIC::UNINITIALIZED) { |
| - PatchInlinedSmiCode(ic.address()); |
| + PatchInlinedSmiCode(ic.address(), ENABLE_INLINED_SMI_CHECK); |
| } |
| } |
| @@ -2457,6 +2466,14 @@ RUNTIME_FUNCTION(MaybeObject*, BinaryOp_Patch) { |
| } |
| +Code* CompareIC::initialize_stub(Token::Value op) { |
|
Vyacheslav Egorov (Chromium)
2012/04/30 14:27:10
I guess it should be called GetUnitializedStub() o
Michael Starzinger
2012/05/02 11:07:23
Done. Renamed to GetRawUninitialized() to be in sy
|
| + ICCompareStub stub(op, UNINITIALIZED); |
| + Code* code = NULL; |
| + CHECK(stub.FindCodeInCache(&code)); |
| + return code; |
| +} |
| + |
| + |
| Handle<Code> CompareIC::GetUninitialized(Token::Value op) { |
| ICCompareStub stub(op, UNINITIALIZED); |
| return stub.GetCode(); |
| @@ -2471,6 +2488,12 @@ CompareIC::State CompareIC::ComputeState(Code* target) { |
| } |
| +Token::Value CompareIC::ComputeOperation(Code* target) { |
| + ASSERT(target->major_key() == CodeStub::CompareIC); |
| + return static_cast<Token::Value>(target->compare_operation()); |
| +} |
| + |
| + |
| const char* CompareIC::GetStateName(State state) { |
| switch (state) { |
| case UNINITIALIZED: return "UNINITIALIZED"; |