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

Unified Diff: src/objects.cc

Issue 945403008: Invalidate property cells for non-existent properties properly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Patch for landing. Created 5 years, 10 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 | « no previous file | test/cctest/cctest.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 542b8a0049df836c369b929146697540424c7244..a4bcc7986b2accc4cd575ba4886e733a260b7fad 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -15334,8 +15334,15 @@ void GlobalObject::InvalidatePropertyCell(Handle<GlobalObject> global,
Handle<PropertyCell> new_cell = isolate->factory()->NewPropertyCell(value);
global->property_dictionary()->ValueAtPut(entry, *new_cell);
- Handle<Object> hole = global->GetIsolate()->factory()->the_hole_value();
- PropertyCell::SetValueInferType(cell, hole);
+ Handle<Object> hole = isolate->factory()->the_hole_value();
+ if (*hole != *value) {
+ PropertyCell::SetValueInferType(cell, hole);
+ } else {
+ // If property value was the hole, set it to any other value,
+ // to ensure that LoadNonexistent ICs execute a miss.
+ Handle<Object> undefined = isolate->factory()->undefined_value();
+ PropertyCell::SetValueInferType(cell, undefined);
+ }
}
}
« no previous file with comments | « no previous file | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698