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

Side by Side Diff: test/cctest/test-compiler.cc

Issue 1129853002: Removing FLAG_vector_ics. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment response. Created 5 years, 7 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 | « test/cctest/test-api.cc ('k') | test/cctest/test-feedback-vector.cc » ('j') | 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 // Not compiled, and so no feedback vector allocated yet. 355 // Not compiled, and so no feedback vector allocated yet.
356 CHECK(!f->shared()->is_compiled()); 356 CHECK(!f->shared()->is_compiled());
357 CHECK_EQ(0, f->shared()->feedback_vector()->Slots()); 357 CHECK_EQ(0, f->shared()->feedback_vector()->Slots());
358 CHECK_EQ(0, f->shared()->feedback_vector()->ICSlots()); 358 CHECK_EQ(0, f->shared()->feedback_vector()->ICSlots());
359 359
360 CompileRun("morphing_call();"); 360 CompileRun("morphing_call();");
361 361
362 // Now a feedback vector is allocated. 362 // Now a feedback vector is allocated.
363 CHECK(f->shared()->is_compiled()); 363 CHECK(f->shared()->is_compiled());
364 int expected_slots = 0; 364 int expected_slots = 0;
365 int expected_ic_slots = FLAG_vector_ics ? 2 : 1; 365 int expected_ic_slots = 2;
366 CHECK_EQ(expected_slots, f->shared()->feedback_vector()->Slots()); 366 CHECK_EQ(expected_slots, f->shared()->feedback_vector()->Slots());
367 CHECK_EQ(expected_ic_slots, f->shared()->feedback_vector()->ICSlots()); 367 CHECK_EQ(expected_ic_slots, f->shared()->feedback_vector()->ICSlots());
368 } 368 }
369 369
370 370
371 // Test that optimized code for different closures is actually shared 371 // Test that optimized code for different closures is actually shared
372 // immediately by the FastNewClosureStub when run in the same context. 372 // immediately by the FastNewClosureStub when run in the same context.
373 TEST(OptimizedCodeSharing) { 373 TEST(OptimizedCodeSharing) {
374 // Skip test if --cache-optimized-code is not activated by default because 374 // Skip test if --cache-optimized-code is not activated by default because
375 // FastNewClosureStub that is baked into the snapshot is incorrect. 375 // FastNewClosureStub that is baked into the snapshot is incorrect.
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 CompileRun("function f() { a = 12345678 }; f();"); 559 CompileRun("function f() { a = 12345678 }; f();");
560 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); 560 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f"));
561 CompileRun("function f(x) { a = 12345678 + x}; f(1);"); 561 CompileRun("function f(x) { a = 12345678 + x}; f(1);");
562 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); 562 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f"));
563 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);"); 563 CompileRun("function f(x) { var arguments = 1; x += 12345678}; f(1);");
564 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); 564 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f"));
565 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);"); 565 CompileRun("function f(x) { var arguments = 1; x = 12345678}; f(1);");
566 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f")); 566 CheckCodeForUnsafeLiteral(GetJSFunction(context->Global(), "f"));
567 } 567 }
568 #endif 568 #endif
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698