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

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

Issue 2426693002: [ic] Unify CallIC feedback collection and handling. (Closed)
Patch Set: Also simplify BytecodeGraphBuilder::ComputeCallFrequency Created 4 years, 2 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/ast/ast.h ('k') | src/compiler/bytecode-graph-builder.cc » ('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/ast/ast.h" 5 #include "src/ast/ast.h"
6 6
7 #include <cmath> // For isfinite. 7 #include <cmath> // For isfinite.
8 8
9 #include "src/ast/compile-time-value.h" 9 #include "src/ast/compile-time-value.h"
10 #include "src/ast/prettyprinter.h" 10 #include "src/ast/prettyprinter.h"
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 return static_cast<const Node*>(this)->IsMonomorphic(); 882 return static_cast<const Node*>(this)->IsMonomorphic();
883 PROPERTY_NODE_LIST(GENERATE_CASE) 883 PROPERTY_NODE_LIST(GENERATE_CASE)
884 CALL_NODE_LIST(GENERATE_CASE) 884 CALL_NODE_LIST(GENERATE_CASE)
885 #undef GENERATE_CASE 885 #undef GENERATE_CASE
886 default: 886 default:
887 UNREACHABLE(); 887 UNREACHABLE();
888 return false; 888 return false;
889 } 889 }
890 } 890 }
891 891
892 bool Call::IsUsingCallFeedbackICSlot() const {
893 return GetCallType() != POSSIBLY_EVAL_CALL;
894 }
895
896 bool Call::IsUsingCallFeedbackSlot() const {
897 // SuperConstructorCall uses a CallConstructStub, which wants
898 // a Slot, in addition to any IC slots requested elsewhere.
899 return GetCallType() == SUPER_CALL;
900 }
901
902
903 void Call::AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec, 892 void Call::AssignFeedbackVectorSlots(Isolate* isolate, FeedbackVectorSpec* spec,
904 FeedbackVectorSlotCache* cache) { 893 FeedbackVectorSlotCache* cache) {
905 if (IsUsingCallFeedbackICSlot()) { 894 ic_slot_ = spec->AddCallICSlot();
906 ic_slot_ = spec->AddCallICSlot();
907 }
908 if (IsUsingCallFeedbackSlot()) {
909 stub_slot_ = spec->AddGeneralSlot();
910 }
911 } 895 }
912 896
913 Call::CallType Call::GetCallType() const { 897 Call::CallType Call::GetCallType() const {
914 VariableProxy* proxy = expression()->AsVariableProxy(); 898 VariableProxy* proxy = expression()->AsVariableProxy();
915 if (proxy != NULL) { 899 if (proxy != NULL) {
916 if (is_possibly_eval()) { 900 if (is_possibly_eval()) {
917 return POSSIBLY_EVAL_CALL; 901 return POSSIBLY_EVAL_CALL;
918 } else if (proxy->var()->IsUnallocated()) { 902 } else if (proxy->var()->IsUnallocated()) {
919 return GLOBAL_CALL; 903 return GLOBAL_CALL;
920 } else if (proxy->var()->IsLookupSlot()) { 904 } else if (proxy->var()->IsLookupSlot()) {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 // static 944 // static
961 bool Literal::Match(void* literal1, void* literal2) { 945 bool Literal::Match(void* literal1, void* literal2) {
962 const AstValue* x = static_cast<Literal*>(literal1)->raw_value(); 946 const AstValue* x = static_cast<Literal*>(literal1)->raw_value();
963 const AstValue* y = static_cast<Literal*>(literal2)->raw_value(); 947 const AstValue* y = static_cast<Literal*>(literal2)->raw_value();
964 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) || 948 return (x->IsString() && y->IsString() && x->AsString() == y->AsString()) ||
965 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber()); 949 (x->IsNumber() && y->IsNumber() && x->AsNumber() == y->AsNumber());
966 } 950 }
967 951
968 } // namespace internal 952 } // namespace internal
969 } // namespace v8 953 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/ast.h ('k') | src/compiler/bytecode-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698