Chromium Code Reviews| 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) { |