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

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

Issue 110573004: Merge bleeding_edge 17696:18016. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 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
Index: test/mjsunit/regress/regress-3010.js
diff --git a/test/mjsunit/regress/regress-2717.js b/test/mjsunit/regress/regress-3010.js
similarity index 67%
copy from test/mjsunit/regress/regress-2717.js
copy to test/mjsunit/regress/regress-3010.js
index 4f8f7915b1c43e48235e7bd6bcb79f89957223cf..7aeec648280b8108e7b3254859c0defc9f242e16 100644
--- a/test/mjsunit/regress/regress-2717.js
+++ b/test/mjsunit/regress/regress-3010.js
@@ -25,27 +25,41 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Test re-initializing existing field which is already being tracked as
-// having double representation.
(function() {
- function test1(a) {
- return { x: 1.5, x: a };
- };
+ function testOneSize(current_size) {
+ var eval_string = 'obj = {';
+ for (var current = 0; current <= current_size; ++current) {
+ eval_string += 'k' + current + ':' + current + ','
+ }
+ eval_string += '};';
+ eval(eval_string);
+ for (var i = 0; i <= current_size; i++) {
+ assertEquals(i, obj['k'+i]);
+ }
+ var current_number = 0;
+ for (var x in obj) {
+ assertEquals(current_number, obj[x]);
+ current_number++;
+ }
+ }
- assertEquals({}, test1({}).x);
-})();
+ testOneSize(127);
+ testOneSize(128);
+ testOneSize(129);
-// Test initializing new field which follows an existing transition to a
-// map that tracks it as having double representation.
-(function() {
- function test1(a) {
- return { y: a };
- };
+ testOneSize(255);
+ testOneSize(256);
+ testOneSize(257);
+
+ testOneSize(511);
+ testOneSize(512);
+ testOneSize(513);
- function test2(a) {
- return { y: a };
- };
+ testOneSize(1023);
+ testOneSize(1024);
+ testOneSize(1025);
- assertEquals(1.5, test1(1.5).y);
- assertEquals({}, test2({}).y);
-})();
+ testOneSize(2047);
+ testOneSize(2048);
+ testOneSize(2049);
+}())

Powered by Google App Engine
This is Rietveld 408576698