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

Side by Side Diff: src/type-feedback-vector.cc

Issue 2182103002: [KeyedLoadIC] Support Smi "handlers" for simple field loads (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased 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/type-feedback-vector.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 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/type-feedback-vector.h" 5 #include "src/type-feedback-vector.h"
6 6
7 #include "src/code-stubs.h" 7 #include "src/code-stubs.h"
8 #include "src/ic/ic.h" 8 #include "src/ic/ic.h"
9 #include "src/ic/ic-state.h" 9 #include "src/ic/ic-state.h"
10 #include "src/objects.h" 10 #include "src/objects.h"
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 SKIP_WRITE_BARRIER); 681 SKIP_WRITE_BARRIER);
682 } 682 }
683 683
684 void LoadGlobalICNexus::ConfigureHandlerMode(Handle<Code> handler) { 684 void LoadGlobalICNexus::ConfigureHandlerMode(Handle<Code> handler) {
685 SetFeedback(GetIsolate()->heap()->empty_weak_cell()); 685 SetFeedback(GetIsolate()->heap()->empty_weak_cell());
686 SetFeedbackExtra(*handler); 686 SetFeedbackExtra(*handler);
687 } 687 }
688 688
689 void KeyedLoadICNexus::ConfigureMonomorphic(Handle<Name> name, 689 void KeyedLoadICNexus::ConfigureMonomorphic(Handle<Name> name,
690 Handle<Map> receiver_map, 690 Handle<Map> receiver_map,
691 Handle<Code> handler) { 691 Handle<Object> handler) {
692 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map); 692 Handle<WeakCell> cell = Map::WeakCellForMap(receiver_map);
693 if (name.is_null()) { 693 if (name.is_null()) {
694 SetFeedback(*cell); 694 SetFeedback(*cell);
695 SetFeedbackExtra(*handler); 695 SetFeedbackExtra(*handler);
696 } else { 696 } else {
697 Handle<FixedArray> array = EnsureExtraArrayOfSize(2); 697 Handle<FixedArray> array = EnsureExtraArrayOfSize(2);
698 SetFeedback(*name); 698 SetFeedback(*name);
699 array->set(0, *cell); 699 array->set(0, *cell);
700 array->set(1, *handler); 700 array->set(1, *handler);
701 } 701 }
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 1015
1016 IcCheckType KeyedStoreICNexus::GetKeyType() const { 1016 IcCheckType KeyedStoreICNexus::GetKeyType() const {
1017 Object* feedback = GetFeedback(); 1017 Object* feedback = GetFeedback();
1018 if (feedback == *TypeFeedbackVector::MegamorphicSentinel(GetIsolate())) { 1018 if (feedback == *TypeFeedbackVector::MegamorphicSentinel(GetIsolate())) {
1019 return static_cast<IcCheckType>(Smi::cast(GetFeedbackExtra())->value()); 1019 return static_cast<IcCheckType>(Smi::cast(GetFeedbackExtra())->value());
1020 } 1020 }
1021 return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT; 1021 return IsPropertyNameFeedback(feedback) ? PROPERTY : ELEMENT;
1022 } 1022 }
1023 } // namespace internal 1023 } // namespace internal
1024 } // namespace v8 1024 } // namespace v8
OLDNEW
« no previous file with comments | « src/type-feedback-vector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698