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

Unified Diff: src/ast.cc

Issue 1279763006: Fasterify ICSlotCache (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: lil' moar whitespace Created 5 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 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 9dd825a6f96b96065806e9b8f489dd96364776a5..624d462323a9574c278af3e01a240976509239ac 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -102,7 +102,7 @@ void VariableProxy::SetFirstFeedbackICSlot(FeedbackVectorICSlot slot,
ICSlotCache* cache) {
variable_feedback_slot_ = slot;
if (var()->IsUnallocated()) {
- cache->Add(VariableICSlotPair(var(), slot));
+ cache->Put(var(), slot);
}
}
@@ -113,12 +113,11 @@ FeedbackVectorRequirements VariableProxy::ComputeFeedbackRequirements(
// 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);
- }
+ ZoneHashMap::Entry* entry = cache->Get(var());
+ if (entry != NULL) {
+ variable_feedback_slot_ = FeedbackVectorICSlot(
+ static_cast<int>(reinterpret_cast<intptr_t>(entry->value)));
+ return FeedbackVectorRequirements(0, 0);
}
}
return FeedbackVectorRequirements(0, 1);
« 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