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

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

Issue 889863002: update vector ics to handle megamorphic keyed loads (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: grokdump Created 5 years, 10 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/heap/heap.h ('k') | src/type-feedback-vector.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 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/v8.h" 5 #include "src/v8.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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 LoadICNexus* nexus = casted_nexus<LoadICNexus>(); 630 LoadICNexus* nexus = casted_nexus<LoadICNexus>();
631 if (new_state == PREMONOMORPHIC) { 631 if (new_state == PREMONOMORPHIC) {
632 nexus->ConfigurePremonomorphic(); 632 nexus->ConfigurePremonomorphic();
633 } else if (new_state == MEGAMORPHIC) { 633 } else if (new_state == MEGAMORPHIC) {
634 nexus->ConfigureMegamorphic(); 634 nexus->ConfigureMegamorphic();
635 } else { 635 } else {
636 UNREACHABLE(); 636 UNREACHABLE();
637 } 637 }
638 } else if (kind() == Code::KEYED_LOAD_IC) { 638 } else if (kind() == Code::KEYED_LOAD_IC) {
639 KeyedLoadICNexus* nexus = casted_nexus<KeyedLoadICNexus>(); 639 KeyedLoadICNexus* nexus = casted_nexus<KeyedLoadICNexus>();
640 if (new_state == GENERIC) { 640 if (new_state == PREMONOMORPHIC) {
641 nexus->ConfigureGeneric();
642 } else if (new_state == PREMONOMORPHIC) {
643 nexus->ConfigurePremonomorphic(); 641 nexus->ConfigurePremonomorphic();
642 } else if (new_state == MEGAMORPHIC) {
643 nexus->ConfigureMegamorphic();
644 } else { 644 } else {
645 UNREACHABLE(); 645 UNREACHABLE();
646 } 646 }
647 } else { 647 } else {
648 UNREACHABLE(); 648 UNREACHABLE();
649 } 649 }
650 650
651 vector_set_ = true; 651 vector_set_ = true;
652 OnTypeFeedbackChanged(isolate(), get_host(), *vector(), saved_state(), 652 OnTypeFeedbackChanged(isolate(), get_host(), *vector(), saved_state(),
653 new_state); 653 new_state);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 return TypeError("non_object_property_load", object, name); 697 return TypeError("non_object_property_load", object, name);
698 } 698 }
699 699
700 // Check if the name is trivially convertible to an index and get 700 // Check if the name is trivially convertible to an index and get
701 // the element or char if so. 701 // the element or char if so.
702 uint32_t index; 702 uint32_t index;
703 if (kind() == Code::KEYED_LOAD_IC && name->AsArrayIndex(&index)) { 703 if (kind() == Code::KEYED_LOAD_IC && name->AsArrayIndex(&index)) {
704 // Rewrite to the generic keyed load stub. 704 // Rewrite to the generic keyed load stub.
705 if (FLAG_use_ic) { 705 if (FLAG_use_ic) {
706 if (UseVector()) { 706 if (UseVector()) {
707 ConfigureVectorState(GENERIC); 707 ConfigureVectorState(MEGAMORPHIC);
708 } else { 708 } else {
709 set_target(*megamorphic_stub()); 709 set_target(*megamorphic_stub());
710 } 710 }
711 TRACE_IC("LoadIC", name); 711 TRACE_IC("LoadIC", name);
712 TRACE_GENERIC_IC(isolate(), "LoadIC", "name as array index"); 712 TRACE_GENERIC_IC(isolate(), "LoadIC", "name as array index");
713 } 713 }
714 Handle<Object> result; 714 Handle<Object> result;
715 ASSIGN_RETURN_ON_EXCEPTION( 715 ASSIGN_RETURN_ON_EXCEPTION(
716 isolate(), result, 716 isolate(), result,
717 Runtime::GetElementOrCharAt(isolate(), object, index), Object); 717 Runtime::GetElementOrCharAt(isolate(), object, index), Object);
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic"); 1426 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic");
1427 } 1427 }
1428 1428
1429 set_target(*stub); 1429 set_target(*stub);
1430 TRACE_IC("LoadIC", key); 1430 TRACE_IC("LoadIC", key);
1431 } 1431 }
1432 } else { 1432 } else {
1433 if (!is_vector_set() || stub.is_null()) { 1433 if (!is_vector_set() || stub.is_null()) {
1434 Code* generic = *megamorphic_stub(); 1434 Code* generic = *megamorphic_stub();
1435 if (!stub.is_null() && *stub == generic) { 1435 if (!stub.is_null() && *stub == generic) {
1436 ConfigureVectorState(GENERIC); 1436 ConfigureVectorState(MEGAMORPHIC);
1437 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic"); 1437 TRACE_GENERIC_IC(isolate(), "KeyedLoadIC", "set generic");
1438 } 1438 }
1439 1439
1440 TRACE_IC("LoadIC", key); 1440 TRACE_IC("LoadIC", key);
1441 } 1441 }
1442 } 1442 }
1443 1443
1444 if (!load_handle.is_null()) return load_handle; 1444 if (!load_handle.is_null()) return load_handle;
1445 Handle<Object> result; 1445 Handle<Object> result;
1446 ASSIGN_RETURN_ON_EXCEPTION(isolate(), result, 1446 ASSIGN_RETURN_ON_EXCEPTION(isolate(), result,
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after
3000 static const Address IC_utilities[] = { 3000 static const Address IC_utilities[] = {
3001 #define ADDR(name) FUNCTION_ADDR(name), 3001 #define ADDR(name) FUNCTION_ADDR(name),
3002 IC_UTIL_LIST(ADDR) NULL 3002 IC_UTIL_LIST(ADDR) NULL
3003 #undef ADDR 3003 #undef ADDR
3004 }; 3004 };
3005 3005
3006 3006
3007 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; } 3007 Address IC::AddressFromUtilityId(IC::UtilityId id) { return IC_utilities[id]; }
3008 } 3008 }
3009 } // namespace v8::internal 3009 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/type-feedback-vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698