| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/keyed-store-generic.h" | 5 #include "src/ic/keyed-store-generic.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
| 9 #include "src/contexts.h" | 9 #include "src/contexts.h" |
| 10 #include "src/ic/accessor-assembler.h" | 10 #include "src/ic/accessor-assembler.h" |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 type, p->receiver); | 722 type, p->receiver); |
| 723 } else { | 723 } else { |
| 724 DCHECK_EQ(SLOPPY, language_mode); | 724 DCHECK_EQ(SLOPPY, language_mode); |
| 725 Return(p->value); | 725 Return(p->value); |
| 726 } | 726 } |
| 727 } | 727 } |
| 728 | 728 |
| 729 Bind(&stub_cache); | 729 Bind(&stub_cache); |
| 730 { | 730 { |
| 731 Comment("stub cache probe"); | 731 Comment("stub cache probe"); |
| 732 // The stub cache lookup is opportunistic: if we find a handler, use it; | |
| 733 // otherwise take the slow path. Since this is a generic stub, compiling | |
| 734 // a handler (as KeyedStoreIC_Miss would do) is probably a waste of time. | |
| 735 Variable var_handler(this, MachineRepresentation::kTagged); | 732 Variable var_handler(this, MachineRepresentation::kTagged); |
| 736 Label found_handler(this, &var_handler); | 733 Label found_handler(this, &var_handler), stub_cache_miss(this); |
| 737 TryProbeStubCache(isolate()->store_stub_cache(), receiver, p->name, | 734 TryProbeStubCache(isolate()->store_stub_cache(), receiver, p->name, |
| 738 &found_handler, &var_handler, slow); | 735 &found_handler, &var_handler, &stub_cache_miss); |
| 739 Bind(&found_handler); | 736 Bind(&found_handler); |
| 740 { | 737 { |
| 741 Comment("KeyedStoreGeneric found handler"); | 738 Comment("KeyedStoreGeneric found handler"); |
| 742 HandleStoreICHandlerCase(p, var_handler.value(), slow); | 739 HandleStoreICHandlerCase(p, var_handler.value(), &stub_cache_miss); |
| 740 } |
| 741 Bind(&stub_cache_miss); |
| 742 { |
| 743 Comment("KeyedStoreGeneric_miss"); |
| 744 TailCallRuntime(Runtime::kKeyedStoreIC_Miss, p->context, p->value, |
| 745 p->slot, p->vector, p->receiver, p->name); |
| 743 } | 746 } |
| 744 } | 747 } |
| 745 } | 748 } |
| 746 | 749 |
| 747 void KeyedStoreGenericAssembler::KeyedStoreGeneric(LanguageMode language_mode) { | 750 void KeyedStoreGenericAssembler::KeyedStoreGeneric(LanguageMode language_mode) { |
| 748 typedef StoreWithVectorDescriptor Descriptor; | 751 typedef StoreWithVectorDescriptor Descriptor; |
| 749 | 752 |
| 750 Node* receiver = Parameter(Descriptor::kReceiver); | 753 Node* receiver = Parameter(Descriptor::kReceiver); |
| 751 Node* name = Parameter(Descriptor::kName); | 754 Node* name = Parameter(Descriptor::kName); |
| 752 Node* value = Parameter(Descriptor::kValue); | 755 Node* value = Parameter(Descriptor::kValue); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 Bind(&slow); | 791 Bind(&slow); |
| 789 { | 792 { |
| 790 Comment("KeyedStoreGeneric_slow"); | 793 Comment("KeyedStoreGeneric_slow"); |
| 791 TailCallRuntime(Runtime::kSetProperty, context, receiver, name, value, | 794 TailCallRuntime(Runtime::kSetProperty, context, receiver, name, value, |
| 792 SmiConstant(language_mode)); | 795 SmiConstant(language_mode)); |
| 793 } | 796 } |
| 794 } | 797 } |
| 795 | 798 |
| 796 } // namespace internal | 799 } // namespace internal |
| 797 } // namespace v8 | 800 } // namespace v8 |
| OLD | NEW |