Revision: 23543
Author:   [email protected]
Date:     Mon Sep  1 08:08:31 2014 UTC
Log:      Fix manual allocation folding of RegExpConstructResult.

[email protected]
BUG=409533
LOG=N

Review URL: https://codereview.chromium.org/532453003
https://code.google.com/p/v8/source/detail?r=23543

Added:
 /branches/bleeding_edge/test/mjsunit/regress/regress-409533.js
Modified:
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-409533.js Mon Sep 1 08:08:31 2014 UTC
@@ -0,0 +1,13 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+function f() {
+  %_RegExpConstructResult(0, {}, {});
+}
+f();
+f();
+%OptimizeFunctionOnNextCall(f);
+f();
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Sun Aug 31 07:27:38 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Mon Sep  1 08:08:31 2014 UTC
@@ -1855,9 +1855,11 @@
   HAllocate* elements = BuildAllocateElements(elements_kind, size);
   BuildInitializeElementsHeader(elements, elements_kind, length);

-  HConstant* size_in_bytes_upper_bound = EstablishElementsAllocationSize(
-      elements_kind, max_length->Integer32Value());
-  elements->set_size_upper_bound(size_in_bytes_upper_bound);
+  if (!elements->has_size_upper_bound()) {
+    HConstant* size_in_bytes_upper_bound = EstablishElementsAllocationSize(
+        elements_kind, max_length->Integer32Value());
+    elements->set_size_upper_bound(size_in_bytes_upper_bound);
+  }

   Add<HStoreNamedField>(
       result, HObjectAccess::ForJSArrayOffset(JSArray::kElementsOffset),

--
--
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