OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 { MaybeObject* maybe_obj = HEAP->AllocateFixedArray(100, TENURED); | 135 { MaybeObject* maybe_obj = HEAP->AllocateFixedArray(100, TENURED); |
136 if (!maybe_obj->ToObject(&obj)) break; | 136 if (!maybe_obj->ToObject(&obj)) break; |
137 } | 137 } |
138 | 138 |
139 host->set(0, obj); | 139 host->set(0, obj); |
140 host = FixedArray::cast(obj); | 140 host = FixedArray::cast(obj); |
141 } | 141 } |
142 | 142 |
143 // Call mark compact GC, and it should pass. | 143 // Call mark compact GC, and it should pass. |
144 HEAP->CollectGarbage(OLD_POINTER_SPACE); | 144 HEAP->CollectGarbage(OLD_POINTER_SPACE); |
145 | |
146 // array should not be promoted because the old space is full. | |
147 CHECK(HEAP->InSpace(*array, NEW_SPACE)); | |
148 } | 145 } |
149 | 146 |
150 | 147 |
151 TEST(MarkCompactCollector) { | 148 TEST(MarkCompactCollector) { |
152 InitializeVM(); | 149 InitializeVM(); |
153 | 150 |
154 v8::HandleScope sc; | 151 v8::HandleScope sc; |
155 // call mark-compact when heap is empty | 152 // call mark-compact when heap is empty |
156 HEAP->CollectGarbage(OLD_POINTER_SPACE); | 153 HEAP->CollectGarbage(OLD_POINTER_SPACE); |
157 | 154 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 Handle<Object> object = | 437 Handle<Object> object = |
441 global_handles->Create(HEAP->AllocateFixedArray(1)->ToObjectChecked()); | 438 global_handles->Create(HEAP->AllocateFixedArray(1)->ToObjectChecked()); |
442 | 439 |
443 TestRetainedObjectInfo info; | 440 TestRetainedObjectInfo info; |
444 global_handles->AddObjectGroup(NULL, 0, &info); | 441 global_handles->AddObjectGroup(NULL, 0, &info); |
445 ASSERT(info.has_been_disposed()); | 442 ASSERT(info.has_been_disposed()); |
446 | 443 |
447 global_handles->AddImplicitReferences( | 444 global_handles->AddImplicitReferences( |
448 Handle<HeapObject>::cast(object).location(), NULL, 0); | 445 Handle<HeapObject>::cast(object).location(), NULL, 0); |
449 } | 446 } |
OLD | NEW |