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

Unified Diff: src/objects-debug.cc

Issue 2854373002: Move delete-last-fast-property code from CSA to C++ (Closed)
Patch Set: addressed comments Created 3 years, 8 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/builtins/builtins-internal-gen.cc ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index 803e41c54f66b153c37cff189ea41f575aa2c538..0931f03be3549ef5d00784aa28565780e2be90bd 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -336,12 +336,16 @@ void JSObject::JSObjectVerify() {
properties()->length() -
map()->NextFreePropertyIndex();
if (map()->unused_property_fields() != actual_unused_property_fields) {
- // This could actually happen in the middle of StoreTransitionStub
- // when the new extended backing store is already set into the object and
- // the allocation of the MutableHeapNumber triggers GC (in this case map
- // is not updated yet).
- CHECK_EQ(map()->unused_property_fields(),
- actual_unused_property_fields - JSObject::kFieldsAdded);
+ // There are two reasons why this can happen:
+ // - in the middle of StoreTransitionStub when the new extended backing
+ // store is already set into the object and the allocation of the
+ // MutableHeapNumber triggers GC while the map isn't updated yet.
+ // - deletion of the last property can leave additional backing store
+ // capacity behind.
+ CHECK_GT(actual_unused_property_fields, map()->unused_property_fields());
+ int delta =
+ actual_unused_property_fields - map()->unused_property_fields();
+ CHECK_EQ(0, delta % JSObject::kFieldsAdded);
}
DescriptorArray* descriptors = map()->instance_descriptors();
Isolate* isolate = GetIsolate();
« no previous file with comments | « src/builtins/builtins-internal-gen.cc ('k') | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698