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

Unified Diff: test/mjsunit/regress/regress-1849.js

Issue 8968028: Ensure large Smi-only arrays don't transition to FAST_DOUBLE_ARRAY (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: review feedback Created 9 years 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
« no previous file with comments | « src/objects-inl.h ('k') | test/mjsunit/regress/regress-95113.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-1849.js
diff --git a/test/mjsunit/regress/regress-95113.js b/test/mjsunit/regress/regress-1849.js
similarity index 81%
copy from test/mjsunit/regress/regress-95113.js
copy to test/mjsunit/regress/regress-1849.js
index f01b27004cffa4b54261bea10380104961739a24..176f918b935d3044526ef72b2e5139025a9d9bd7 100644
--- a/test/mjsunit/regress/regress-95113.js
+++ b/test/mjsunit/regress/regress-1849.js
@@ -25,24 +25,15 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// See: http://code.google.com/p/v8/issues/detail?id=1878
+
// Flags: --allow-natives-syntax
-function get_double_array() {
- var a = new Array(100000);
- var i = 0;
- while (!%HasFastDoubleElements(a)) {
- a[i] = i;
- i++;
- }
- assertTrue(%HasFastDoubleElements(a));
- a.length = 1;
- a[0] = 1.5;
- a.length = 2;
- a[1] = 2.5;
- assertEquals(a[0], 1.5);
- assertEquals(a[1], 2.5);
- assertTrue(%HasFastDoubleElements(a));
- return a;
+var count = 1e5;
+var arr = new Array(count);
+assertFalse(%HasFastDoubleElements(arr));
+for (var i = 0; i < count; i++) {
+ arr[i] = 0;
}
-
-var a = get_double_array();
+assertFalse(%HasFastDoubleElements(arr));
+assertTrue(%HasFastSmiOnlyElements(arr));
« no previous file with comments | « src/objects-inl.h ('k') | test/mjsunit/regress/regress-95113.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698