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

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

Issue 1358703003: Changed scavenge GC to collect unmodified references (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Re-implemented scavenge optimization to discard unmodified references Created 5 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
« src/heap/heap.cc ('K') | « src/heap/heap.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 6518 matching lines...) Expand 10 before | Expand all | Expand 10 after
6529 FlagAndPersistent object_a, object_b; 6529 FlagAndPersistent object_a, object_b;
6530 6530
6531 intptr_t big_heap_size; 6531 intptr_t big_heap_size;
6532 6532
6533 { 6533 {
6534 v8::HandleScope handle_scope(iso); 6534 v8::HandleScope handle_scope(iso);
6535 Local<Object> a(v8::Object::New(iso)); 6535 Local<Object> a(v8::Object::New(iso));
6536 Local<Object> b(v8::Object::New(iso)); 6536 Local<Object> b(v8::Object::New(iso));
6537 object_a.handle.Reset(iso, a); 6537 object_a.handle.Reset(iso, a);
6538 object_b.handle.Reset(iso, b); 6538 object_b.handle.Reset(iso, b);
6539 if (interlinked) { 6539 if (interlinked && !v8::internal::FLAG_scavenge_remove_unmodified_objects) {
6540 a->Set(v8_str("x"), b); 6540 a->Set(v8_str("x"), b);
6541 b->Set(v8_str("x"), a); 6541 b->Set(v8_str("x"), a);
6542 } 6542 }
6543 if (global_gc) { 6543 if (global_gc) {
6544 CcTest::heap()->CollectAllGarbage(); 6544 CcTest::heap()->CollectAllGarbage();
6545 } else { 6545 } else {
6546 CcTest::heap()->CollectGarbage(i::NEW_SPACE); 6546 CcTest::heap()->CollectGarbage(i::NEW_SPACE);
6547 } 6547 }
6548 // We are relying on this creating a big flag array and reserving the space 6548 // We are relying on this creating a big flag array and reserving the space
6549 // up front. 6549 // up front.
6550 v8::Handle<Value> big_array = CompileRun("new Array(50000)"); 6550 v8::Handle<Value> big_array = CompileRun("new Array(50000)");
6551 a->Set(v8_str("y"), big_array); 6551 if (!v8::internal::FLAG_scavenge_remove_unmodified_objects)
6552 a->Set(v8_str("y"), big_array);
6552 big_heap_size = CcTest::heap()->SizeOfObjects(); 6553 big_heap_size = CcTest::heap()->SizeOfObjects();
6553 } 6554 }
6554 6555
6555 object_a.flag = false; 6556 object_a.flag = false;
6556 object_b.flag = false; 6557 object_b.flag = false;
6557 object_a.handle.SetWeak(&object_a, &SetFlag, 6558 object_a.handle.SetWeak(&object_a, &SetFlag,
6558 v8::WeakCallbackType::kParameter); 6559 v8::WeakCallbackType::kParameter);
6559 object_b.handle.SetWeak(&object_b, &SetFlag, 6560 object_b.handle.SetWeak(&object_b, &SetFlag,
6560 v8::WeakCallbackType::kParameter); 6561 v8::WeakCallbackType::kParameter);
6561 CHECK(!object_b.handle.IsIndependent()); 6562 CHECK(!object_b.handle.IsIndependent());
(...skipping 15288 matching lines...) Expand 10 before | Expand all | Expand 10 after
21850 timeout_thread.Join(); 21851 timeout_thread.Join();
21851 } 21852 }
21852 21853
21853 21854
21854 TEST(EstimatedContextSize) { 21855 TEST(EstimatedContextSize) {
21855 v8::Isolate* isolate = CcTest::isolate(); 21856 v8::Isolate* isolate = CcTest::isolate();
21856 v8::HandleScope scope(isolate); 21857 v8::HandleScope scope(isolate);
21857 LocalContext env; 21858 LocalContext env;
21858 CHECK(50000 < env->EstimatedSize()); 21859 CHECK(50000 < env->EstimatedSize());
21859 } 21860 }
OLDNEW
« src/heap/heap.cc ('K') | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698