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

Side by Side Diff: test/mjsunit/compiler/uint32.js

Issue 1077113002: Treat HArgumentsObject as a safe use during Uint32 analysis phase. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove assertOptimized Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/hydrogen-uint32-analysis.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 for (var i = 0; i < N; i++) { 164 for (var i = 0; i < N; i++) {
165 old_array[i] = uint32_array[1]; 165 old_array[i] = uint32_array[1];
166 } 166 }
167 } 167 }
168 168
169 FillOldArrayWithHeapNumbers(1); 169 FillOldArrayWithHeapNumbers(1);
170 FillOldArrayWithHeapNumbers(1); 170 FillOldArrayWithHeapNumbers(1);
171 %OptimizeFunctionOnNextCall(FillOldArrayWithHeapNumbers); 171 %OptimizeFunctionOnNextCall(FillOldArrayWithHeapNumbers);
172 FillOldArrayWithHeapNumbers(old_array.length); 172 FillOldArrayWithHeapNumbers(old_array.length);
173 gc(); 173 gc();
174
175 // Test that HArgumentsObject does not prevent uint32 optimization and
176 // that arguments object with uint32 values inside is correctly materialized.
177 function Pack(x, y) {
178 try { // Prevent inlining.
179 return [x, y];
180 } catch (e) {
181 }
182 }
183
184 function InnerWithArguments(x, f) {
185 "use strict";
186 x >>>= 8;
187 return f(arguments[0], x|0);
188 }
189
190 function Outer(v, f) {
191 return InnerWithArguments(v >>> 0, f);
192 }
193
194 assertArrayEquals([0x0100, 0x01], Outer(0x0100, Pack));
195 assertArrayEquals([0x0100, 0x01], Outer(0x0100, Pack));
196 assertArrayEquals([0x0100, 0x01], Outer(0x0100, Pack));
197 %OptimizeFunctionOnNextCall(Outer);
198 assertArrayEquals([0x0100, 0x01], Outer(0x0100, Pack));
199 assertArrayEquals([0xFFFFFFFF, 0x00FFFFFF], Outer(-1, Pack));
200
201 // Cause deopt inside InnerWithArguments by passing different pack function.
202 assertArrayEquals([0xFFFFFFFF, 0x00FFFFFF], Outer(-1, function (x, y) {
203 return [x, y];
204 }));
OLDNEW
« no previous file with comments | « src/hydrogen-uint32-analysis.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698