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

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

Issue 345523002: An object should only be promoted to the old generation if it survived a scavenge operation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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 | « test/cctest/test-api.cc ('k') | test/cctest/test-mark-compact.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 4297 matching lines...) Expand 10 before | Expand all | Expand 10 after
4308 CcTest::InitializeVM(); 4308 CcTest::InitializeVM();
4309 v8::HandleScope scope(CcTest::isolate()); 4309 v8::HandleScope scope(CcTest::isolate());
4310 Isolate* isolate = CcTest::i_isolate(); 4310 Isolate* isolate = CcTest::i_isolate();
4311 Heap* heap = isolate->heap(); 4311 Heap* heap = isolate->heap();
4312 4312
4313 v8::Local<v8::Value> result = CompileRun( 4313 v8::Local<v8::Value> result = CompileRun(
4314 "var array = new Array(40000);" 4314 "var array = new Array(40000);"
4315 "var tmp = new Array(100000);" 4315 "var tmp = new Array(100000);"
4316 "array[0] = 10;" 4316 "array[0] = 10;"
4317 "gc();" 4317 "gc();"
4318 "gc();"
4318 "array.shift();" 4319 "array.shift();"
4319 "array;"); 4320 "array;");
4320 4321
4321 Handle<JSObject> o = 4322 Handle<JSObject> o =
4322 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result)); 4323 v8::Utils::OpenHandle(*v8::Handle<v8::Object>::Cast(result));
4323 CHECK(heap->InOldPointerSpace(o->elements())); 4324 CHECK(heap->InOldPointerSpace(o->elements()));
4324 CHECK(heap->InOldPointerSpace(*o)); 4325 CHECK(heap->InOldPointerSpace(*o));
4325 Page* page = Page::FromAddress(o->elements()->address()); 4326 Page* page = Page::FromAddress(o->elements()->address());
4326 CHECK(page->WasSwept() || 4327 CHECK(page->WasSwept() ||
4327 Marking::IsBlack(Marking::MarkBitFrom(o->elements()))); 4328 Marking::IsBlack(Marking::MarkBitFrom(o->elements())));
4328 } 4329 }
4329 4330
4330 4331
4331 #ifdef DEBUG 4332 #ifdef DEBUG
4332 TEST(PathTracer) { 4333 TEST(PathTracer) {
4333 CcTest::InitializeVM(); 4334 CcTest::InitializeVM();
4334 v8::HandleScope scope(CcTest::isolate()); 4335 v8::HandleScope scope(CcTest::isolate());
4335 4336
4336 v8::Local<v8::Value> result = CompileRun("'abc'"); 4337 v8::Local<v8::Value> result = CompileRun("'abc'");
4337 Handle<Object> o = v8::Utils::OpenHandle(*result); 4338 Handle<Object> o = v8::Utils::OpenHandle(*result);
4338 CcTest::i_isolate()->heap()->TracePathToObject(*o); 4339 CcTest::i_isolate()->heap()->TracePathToObject(*o);
4339 } 4340 }
4340 #endif // DEBUG 4341 #endif // DEBUG
OLDNEW
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698