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

Side by Side Diff: test/mjsunit/osr-elements-kind.js

Issue 913463002: Reduce the number of iterations in some OSR tests by using an explicit %OptimizeOsr(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 if (%HasExternalPixelElements(obj)) { 82 if (%HasExternalPixelElements(obj)) {
83 return elements_kind.external_pixel; 83 return elements_kind.external_pixel;
84 } 84 }
85 } 85 }
86 86
87 function assertKind(expected, obj, name_opt) { 87 function assertKind(expected, obj, name_opt) {
88 assertEquals(expected, getKind(obj), name_opt); 88 assertEquals(expected, getKind(obj), name_opt);
89 } 89 }
90 90
91 // long-running loop forces OSR.
92 %NeverOptimizeFunction(construct_smis); 91 %NeverOptimizeFunction(construct_smis);
93 %NeverOptimizeFunction(construct_doubles); 92 %NeverOptimizeFunction(construct_doubles);
94 %NeverOptimizeFunction(convert_mixed); 93 %NeverOptimizeFunction(convert_mixed);
95 for (var i = 0; i < 1000000; i++) { } 94 for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); }
96 95
97 // This code exists to eliminate the learning influence of AllocationSites 96 // This code exists to eliminate the learning influence of AllocationSites
98 // on the following tests. 97 // on the following tests.
99 var __sequence = 0; 98 var __sequence = 0;
100 function make_array_string() { 99 function make_array_string() {
101 this.__sequence = this.__sequence + 1; 100 this.__sequence = this.__sequence + 1;
102 return "/* " + this.__sequence + " */ [0, 0, 0];" 101 return "/* " + this.__sequence + " */ [0, 0, 0];"
103 } 102 }
104 function make_array() { 103 function make_array() {
105 return eval(make_array_string()); 104 return eval(make_array_string());
(...skipping 29 matching lines...) Expand all
135 convert_mixed(construct_doubles(), "three", elements_kind.fast); 134 convert_mixed(construct_doubles(), "three", elements_kind.fast);
136 135
137 smis = construct_smis(); 136 smis = construct_smis();
138 doubles = construct_doubles(); 137 doubles = construct_doubles();
139 convert_mixed(smis, 1, elements_kind.fast); 138 convert_mixed(smis, 1, elements_kind.fast);
140 convert_mixed(doubles, 1, elements_kind.fast); 139 convert_mixed(doubles, 1, elements_kind.fast);
141 assertTrue(%HaveSameMap(smis, doubles)); 140 assertTrue(%HaveSameMap(smis, doubles));
142 141
143 // Throw away type information in the ICs for next stress run. 142 // Throw away type information in the ICs for next stress run.
144 gc(); 143 gc();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698