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

Unified Diff: src/ast/ast.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/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;
}
« no previous file with comments | « src/ast/ast.h ('k') | src/compiler/access-info.cc » ('j') | src/compiler/access-info.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698