Index: src/ast/ast.cc |
diff --git a/src/ast/ast.cc b/src/ast/ast.cc |
index c63f90ecf11f398ebfdecf5c6fd25356dd934f83..b8ea501331d00e015a99d6eecae2c1f3245ad99e 100644 |
--- a/src/ast/ast.cc |
+++ b/src/ast/ast.cc |
@@ -582,9 +582,10 @@ void ObjectLiteral::InitDepthAndFlags() { |
void ObjectLiteral::BuildConstantProperties(Isolate* isolate) { |
if (!constant_properties_.is_null()) return; |
- // Allocate a fixed array to hold all the constant properties. |
- Handle<FixedArray> constant_properties = |
- isolate->factory()->NewFixedArray(boilerplate_properties_ * 2, TENURED); |
+ // Allocate a fixed array to hold all the constant properties and the number |
+ // of total properties. |
+ Handle<FixedArray> constant_properties = isolate->factory()->NewFixedArray( |
Toon Verwaest
2017/01/18 08:49:53
Handle<ConstantProperties> = isolate->factory()->N
Franzi
2017/01/18 14:23:10
Acknowledged.
|
+ boilerplate_properties_ * 2 + 1, TENURED); |
int position = 0; |
for (int i = 0; i < properties()->length(); i++) { |
@@ -622,6 +623,10 @@ void ObjectLiteral::BuildConstantProperties(Isolate* isolate) { |
constant_properties->set(position++, *value); |
} |
+ Handle<Object> total_properties = |
+ isolate->factory()->NewNumberFromInt(total_properties_); |
gsathya
2017/01/17 18:31:39
total_properties_ can be calculated using the abov
Franzi
2017/01/17 19:08:45
The loop breaks on the first computed property, an
Toon Verwaest
2017/01/18 08:49:53
I think what he means is that DCHECK_EQ(total_prop
Franzi
2017/01/18 14:23:10
As discussed, it's not equal if __proto__ is prese
|
+ constant_properties->set(position, *total_properties); |
+ |
constant_properties_ = constant_properties; |
} |