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

Unified Diff: test/mjsunit/compiler/pic.js

Issue 6821009: Introduce runtime function %OptimizeFunctionOnNextCall to manually trigger optimization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
Index: test/mjsunit/compiler/pic.js
diff --git a/test/mjsunit/compiler/pic.js b/test/mjsunit/compiler/pic.js
index 06f2b3ebccb64637e7307f7edb75915228027867..f5b136ce91d1de99e160ea5143e75872b18cb73e 100644
--- a/test/mjsunit/compiler/pic.js
+++ b/test/mjsunit/compiler/pic.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 GetX(o) { return o.x; }
function CallF(o) { return o.f(); }
function SetX(o) { o.x = 42; }
@@ -53,11 +55,15 @@ o1.f = o2.f = o3.f = function() { return 99; }
// Run the test until we're fairly sure we've optimized the
// polymorphic property access.
-for (var i = 0; i < 100000; i++) {
+for (var i = 0; i < 5; i++) {
Test(o1);
Test(o2);
Test(o3);
}
+%OptimizeFunctionOnNextCall(Test);
+Test(o1);
+Test(o2);
+Test(o3);
// Make sure that the following doesn't crash.
GetX(0);

Powered by Google App Engine
This is Rietveld 408576698