| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/ic/ic.h" | 5 #include "src/ic/ic.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 | 555 |
| 556 void CompareIC::Clear(Isolate* isolate, Address address, Code* target, | 556 void CompareIC::Clear(Isolate* isolate, Address address, Code* target, |
| 557 Address constant_pool) { | 557 Address constant_pool) { |
| 558 DCHECK(CodeStub::GetMajorKey(target) == CodeStub::CompareIC); | 558 DCHECK(CodeStub::GetMajorKey(target) == CodeStub::CompareIC); |
| 559 CompareICStub stub(target->stub_key(), isolate); | 559 CompareICStub stub(target->stub_key(), isolate); |
| 560 // Only clear CompareICs that can retain objects. | 560 // Only clear CompareICs that can retain objects. |
| 561 if (stub.state() != CompareICState::KNOWN_OBJECT) return; | 561 if (stub.state() != CompareICState::KNOWN_OBJECT) return; |
| 562 SetTargetAtAddress(address, | 562 SetTargetAtAddress(address, |
| 563 GetRawUninitialized(isolate, stub.op(), stub.strength()), | 563 GetRawUninitialized(isolate, stub.op(), stub.strength()), |
| 564 constant_pool); | 564 constant_pool); |
| 565 PatchInlinedSmiCode(address, DISABLE_INLINED_SMI_CHECK); | 565 PatchInlinedSmiCode(isolate, address, DISABLE_INLINED_SMI_CHECK); |
| 566 } | 566 } |
| 567 | 567 |
| 568 | 568 |
| 569 // static | 569 // static |
| 570 Handle<Code> KeyedLoadIC::ChooseMegamorphicStub(Isolate* isolate, | 570 Handle<Code> KeyedLoadIC::ChooseMegamorphicStub(Isolate* isolate, |
| 571 ExtraICState extra_state) { | 571 ExtraICState extra_state) { |
| 572 if (FLAG_compiled_keyed_generic_loads) { | 572 if (FLAG_compiled_keyed_generic_loads) { |
| 573 return KeyedLoadGenericStub(isolate, LoadICState(extra_state)).GetCode(); | 573 return KeyedLoadGenericStub(isolate, LoadICState(extra_state)).GetCode(); |
| 574 } else { | 574 } else { |
| 575 return is_strong(LoadICState::GetLanguageMode(extra_state)) | 575 return is_strong(LoadICState::GetLanguageMode(extra_state)) |
| (...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2609 << static_cast<void*>(*target) << " <- "; | 2609 << static_cast<void*>(*target) << " <- "; |
| 2610 JavaScriptFrame::PrintTop(isolate(), stdout, false, true); | 2610 JavaScriptFrame::PrintTop(isolate(), stdout, false, true); |
| 2611 if (!allocation_site.is_null()) { | 2611 if (!allocation_site.is_null()) { |
| 2612 os << " using allocation site " << static_cast<void*>(*allocation_site); | 2612 os << " using allocation site " << static_cast<void*>(*allocation_site); |
| 2613 } | 2613 } |
| 2614 os << "]" << std::endl; | 2614 os << "]" << std::endl; |
| 2615 } | 2615 } |
| 2616 | 2616 |
| 2617 // Patch the inlined smi code as necessary. | 2617 // Patch the inlined smi code as necessary. |
| 2618 if (!old_state.UseInlinedSmiCode() && state.UseInlinedSmiCode()) { | 2618 if (!old_state.UseInlinedSmiCode() && state.UseInlinedSmiCode()) { |
| 2619 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); | 2619 PatchInlinedSmiCode(isolate(), address(), ENABLE_INLINED_SMI_CHECK); |
| 2620 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { | 2620 } else if (old_state.UseInlinedSmiCode() && !state.UseInlinedSmiCode()) { |
| 2621 PatchInlinedSmiCode(address(), DISABLE_INLINED_SMI_CHECK); | 2621 PatchInlinedSmiCode(isolate(), address(), DISABLE_INLINED_SMI_CHECK); |
| 2622 } | 2622 } |
| 2623 | 2623 |
| 2624 return result; | 2624 return result; |
| 2625 } | 2625 } |
| 2626 | 2626 |
| 2627 | 2627 |
| 2628 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { | 2628 RUNTIME_FUNCTION(Runtime_BinaryOpIC_Miss) { |
| 2629 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2629 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2630 HandleScope scope(isolate); | 2630 HandleScope scope(isolate); |
| 2631 DCHECK_EQ(2, args.length()); | 2631 DCHECK_EQ(2, args.length()); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2704 CompareICState::GetStateName(old_stub.right()), | 2704 CompareICState::GetStateName(old_stub.right()), |
| 2705 CompareICState::GetStateName(old_stub.state()), | 2705 CompareICState::GetStateName(old_stub.state()), |
| 2706 CompareICState::GetStateName(new_left), | 2706 CompareICState::GetStateName(new_left), |
| 2707 CompareICState::GetStateName(new_right), | 2707 CompareICState::GetStateName(new_right), |
| 2708 CompareICState::GetStateName(state), Token::Name(op_), | 2708 CompareICState::GetStateName(state), Token::Name(op_), |
| 2709 static_cast<void*>(*stub.GetCode())); | 2709 static_cast<void*>(*stub.GetCode())); |
| 2710 } | 2710 } |
| 2711 | 2711 |
| 2712 // Activate inlined smi code. | 2712 // Activate inlined smi code. |
| 2713 if (old_stub.state() == CompareICState::UNINITIALIZED) { | 2713 if (old_stub.state() == CompareICState::UNINITIALIZED) { |
| 2714 PatchInlinedSmiCode(address(), ENABLE_INLINED_SMI_CHECK); | 2714 PatchInlinedSmiCode(isolate(), address(), ENABLE_INLINED_SMI_CHECK); |
| 2715 } | 2715 } |
| 2716 | 2716 |
| 2717 return *new_target; | 2717 return *new_target; |
| 2718 } | 2718 } |
| 2719 | 2719 |
| 2720 | 2720 |
| 2721 // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. | 2721 // Used from CompareICStub::GenerateMiss in code-stubs-<arch>.cc. |
| 2722 RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { | 2722 RUNTIME_FUNCTION(Runtime_CompareIC_Miss) { |
| 2723 TimerEventScope<TimerEventIcMiss> timer(isolate); | 2723 TimerEventScope<TimerEventIcMiss> timer(isolate); |
| 2724 HandleScope scope(isolate); | 2724 HandleScope scope(isolate); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2978 KeyedLoadICNexus nexus(vector, vector_slot); | 2978 KeyedLoadICNexus nexus(vector, vector_slot); |
| 2979 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); | 2979 KeyedLoadIC ic(IC::EXTRA_CALL_FRAME, isolate, &nexus); |
| 2980 ic.UpdateState(receiver, key); | 2980 ic.UpdateState(receiver, key); |
| 2981 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); | 2981 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, ic.Load(receiver, key)); |
| 2982 } | 2982 } |
| 2983 | 2983 |
| 2984 return *result; | 2984 return *result; |
| 2985 } | 2985 } |
| 2986 } // namespace internal | 2986 } // namespace internal |
| 2987 } // namespace v8 | 2987 } // namespace v8 |
| OLD | NEW |