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

Unified Diff: src/ast.cc

Issue 1001533002: Vector-ICs: Implement slot sharing for global loads. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@vector-christmas
Patch Set: REBASE. Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast.h ('k') | src/ast-numbering.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index 01c4131d3a9e895647acac9a4fac6b4255e1b7ca..482c2e6cb74ec776a37a91bf2ac551ca49c82502 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -90,6 +90,35 @@ void VariableProxy::BindTo(Variable* var) {
}
+void VariableProxy::SetFirstFeedbackICSlot(FeedbackVectorICSlot slot,
+ ICSlotCache* cache) {
+ variable_feedback_slot_ = slot;
+ if (var()->IsUnallocated()) {
+ cache->Add(VariableICSlotPair(var(), slot));
+ }
+}
+
+
+FeedbackVectorRequirements VariableProxy::ComputeFeedbackRequirements(
+ Isolate* isolate, const ICSlotCache* cache) {
+ if (UsesVariableFeedbackSlot()) {
+ // VariableProxies that point to the same Variable within a function can
+ // make their loads from the same IC slot.
+ if (var()->IsUnallocated()) {
+ for (int i = 0; i < cache->length(); i++) {
+ VariableICSlotPair& pair = cache->at(i);
+ if (pair.variable() == var()) {
+ variable_feedback_slot_ = pair.slot();
+ return FeedbackVectorRequirements(0, 0);
+ }
+ }
+ }
+ return FeedbackVectorRequirements(0, 1);
+ }
+ return FeedbackVectorRequirements(0, 0);
+}
+
+
Assignment::Assignment(Zone* zone, Token::Value op, Expression* target,
Expression* value, int pos)
: Expression(zone, pos),
@@ -564,7 +593,8 @@ bool Call::IsUsingCallFeedbackSlot(Isolate* isolate) const {
}
-FeedbackVectorRequirements Call::ComputeFeedbackRequirements(Isolate* isolate) {
+FeedbackVectorRequirements Call::ComputeFeedbackRequirements(
+ Isolate* isolate, const ICSlotCache* cache) {
int ic_slots = IsUsingCallFeedbackICSlot(isolate) ? 1 : 0;
int slots = IsUsingCallFeedbackSlot(isolate) ? 1 : 0;
// A Call uses either a slot or an IC slot.
« no previous file with comments | « src/ast.h ('k') | src/ast-numbering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698