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

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

Issue 1470773003: Optimize ClearNonLiveReferences: do not compact prototype transitions in GC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years 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
« src/transitions.cc ('K') | « src/transitions.cc ('k') | no next file » | 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 2603 matching lines...) Expand 10 before | Expand all | Expand 10 after
2614 global->Get(ctx, v8_str("g")).ToLocalChecked()); 2614 global->Get(ctx, v8_str("g")).ToLocalChecked());
2615 g->Call(ctx, global, 0, nullptr).ToLocalChecked(); 2615 g->Call(ctx, global, 0, nullptr).ToLocalChecked();
2616 } 2616 }
2617 2617
2618 CcTest::heap()->incremental_marking()->set_should_hurry(true); 2618 CcTest::heap()->incremental_marking()->set_should_hurry(true);
2619 CcTest::heap()->CollectGarbage(OLD_SPACE); 2619 CcTest::heap()->CollectGarbage(OLD_SPACE);
2620 } 2620 }
2621 2621
2622 2622
2623 static int NumberOfProtoTransitions(Map* map) { 2623 static int NumberOfProtoTransitions(Map* map) {
2624 return TransitionArray::NumberOfPrototypeTransitions( 2624 FixedArray* transitions = TransitionArray::GetPrototypeTransitions(map);
2625 TransitionArray::GetPrototypeTransitions(map)); 2625 TransitionArray::CompactPrototypeTransitionArray(transitions);
2626 return TransitionArray::NumberOfPrototypeTransitions(transitions);
2626 } 2627 }
2627 2628
2628 2629
2629 TEST(PrototypeTransitionClearing) { 2630 TEST(PrototypeTransitionClearing) {
2630 if (FLAG_never_compact) return; 2631 if (FLAG_never_compact) return;
2631 CcTest::InitializeVM(); 2632 CcTest::InitializeVM();
2632 Isolate* isolate = CcTest::i_isolate(); 2633 Isolate* isolate = CcTest::i_isolate();
2633 Factory* factory = isolate->factory(); 2634 Factory* factory = isolate->factory();
2634 v8::HandleScope scope(CcTest::isolate()); 2635 v8::HandleScope scope(CcTest::isolate());
2635 v8::Local<v8::Context> ctx = CcTest::isolate()->GetCurrentContext(); 2636 v8::Local<v8::Context> ctx = CcTest::isolate()->GetCurrentContext();
(...skipping 3813 matching lines...) Expand 10 before | Expand all | Expand 10 after
6449 isolate->IncrementJsCallsFromApiCounter(); 6450 isolate->IncrementJsCallsFromApiCounter();
6450 isolate->IncrementJsCallsFromApiCounter(); 6451 isolate->IncrementJsCallsFromApiCounter();
6451 isolate->IncrementJsCallsFromApiCounter(); 6452 isolate->IncrementJsCallsFromApiCounter();
6452 calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4); 6453 calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4);
6453 CheckDoubleEquals(2, calls_per_ms); 6454 CheckDoubleEquals(2, calls_per_ms);
6454 } 6455 }
6455 6456
6456 6457
6457 } // namespace internal 6458 } // namespace internal
6458 } // namespace v8 6459 } // namespace v8
OLDNEW
« src/transitions.cc ('K') | « src/transitions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698