| OLD | NEW |
| 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 4292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4303 } | 4303 } |
| 4304 CHECK(weak_cell1->value()->IsFixedArray()); | 4304 CHECK(weak_cell1->value()->IsFixedArray()); |
| 4305 CHECK_EQ(*survivor, weak_cell2->value()); | 4305 CHECK_EQ(*survivor, weak_cell2->value()); |
| 4306 heap->CollectGarbage(NEW_SPACE); | 4306 heap->CollectGarbage(NEW_SPACE); |
| 4307 CHECK(weak_cell1->value()->IsFixedArray()); | 4307 CHECK(weak_cell1->value()->IsFixedArray()); |
| 4308 CHECK_EQ(*survivor, weak_cell2->value()); | 4308 CHECK_EQ(*survivor, weak_cell2->value()); |
| 4309 heap->CollectGarbage(NEW_SPACE); | 4309 heap->CollectGarbage(NEW_SPACE); |
| 4310 CHECK(weak_cell1->value()->IsFixedArray()); | 4310 CHECK(weak_cell1->value()->IsFixedArray()); |
| 4311 CHECK_EQ(*survivor, weak_cell2->value()); | 4311 CHECK_EQ(*survivor, weak_cell2->value()); |
| 4312 heap->CollectAllAvailableGarbage(); | 4312 heap->CollectAllAvailableGarbage(); |
| 4313 CHECK(weak_cell1->cleared()); |
| 4313 CHECK_EQ(*survivor, weak_cell2->value()); | 4314 CHECK_EQ(*survivor, weak_cell2->value()); |
| 4314 CHECK(weak_cell2->value()->IsFixedArray()); | |
| 4315 } | 4315 } |
| 4316 | 4316 |
| 4317 | 4317 |
| 4318 TEST(WeakCellsWithIncrementalMarking) { | 4318 TEST(WeakCellsWithIncrementalMarking) { |
| 4319 CcTest::InitializeVM(); | 4319 CcTest::InitializeVM(); |
| 4320 Isolate* isolate = CcTest::i_isolate(); | 4320 Isolate* isolate = CcTest::i_isolate(); |
| 4321 v8::internal::Heap* heap = CcTest::heap(); | 4321 v8::internal::Heap* heap = CcTest::heap(); |
| 4322 v8::internal::Factory* factory = isolate->factory(); | 4322 v8::internal::Factory* factory = isolate->factory(); |
| 4323 | 4323 |
| 4324 const int N = 16; | 4324 const int N = 16; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 4335 IncrementalMarking* marking = heap->incremental_marking(); | 4335 IncrementalMarking* marking = heap->incremental_marking(); |
| 4336 if (marking->IsStopped()) marking->Start(); | 4336 if (marking->IsStopped()) marking->Start(); |
| 4337 marking->Step(128, IncrementalMarking::NO_GC_VIA_STACK_GUARD); | 4337 marking->Step(128, IncrementalMarking::NO_GC_VIA_STACK_GUARD); |
| 4338 heap->CollectGarbage(NEW_SPACE); | 4338 heap->CollectGarbage(NEW_SPACE); |
| 4339 CHECK(weak_cell->value()->IsFixedArray()); | 4339 CHECK(weak_cell->value()->IsFixedArray()); |
| 4340 weak_cells[i] = inner_scope.CloseAndEscape(weak_cell); | 4340 weak_cells[i] = inner_scope.CloseAndEscape(weak_cell); |
| 4341 } | 4341 } |
| 4342 heap->CollectAllGarbage(Heap::kNoGCFlags); | 4342 heap->CollectAllGarbage(Heap::kNoGCFlags); |
| 4343 CHECK_EQ(*survivor, weak_cells[0]->value()); | 4343 CHECK_EQ(*survivor, weak_cells[0]->value()); |
| 4344 for (int i = 1; i < N; i++) { | 4344 for (int i = 1; i < N; i++) { |
| 4345 CHECK(weak_cells[i]->value()->IsUndefined()); | 4345 CHECK(weak_cells[i]->cleared()); |
| 4346 } | 4346 } |
| 4347 } | 4347 } |
| 4348 | 4348 |
| 4349 | 4349 |
| 4350 #ifdef DEBUG | 4350 #ifdef DEBUG |
| 4351 TEST(AddInstructionChangesNewSpacePromotion) { | 4351 TEST(AddInstructionChangesNewSpacePromotion) { |
| 4352 i::FLAG_allow_natives_syntax = true; | 4352 i::FLAG_allow_natives_syntax = true; |
| 4353 i::FLAG_expose_gc = true; | 4353 i::FLAG_expose_gc = true; |
| 4354 i::FLAG_stress_compaction = true; | 4354 i::FLAG_stress_compaction = true; |
| 4355 i::FLAG_gc_interval = 1000; | 4355 i::FLAG_gc_interval = 1000; |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4611 #ifdef DEBUG | 4611 #ifdef DEBUG |
| 4612 TEST(PathTracer) { | 4612 TEST(PathTracer) { |
| 4613 CcTest::InitializeVM(); | 4613 CcTest::InitializeVM(); |
| 4614 v8::HandleScope scope(CcTest::isolate()); | 4614 v8::HandleScope scope(CcTest::isolate()); |
| 4615 | 4615 |
| 4616 v8::Local<v8::Value> result = CompileRun("'abc'"); | 4616 v8::Local<v8::Value> result = CompileRun("'abc'"); |
| 4617 Handle<Object> o = v8::Utils::OpenHandle(*result); | 4617 Handle<Object> o = v8::Utils::OpenHandle(*result); |
| 4618 CcTest::i_isolate()->heap()->TracePathToObject(*o); | 4618 CcTest::i_isolate()->heap()->TracePathToObject(*o); |
| 4619 } | 4619 } |
| 4620 #endif // DEBUG | 4620 #endif // DEBUG |
| OLD | NEW |