Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Side by Side Diff: src/ic/ic.cc

Issue 2433333002: [ic] Refactoring definition of a smi-encoded load handlers. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ic/handler-configuration-inl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-arguments-inl.h" 8 #include "src/api-arguments-inl.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/arguments.h" 10 #include "src/arguments.h"
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 ExtraICState extra_state) { 830 ExtraICState extra_state) {
831 LanguageMode mode = StoreICState::GetLanguageMode(extra_state); 831 LanguageMode mode = StoreICState::GetLanguageMode(extra_state);
832 return is_strict(mode) 832 return is_strict(mode)
833 ? isolate->builtins()->KeyedStoreIC_Megamorphic_Strict() 833 ? isolate->builtins()->KeyedStoreIC_Megamorphic_Strict()
834 : isolate->builtins()->KeyedStoreIC_Megamorphic(); 834 : isolate->builtins()->KeyedStoreIC_Megamorphic();
835 } 835 }
836 836
837 Handle<Object> LoadIC::SimpleFieldLoad(FieldIndex index) { 837 Handle<Object> LoadIC::SimpleFieldLoad(FieldIndex index) {
838 if (FLAG_tf_load_ic_stub) { 838 if (FLAG_tf_load_ic_stub) {
839 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadFieldDH); 839 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadFieldDH);
840 return SmiHandler::MakeLoadFieldHandler(isolate(), index); 840 return LoadHandler::LoadField(isolate(), index);
841 } 841 }
842 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadFieldStub); 842 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadFieldStub);
843 LoadFieldStub stub(isolate(), index); 843 LoadFieldStub stub(isolate(), index);
844 return stub.GetCode(); 844 return stub.GetCode();
845 } 845 }
846 846
847 bool LoadIC::IsPrototypeValidityCellCheckEnough(Handle<Map> receiver_map, 847 bool LoadIC::IsPrototypeValidityCellCheckEnough(Handle<Map> receiver_map,
848 Handle<JSObject> holder) { 848 Handle<JSObject> holder) {
849 DCHECK(holder->HasFastProperties()); 849 DCHECK(holder->HasFastProperties());
850 850
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 IsPrototypeValidityCellCheckEnough(map, holder)) { 1194 IsPrototypeValidityCellCheckEnough(map, holder)) {
1195 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadFieldFromPrototypeDH); 1195 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadFieldFromPrototypeDH);
1196 return SimpleLoadFromPrototype(map, holder, smi_handler); 1196 return SimpleLoadFromPrototype(map, holder, smi_handler);
1197 } 1197 }
1198 break; // Custom-compiled handler. 1198 break; // Custom-compiled handler.
1199 } 1199 }
1200 1200
1201 // -------------- Constant properties -------------- 1201 // -------------- Constant properties --------------
1202 DCHECK(lookup->property_details().type() == DATA_CONSTANT); 1202 DCHECK(lookup->property_details().type() == DATA_CONSTANT);
1203 if (FLAG_tf_load_ic_stub) { 1203 if (FLAG_tf_load_ic_stub) {
1204 Handle<Object> smi_handler = SmiHandler::MakeLoadConstantHandler( 1204 Handle<Object> smi_handler =
1205 isolate(), lookup->GetConstantIndex()); 1205 LoadHandler::LoadConstant(isolate(), lookup->GetConstantIndex());
1206 if (receiver_is_holder) { 1206 if (receiver_is_holder) {
1207 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadConstantDH); 1207 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadConstantDH);
1208 return smi_handler; 1208 return smi_handler;
1209 } 1209 }
1210 if (IsPrototypeValidityCellCheckEnough(map, holder)) { 1210 if (IsPrototypeValidityCellCheckEnough(map, holder)) {
1211 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadConstantFromPrototypeDH); 1211 TRACE_HANDLER_STATS(isolate(), LoadIC_LoadConstantFromPrototypeDH);
1212 return SimpleLoadFromPrototype(map, holder, smi_handler); 1212 return SimpleLoadFromPrototype(map, holder, smi_handler);
1213 } 1213 }
1214 } else { 1214 } else {
1215 if (receiver_is_holder) { 1215 if (receiver_is_holder) {
(...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after
2965 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state()); 2965 DCHECK_EQ(LookupIterator::INTERCEPTOR, it.state());
2966 it.Next(); 2966 it.Next();
2967 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 2967 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
2968 Object::GetProperty(&it)); 2968 Object::GetProperty(&it));
2969 } 2969 }
2970 2970
2971 return *result; 2971 return *result;
2972 } 2972 }
2973 } // namespace internal 2973 } // namespace internal
2974 } // namespace v8 2974 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/handler-configuration-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698