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

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

Issue 619863002: Introduce flag --allocation-site-transitioning Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed extra work happening when !transitioning && pretenuring. Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | test/mjsunit/allocation-site-info.js » ('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 2200 matching lines...) Expand 10 before | Expand all | Expand 10 after
2211 2211
2212 CHECK(CcTest::heap()->InNewSpace(*o)); 2212 CHECK(CcTest::heap()->InNewSpace(*o));
2213 } 2213 }
2214 2214
2215 2215
2216 TEST(OptimizedPretenuringAllocationFolding) { 2216 TEST(OptimizedPretenuringAllocationFolding) {
2217 i::FLAG_allow_natives_syntax = true; 2217 i::FLAG_allow_natives_syntax = true;
2218 i::FLAG_expose_gc = true; 2218 i::FLAG_expose_gc = true;
2219 CcTest::InitializeVM(); 2219 CcTest::InitializeVM();
2220 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; 2220 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return;
2221 if (!i::FLAG_allocation_site_pretenuring) return;
2221 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; 2222 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
2222 v8::HandleScope scope(CcTest::isolate()); 2223 v8::HandleScope scope(CcTest::isolate());
2223 2224
2224 // Grow new space unitl maximum capacity reached. 2225 // Grow new space unitl maximum capacity reached.
2225 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) { 2226 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) {
2226 CcTest::heap()->new_space()->Grow(); 2227 CcTest::heap()->new_space()->Grow();
2227 } 2228 }
2228 2229
2229 i::ScopedVector<char> source(1024); 2230 i::ScopedVector<char> source(1024);
2230 i::SNPrintF( 2231 i::SNPrintF(
(...skipping 30 matching lines...) Expand all
2261 CHECK(CcTest::heap()->InOldDataSpace(double_array_handle->elements())); 2262 CHECK(CcTest::heap()->InOldDataSpace(double_array_handle->elements()));
2262 } 2263 }
2263 2264
2264 2265
2265 TEST(OptimizedPretenuringObjectArrayLiterals) { 2266 TEST(OptimizedPretenuringObjectArrayLiterals) {
2266 i::FLAG_allow_natives_syntax = true; 2267 i::FLAG_allow_natives_syntax = true;
2267 i::FLAG_expose_gc = true; 2268 i::FLAG_expose_gc = true;
2268 CcTest::InitializeVM(); 2269 CcTest::InitializeVM();
2269 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; 2270 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return;
2270 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; 2271 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
2272 if (!i::FLAG_allocation_site_pretenuring) return;
2271 v8::HandleScope scope(CcTest::isolate()); 2273 v8::HandleScope scope(CcTest::isolate());
2272 2274
2273 // Grow new space unitl maximum capacity reached. 2275 // Grow new space unitl maximum capacity reached.
2274 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) { 2276 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) {
2275 CcTest::heap()->new_space()->Grow(); 2277 CcTest::heap()->new_space()->Grow();
2276 } 2278 }
2277 2279
2278 i::ScopedVector<char> source(1024); 2280 i::ScopedVector<char> source(1024);
2279 i::SNPrintF( 2281 i::SNPrintF(
2280 source, 2282 source,
(...skipping 19 matching lines...) Expand all
2300 CHECK(CcTest::heap()->InOldPointerSpace(o->elements())); 2302 CHECK(CcTest::heap()->InOldPointerSpace(o->elements()));
2301 CHECK(CcTest::heap()->InOldPointerSpace(*o)); 2303 CHECK(CcTest::heap()->InOldPointerSpace(*o));
2302 } 2304 }
2303 2305
2304 2306
2305 TEST(OptimizedPretenuringMixedInObjectProperties) { 2307 TEST(OptimizedPretenuringMixedInObjectProperties) {
2306 i::FLAG_allow_natives_syntax = true; 2308 i::FLAG_allow_natives_syntax = true;
2307 i::FLAG_expose_gc = true; 2309 i::FLAG_expose_gc = true;
2308 CcTest::InitializeVM(); 2310 CcTest::InitializeVM();
2309 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; 2311 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return;
2312 if (!i::FLAG_allocation_site_pretenuring) return;
2310 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; 2313 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
2311 v8::HandleScope scope(CcTest::isolate()); 2314 v8::HandleScope scope(CcTest::isolate());
2312 2315
2313 // Grow new space unitl maximum capacity reached. 2316 // Grow new space unitl maximum capacity reached.
2314 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) { 2317 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) {
2315 CcTest::heap()->new_space()->Grow(); 2318 CcTest::heap()->new_space()->Grow();
2316 } 2319 }
2317 2320
2318 2321
2319 i::ScopedVector<char> source(1024); 2322 i::ScopedVector<char> source(1024);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
2352 inner_object->RawFastPropertyAt(idx2))); 2355 inner_object->RawFastPropertyAt(idx2)));
2353 } 2356 }
2354 2357
2355 2358
2356 TEST(OptimizedPretenuringDoubleArrayProperties) { 2359 TEST(OptimizedPretenuringDoubleArrayProperties) {
2357 i::FLAG_allow_natives_syntax = true; 2360 i::FLAG_allow_natives_syntax = true;
2358 i::FLAG_expose_gc = true; 2361 i::FLAG_expose_gc = true;
2359 CcTest::InitializeVM(); 2362 CcTest::InitializeVM();
2360 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; 2363 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return;
2361 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; 2364 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
2365 if (!i::FLAG_allocation_site_pretenuring) return;
2362 v8::HandleScope scope(CcTest::isolate()); 2366 v8::HandleScope scope(CcTest::isolate());
2363 2367
2364 // Grow new space unitl maximum capacity reached. 2368 // Grow new space unitl maximum capacity reached.
2365 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) { 2369 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) {
2366 CcTest::heap()->new_space()->Grow(); 2370 CcTest::heap()->new_space()->Grow();
2367 } 2371 }
2368 2372
2369 i::ScopedVector<char> source(1024); 2373 i::ScopedVector<char> source(1024);
2370 i::SNPrintF( 2374 i::SNPrintF(
2371 source, 2375 source,
(...skipping 20 matching lines...) Expand all
2392 CHECK(CcTest::heap()->InOldDataSpace(o->properties())); 2396 CHECK(CcTest::heap()->InOldDataSpace(o->properties()));
2393 } 2397 }
2394 2398
2395 2399
2396 TEST(OptimizedPretenuringdoubleArrayLiterals) { 2400 TEST(OptimizedPretenuringdoubleArrayLiterals) {
2397 i::FLAG_allow_natives_syntax = true; 2401 i::FLAG_allow_natives_syntax = true;
2398 i::FLAG_expose_gc = true; 2402 i::FLAG_expose_gc = true;
2399 CcTest::InitializeVM(); 2403 CcTest::InitializeVM();
2400 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; 2404 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return;
2401 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; 2405 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
2406 if (!i::FLAG_allocation_site_pretenuring) return;
2402 v8::HandleScope scope(CcTest::isolate()); 2407 v8::HandleScope scope(CcTest::isolate());
2403 2408
2404 // Grow new space unitl maximum capacity reached. 2409 // Grow new space unitl maximum capacity reached.
2405 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) { 2410 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) {
2406 CcTest::heap()->new_space()->Grow(); 2411 CcTest::heap()->new_space()->Grow();
2407 } 2412 }
2408 2413
2409 i::ScopedVector<char> source(1024); 2414 i::ScopedVector<char> source(1024);
2410 i::SNPrintF( 2415 i::SNPrintF(
2411 source, 2416 source,
(...skipping 19 matching lines...) Expand all
2431 CHECK(CcTest::heap()->InOldDataSpace(o->elements())); 2436 CHECK(CcTest::heap()->InOldDataSpace(o->elements()));
2432 CHECK(CcTest::heap()->InOldPointerSpace(*o)); 2437 CHECK(CcTest::heap()->InOldPointerSpace(*o));
2433 } 2438 }
2434 2439
2435 2440
2436 TEST(OptimizedPretenuringNestedMixedArrayLiterals) { 2441 TEST(OptimizedPretenuringNestedMixedArrayLiterals) {
2437 i::FLAG_allow_natives_syntax = true; 2442 i::FLAG_allow_natives_syntax = true;
2438 i::FLAG_expose_gc = true; 2443 i::FLAG_expose_gc = true;
2439 CcTest::InitializeVM(); 2444 CcTest::InitializeVM();
2440 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; 2445 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return;
2446 if (!i::FLAG_allocation_site_pretenuring) return;
2441 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; 2447 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
2442 v8::HandleScope scope(CcTest::isolate()); 2448 v8::HandleScope scope(CcTest::isolate());
2443 2449
2444 // Grow new space unitl maximum capacity reached. 2450 // Grow new space unitl maximum capacity reached.
2445 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) { 2451 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) {
2446 CcTest::heap()->new_space()->Grow(); 2452 CcTest::heap()->new_space()->Grow();
2447 } 2453 }
2448 2454
2449 i::ScopedVector<char> source(1024); 2455 i::ScopedVector<char> source(1024);
2450 i::SNPrintF( 2456 i::SNPrintF(
(...skipping 29 matching lines...) Expand all
2480 CHECK(CcTest::heap()->InOldDataSpace(double_array_handle->elements())); 2486 CHECK(CcTest::heap()->InOldDataSpace(double_array_handle->elements()));
2481 } 2487 }
2482 2488
2483 2489
2484 TEST(OptimizedPretenuringNestedObjectLiterals) { 2490 TEST(OptimizedPretenuringNestedObjectLiterals) {
2485 i::FLAG_allow_natives_syntax = true; 2491 i::FLAG_allow_natives_syntax = true;
2486 i::FLAG_expose_gc = true; 2492 i::FLAG_expose_gc = true;
2487 CcTest::InitializeVM(); 2493 CcTest::InitializeVM();
2488 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; 2494 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return;
2489 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; 2495 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
2496 if (!i::FLAG_allocation_site_pretenuring) return;
2490 v8::HandleScope scope(CcTest::isolate()); 2497 v8::HandleScope scope(CcTest::isolate());
2491 2498
2492 // Grow new space unitl maximum capacity reached. 2499 // Grow new space unitl maximum capacity reached.
2493 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) { 2500 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) {
2494 CcTest::heap()->new_space()->Grow(); 2501 CcTest::heap()->new_space()->Grow();
2495 } 2502 }
2496 2503
2497 i::ScopedVector<char> source(1024); 2504 i::ScopedVector<char> source(1024);
2498 i::SNPrintF( 2505 i::SNPrintF(
2499 source, 2506 source,
(...skipping 29 matching lines...) Expand all
2529 CHECK(CcTest::heap()->InOldPointerSpace(int_array_handle_2->elements())); 2536 CHECK(CcTest::heap()->InOldPointerSpace(int_array_handle_2->elements()));
2530 } 2537 }
2531 2538
2532 2539
2533 TEST(OptimizedPretenuringNestedDoubleLiterals) { 2540 TEST(OptimizedPretenuringNestedDoubleLiterals) {
2534 i::FLAG_allow_natives_syntax = true; 2541 i::FLAG_allow_natives_syntax = true;
2535 i::FLAG_expose_gc = true; 2542 i::FLAG_expose_gc = true;
2536 CcTest::InitializeVM(); 2543 CcTest::InitializeVM();
2537 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; 2544 if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return;
2538 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; 2545 if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
2546 if (!i::FLAG_allocation_site_pretenuring) return;
2539 v8::HandleScope scope(CcTest::isolate()); 2547 v8::HandleScope scope(CcTest::isolate());
2540 2548
2541 // Grow new space unitl maximum capacity reached. 2549 // Grow new space unitl maximum capacity reached.
2542 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) { 2550 while (!CcTest::heap()->new_space()->IsAtMaximumCapacity()) {
2543 CcTest::heap()->new_space()->Grow(); 2551 CcTest::heap()->new_space()->Grow();
2544 } 2552 }
2545 2553
2546 i::ScopedVector<char> source(1024); 2554 i::ScopedVector<char> source(1024);
2547 i::SNPrintF( 2555 i::SNPrintF(
2548 source, 2556 source,
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
3849 !(site->IsUndefined()); 3857 !(site->IsUndefined());
3850 site = AllocationSite::cast(site)->weak_next()) { 3858 site = AllocationSite::cast(site)->weak_next()) {
3851 count++; 3859 count++;
3852 } 3860 }
3853 return count; 3861 return count;
3854 } 3862 }
3855 3863
3856 3864
3857 TEST(EnsureAllocationSiteDependentCodesProcessed) { 3865 TEST(EnsureAllocationSiteDependentCodesProcessed) {
3858 if (i::FLAG_always_opt || !i::FLAG_crankshaft) return; 3866 if (i::FLAG_always_opt || !i::FLAG_crankshaft) return;
3867 if (!i::FLAG_allocation_site_transitioning) return;
3859 i::FLAG_allow_natives_syntax = true; 3868 i::FLAG_allow_natives_syntax = true;
3860 CcTest::InitializeVM(); 3869 CcTest::InitializeVM();
3861 Isolate* isolate = CcTest::i_isolate(); 3870 Isolate* isolate = CcTest::i_isolate();
3862 v8::internal::Heap* heap = CcTest::heap(); 3871 v8::internal::Heap* heap = CcTest::heap();
3863 GlobalHandles* global_handles = isolate->global_handles(); 3872 GlobalHandles* global_handles = isolate->global_handles();
3864 3873
3865 if (!isolate->use_crankshaft()) return; 3874 if (!isolate->use_crankshaft()) return;
3866 3875
3867 // The allocation site at the head of the list is ours. 3876 // The allocation site at the head of the list is ours.
3868 Handle<AllocationSite> site; 3877 Handle<AllocationSite> site;
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
4505 #ifdef DEBUG 4514 #ifdef DEBUG
4506 TEST(PathTracer) { 4515 TEST(PathTracer) {
4507 CcTest::InitializeVM(); 4516 CcTest::InitializeVM();
4508 v8::HandleScope scope(CcTest::isolate()); 4517 v8::HandleScope scope(CcTest::isolate());
4509 4518
4510 v8::Local<v8::Value> result = CompileRun("'abc'"); 4519 v8::Local<v8::Value> result = CompileRun("'abc'");
4511 Handle<Object> o = v8::Utils::OpenHandle(*result); 4520 Handle<Object> o = v8::Utils::OpenHandle(*result);
4512 CcTest::i_isolate()->heap()->TracePathToObject(*o); 4521 CcTest::i_isolate()->heap()->TracePathToObject(*o);
4513 } 4522 }
4514 #endif // DEBUG 4523 #endif // DEBUG
OLDNEW
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | test/mjsunit/allocation-site-info.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698