Reviewers: Jakob,

Message:
PTAL

Description:
Avoid creating too many handles during array/object literals compilation.

BUG=chromium:493289
LOG=N

Please review this at https://codereview.chromium.org/1162903002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+3, -5 lines):
  M src/ast.cc
  A + test/mjsunit/regress/regress-crbug-493289.js


Index: src/ast.cc
diff --git a/src/ast.cc b/src/ast.cc
index 73cd013a8138f373899e7f324179160e4aa69295..983fcc1d77b7f1343ce0e002c1323fa1e7295d91 100644
--- a/src/ast.cc
+++ b/src/ast.cc
@@ -504,6 +504,7 @@ void ArrayLiteral::BuildConstantElements(Isolate* isolate) {
         depth_acc = m_literal->depth() + 1;
       }
     }
+    HandleScope loop_scope(isolate);
Handle<Object> boilerplate_value = GetBoilerplateValue(element, isolate);
     if (boilerplate_value->IsTheHole()) {
       is_holey = true;
Index: test/mjsunit/regress/regress-crbug-493289.js
diff --git a/test/mjsunit/compiler/regress-416359.js b/test/mjsunit/regress/regress-crbug-493289.js
similarity index 63%
copy from test/mjsunit/compiler/regress-416359.js
copy to test/mjsunit/regress/regress-crbug-493289.js
index 18cdc5e72800ab16c49ea2f2091b88ba1c873248..37038bfab5123e1672c3368b73d51e8b93b8c45b 100644
--- a/test/mjsunit/compiler/regress-416359.js
+++ b/test/mjsunit/regress/regress-crbug-493289.js
@@ -2,9 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.

-"use strict"
-function f() {
-  for (x in {a:0});
-}
+// Flags: --allow-natives-syntax --harmony-arrays --gc-interval=456 --check-handle-count

-assertThrows(f);
+// boom!


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to