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

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

Issue 2245683002: [stubs] Port KeyedLoadIC_Generic stub to TurboFan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased past fixes Created 4 years, 3 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/code-stub-assembler.cc ('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 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" 9 #include "src/ic/handler-configuration.h"
10 #include "src/ic/ic-inl.h" 10 #include "src/ic/ic-inl.h"
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 if (instance_type < FIRST_JS_RECEIVER_TYPE) { 594 if (instance_type < FIRST_JS_RECEIVER_TYPE) {
595 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_SlowStub); 595 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_SlowStub);
596 return isolate->builtins()->KeyedLoadIC_Slow(); 596 return isolate->builtins()->KeyedLoadIC_Slow();
597 } 597 }
598 598
599 ElementsKind elements_kind = receiver_map->elements_kind(); 599 ElementsKind elements_kind = receiver_map->elements_kind();
600 if (IsSloppyArgumentsElements(elements_kind)) { 600 if (IsSloppyArgumentsElements(elements_kind)) {
601 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_KeyedLoadSloppyArgumentsStub); 601 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_KeyedLoadSloppyArgumentsStub);
602 return KeyedLoadSloppyArgumentsStub(isolate).GetCode(); 602 return KeyedLoadSloppyArgumentsStub(isolate).GetCode();
603 } 603 }
604 bool is_js_array = instance_type == JS_ARRAY_TYPE;
604 if (elements_kind == DICTIONARY_ELEMENTS) { 605 if (elements_kind == DICTIONARY_ELEMENTS) {
606 if (FLAG_tf_load_ic_stub) {
607 int config = KeyedLoadElementsKind::encode(elements_kind) |
608 KeyedLoadConvertHole::encode(false) |
609 KeyedLoadIsJsArray::encode(is_js_array) |
610 LoadHandlerTypeBit::encode(kLoadICHandlerForElements);
611 return handle(Smi::FromInt(config), isolate);
612 }
605 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadDictionaryElementStub); 613 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadDictionaryElementStub);
606 return LoadDictionaryElementStub(isolate).GetCode(); 614 return LoadDictionaryElementStub(isolate).GetCode();
607 } 615 }
608 DCHECK(IsFastElementsKind(elements_kind) || 616 DCHECK(IsFastElementsKind(elements_kind) ||
609 IsFixedTypedArrayElementsKind(elements_kind)); 617 IsFixedTypedArrayElementsKind(elements_kind));
610 bool is_js_array = instance_type == JS_ARRAY_TYPE; 618 // TODO(jkummerow): Use IsHoleyElementsKind(elements_kind).
611 bool convert_hole_to_undefined = 619 bool convert_hole_to_undefined =
612 is_js_array && elements_kind == FAST_HOLEY_ELEMENTS && 620 is_js_array && elements_kind == FAST_HOLEY_ELEMENTS &&
613 *receiver_map == isolate->get_initial_js_array_map(elements_kind); 621 *receiver_map == isolate->get_initial_js_array_map(elements_kind);
614 if (FLAG_tf_load_ic_stub) { 622 if (FLAG_tf_load_ic_stub) {
615 int config = KeyedLoadElementsKind::encode(elements_kind) | 623 int config = KeyedLoadElementsKind::encode(elements_kind) |
616 KeyedLoadConvertHole::encode(convert_hole_to_undefined) | 624 KeyedLoadConvertHole::encode(convert_hole_to_undefined) |
617 KeyedLoadIsJsArray::encode(is_js_array) | 625 KeyedLoadIsJsArray::encode(is_js_array) |
618 LoadHandlerTypeBit::encode(kLoadICHandlerForElements); 626 LoadHandlerTypeBit::encode(kLoadICHandlerForElements);
619 return handle(Smi::FromInt(config), isolate); 627 return handle(Smi::FromInt(config), isolate);
620 } else { 628 } else {
621 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadFastElementStub); 629 TRACE_HANDLER_STATS(isolate, KeyedLoadIC_LoadFastElementStub);
622 return LoadFastElementStub(isolate, is_js_array, elements_kind, 630 return LoadFastElementStub(isolate, is_js_array, elements_kind,
623 convert_hole_to_undefined) 631 convert_hole_to_undefined)
624 .GetCode(); 632 .GetCode();
625 } 633 }
626 } 634 }
627 635
628 void ElementHandlerCompiler::CompileElementHandlers( 636 void ElementHandlerCompiler::CompileElementHandlers(
629 MapHandleList* receiver_maps, List<Handle<Object>>* handlers) { 637 MapHandleList* receiver_maps, List<Handle<Object>>* handlers) {
630 for (int i = 0; i < receiver_maps->length(); ++i) { 638 for (int i = 0; i < receiver_maps->length(); ++i) {
631 handlers->Add(GetKeyedLoadHandler(receiver_maps->at(i), isolate())); 639 handlers->Add(GetKeyedLoadHandler(receiver_maps->at(i), isolate()));
632 } 640 }
633 } 641 }
634 } // namespace internal 642 } // namespace internal
635 } // namespace v8 643 } // namespace v8
OLDNEW
« no previous file with comments | « src/code-stub-assembler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698