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

Unified Diff: test/mjsunit/compiler/array-length.js

Issue 6821009: Introduce runtime function %OptimizeFunctionOnNextCall to manually trigger optimization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address comments Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime-profiler.cc ('k') | test/mjsunit/compiler/assignment-deopt.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/array-length.js
diff --git a/test/mjsunit/compiler/array-length.js b/test/mjsunit/compiler/array-length.js
index 126c7a0243007d5c1fd76f8da9c7c7d701d071ed..462a1e77392c517f6ea0c5ab7e6ef975e428006e 100644
--- a/test/mjsunit/compiler/array-length.js
+++ b/test/mjsunit/compiler/array-length.js
@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// Flags: --allow-natives-syntax
+
function ArrayLength(a) { return a.length; }
function Test(a0, a2, a5) {
@@ -36,7 +38,12 @@ function Test(a0, a2, a5) {
var a0 = [];
var a2 = [1,2];
var a5 = [1,2,3,4,5];
-for (var i = 0; i < 100000; i++) Test(a0, a2, a5);
+for (var i = 0; i < 5; i++) Test(a0, a2, a5);
+%OptimizeFunctionOnNextCall(ArrayLength);
+%OptimizeFunctionOnNextCall(Test);
+Test(a0, a2, a5);
assertEquals("undefined", typeof(ArrayLength(0)));
-for (var i = 0; i < 100000; i++) Test(a0, a2, a5);
+for (var i = 0; i < 5; i++) Test(a0, a2, a5);
+%OptimizeFunctionOnNextCall(Test);
+Test(a0, a2, a5);
assertEquals(4, ArrayLength("hest"));
« no previous file with comments | « src/runtime-profiler.cc ('k') | test/mjsunit/compiler/assignment-deopt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698