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

Unified Diff: src/factory.cc

Issue 2651533002: [ast] Simplify NewBoilerplateDescription. (Closed)
Patch Set: Fix DCHECK. Created 3 years, 11 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/factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 8ee9f7dad6d927bf4b2f1bb28f7af22f8f13ab47..78c1b739df0713cd225ac454b7c24a4ddc6a81b8 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -186,10 +186,13 @@ Handle<FixedArray> Factory::NewUninitializedFixedArray(int size) {
}
Handle<BoilerplateDescription> Factory::NewBoilerplateDescription(
- int boilerplate, int all_properties, bool has_seen_proto) {
- DCHECK_GE(all_properties, 0);
+ int boilerplate, int all_properties, int index_keys, bool has_seen_proto) {
+ DCHECK_GE(boilerplate, 0);
+ DCHECK_GE(all_properties, index_keys);
+ DCHECK_GE(index_keys, 0);
- int backing_store_size = all_properties - (has_seen_proto ? 1 : 0);
+ int backing_store_size =
+ all_properties - index_keys - (has_seen_proto ? 1 : 0);
DCHECK_GE(backing_store_size, 0);
bool has_different_size_backing_store = boilerplate != backing_store_size;
@@ -205,7 +208,7 @@ Handle<BoilerplateDescription> Factory::NewBoilerplateDescription(
Handle<BoilerplateDescription>::cast(NewFixedArray(size, TENURED));
if (has_different_size_backing_store) {
- DCHECK((boilerplate != all_properties) || has_seen_proto);
+ DCHECK((boilerplate != (all_properties - index_keys)) || has_seen_proto);
description->set_backing_store_size(isolate(), backing_store_size);
}
return description;
« no previous file with comments | « src/factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698