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

Unified Diff: src/objects.cc

Issue 2632503003: [runtime] Allocate space for computed property names (Closed)
Patch Set: Fix some variable names. 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
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 5432b605972e129510b419d7a27c7ce34d70cf2f..33230ac56b724b7bde6411f9a2de76203d817dc6 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -9809,6 +9809,20 @@ void FixedArray::CopyTo(int pos, FixedArray* dest, int dest_pos, int len) {
}
}
+int const ConstantProperties::number_of_properties() {
+ if (has_number_of_properties()) {
+ return Smi::cast(this->get(FixedArray::length() - 1))->value();
+ }
+ return FixedArray::length() / 2;
+}
+
+int const ConstantProperties::length() {
+ return FixedArray::length() - (this->has_number_of_properties() ? 1 : 0);
Toon Verwaest 2017/01/18 08:49:53 Perhaps better to not call this length; it's a lit
Franzi 2017/01/18 14:23:10 Done. Using size() which is intuitive for lists an
+}
+
+bool const ConstantProperties::has_number_of_properties() {
+ return FixedArray::length() % 2 != 0;
+}
#ifdef DEBUG
bool FixedArray::IsEqualTo(FixedArray* other) {

Powered by Google App Engine
This is Rietveld 408576698