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

Unified Diff: src/type-feedback-vector.cc

Issue 2031123003: Avoid creating weak cells for literal arrays that are empty of literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ports. Created 4 years, 6 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/objects.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/type-feedback-vector.cc
diff --git a/src/type-feedback-vector.cc b/src/type-feedback-vector.cc
index 05f510e865128ddf65c7d936fc8ada6eec3bdef3..db7489391e2553bc33bc52f36a998087dcb2f38b 100644
--- a/src/type-feedback-vector.cc
+++ b/src/type-feedback-vector.cc
@@ -279,11 +279,19 @@ void TypeFeedbackVector::ClearAllKeyedStoreICs(Isolate* isolate) {
int length = optimized_code_map->length();
for (int i = SharedFunctionInfo::kEntriesStart; i < length;
i += SharedFunctionInfo::kEntryLength) {
- WeakCell* cell = WeakCell::cast(
- optimized_code_map->get(i + SharedFunctionInfo::kLiteralsOffset));
- if (cell->value()->IsLiteralsArray()) {
- TypeFeedbackVector* vector =
- LiteralsArray::cast(cell->value())->feedback_vector();
+ Object* lits =
+ optimized_code_map->get(i + SharedFunctionInfo::kLiteralsOffset);
+ TypeFeedbackVector* vector = NULL;
Michael Starzinger 2016/06/07 09:41:37 nit: s/NULL/nullptr/
mvstanton 2016/06/07 11:35:33 Done.
+ if (lits->IsWeakCell()) {
+ WeakCell* cell = WeakCell::cast(lits);
+ if (cell->value()->IsLiteralsArray()) {
+ vector = LiteralsArray::cast(cell->value())->feedback_vector();
+ }
+ } else {
+ DCHECK(lits->IsLiteralsArray());
+ vector = LiteralsArray::cast(lits)->feedback_vector();
+ }
+ if (vector != NULL) {
Michael Starzinger 2016/06/07 09:41:37 nit: s/NULL/nullptr/
mvstanton 2016/06/07 11:35:33 Done.
vector->ClearKeyedStoreICs(shared);
}
}
« no previous file with comments | « src/objects.cc ('k') | src/x64/builtins-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698