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

Side by Side Diff: src/ic/handler-compiler.cc

Issue 2222273003: Revert of [KeyedLoadIC] Support Smi "handlers" for element loads (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@keyed-load-ic-fieldindex
Patch Set: Created 4 years, 4 months 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-compiler.h ('k') | src/ic/handler-configuration.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/handler-compiler.h" 5 #include "src/ic/handler-compiler.h"
6 6
7 #include "src/field-type.h" 7 #include "src/field-type.h"
8 #include "src/ic/call-optimization.h" 8 #include "src/ic/call-optimization.h"
9 #include "src/ic/handler-configuration.h"
10 #include "src/ic/ic-inl.h" 9 #include "src/ic/ic-inl.h"
11 #include "src/ic/ic.h" 10 #include "src/ic/ic.h"
12 #include "src/isolate-inl.h" 11 #include "src/isolate-inl.h"
13 12
14 namespace v8 { 13 namespace v8 {
15 namespace internal { 14 namespace internal {
16 15
17 Handle<Code> PropertyHandlerCompiler::Find(Handle<Name> name, 16 Handle<Code> PropertyHandlerCompiler::Find(Handle<Name> name,
18 Handle<Map> stub_holder, 17 Handle<Map> stub_holder,
19 Code::Kind kind, 18 Code::Kind kind,
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 GenerateApiAccessorCall(masm(), call_optimization, handle(object->map()), 570 GenerateApiAccessorCall(masm(), call_optimization, handle(object->map()),
572 receiver(), scratch2(), true, value(), holder, 571 receiver(), scratch2(), true, value(), holder,
573 accessor_index); 572 accessor_index);
574 return GetCode(kind(), name); 573 return GetCode(kind(), name);
575 } 574 }
576 575
577 576
578 #undef __ 577 #undef __
579 578
580 // static 579 // static
581 Handle<Object> ElementHandlerCompiler::GetKeyedLoadHandler( 580 Handle<Code> ElementHandlerCompiler::GetKeyedLoadHandler(
582 Handle<Map> receiver_map, Isolate* isolate) { 581 Handle<Map> receiver_map, Isolate* isolate) {
583 if (receiver_map->has_indexed_interceptor() && 582 if (receiver_map->has_indexed_interceptor() &&
584 !receiver_map->GetIndexedInterceptor()->getter()->IsUndefined(isolate) && 583 !receiver_map->GetIndexedInterceptor()->getter()->IsUndefined(isolate) &&
585 !receiver_map->GetIndexedInterceptor()->non_masking()) { 584 !receiver_map->GetIndexedInterceptor()->non_masking()) {
586 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadIndexedInterceptorStub); 585 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadIndexedInterceptorStub);
587 return LoadIndexedInterceptorStub(isolate).GetCode(); 586 return LoadIndexedInterceptorStub(isolate).GetCode();
588 } 587 }
589 if (receiver_map->IsStringMap()) { 588 if (receiver_map->IsStringMap()) {
590 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadIndexedStringStub); 589 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadIndexedStringStub);
591 return LoadIndexedStringStub(isolate).GetCode(); 590 return LoadIndexedStringStub(isolate).GetCode();
(...skipping 12 matching lines...) Expand all
604 if (elements_kind == DICTIONARY_ELEMENTS) { 603 if (elements_kind == DICTIONARY_ELEMENTS) {
605 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadDictionaryElementStub); 604 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadDictionaryElementStub);
606 return LoadDictionaryElementStub(isolate).GetCode(); 605 return LoadDictionaryElementStub(isolate).GetCode();
607 } 606 }
608 DCHECK(IsFastElementsKind(elements_kind) || 607 DCHECK(IsFastElementsKind(elements_kind) ||
609 IsFixedTypedArrayElementsKind(elements_kind)); 608 IsFixedTypedArrayElementsKind(elements_kind));
610 bool is_js_array = instance_type == JS_ARRAY_TYPE; 609 bool is_js_array = instance_type == JS_ARRAY_TYPE;
611 bool convert_hole_to_undefined = 610 bool convert_hole_to_undefined =
612 is_js_array && elements_kind == FAST_HOLEY_ELEMENTS && 611 is_js_array && elements_kind == FAST_HOLEY_ELEMENTS &&
613 *receiver_map == isolate->get_initial_js_array_map(elements_kind); 612 *receiver_map == isolate->get_initial_js_array_map(elements_kind);
614 if (FLAG_tf_load_ic_stub) { 613 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadFastElementStub);
615 int config = KeyedLoadElementsKind::encode(elements_kind) | 614 return LoadFastElementStub(isolate, is_js_array, elements_kind,
616 KeyedLoadConvertHole::encode(convert_hole_to_undefined) | 615 convert_hole_to_undefined)
617 KeyedLoadIsJsArray::encode(is_js_array) | 616 .GetCode();
618 LoadHandlerTypeBit::encode(kLoadICHandlerForElements);
619 return handle(Smi::FromInt(config), isolate);
620 } else {
621 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadFastElementStub);
622 return LoadFastElementStub(isolate, is_js_array, elements_kind,
623 convert_hole_to_undefined)
624 .GetCode();
625 }
626 } 617 }
627 618
628 void ElementHandlerCompiler::CompileElementHandlers( 619 void ElementHandlerCompiler::CompileElementHandlers(
629 MapHandleList* receiver_maps, List<Handle<Object>>* handlers) { 620 MapHandleList* receiver_maps, List<Handle<Object>>* handlers) {
630 for (int i = 0; i < receiver_maps->length(); ++i) { 621 for (int i = 0; i < receiver_maps->length(); ++i) {
631 handlers->Add(GetKeyedLoadHandler(receiver_maps->at(i), isolate())); 622 handlers->Add(GetKeyedLoadHandler(receiver_maps->at(i), isolate()));
632 } 623 }
633 } 624 }
634 } // namespace internal 625 } // namespace internal
635 } // namespace v8 626 } // namespace v8
OLDNEW
« no previous file with comments | « src/ic/handler-compiler.h ('k') | src/ic/handler-configuration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698