global_handles->Destroy(h1.location());
}
+
TEST(DeleteWeakGlobalHandle) {
InitializeVM();
GlobalHandles* global_handles = Isolate::Current()->global_handles();
CHECK(WeakPointerCleared);
}
+
static const char* not_so_random_string_table[] = {
"abstract",
"boolean",
InitializeVM();
NewSpace* new_space = HEAP->new_space();
- if (HEAP->ReservedSemiSpaceSize() == HEAP->InitialSemiSpaceSize()) {
+ if (HEAP->ReservedSemiSpaceSize() == HEAP->InitialSemiSpaceSize() ||
+ HEAP->MaxSemiSpaceSize() == HEAP->InitialSemiSpaceSize()) {
// The max size cannot exceed the reserved size, since semispaces must be
// always within the reserved space. We can't test new space growing and
// shrinking if the reserved size is the same as the minimum (initial) size.
TEST(CollectingAllAvailableGarbageShrinksNewSpace) {
InitializeVM();
- if (HEAP->ReservedSemiSpaceSize() == HEAP->InitialSemiSpaceSize()) {
+ if (HEAP->ReservedSemiSpaceSize() == HEAP->InitialSemiSpaceSize() ||
+ HEAP->MaxSemiSpaceSize() == HEAP->InitialSemiSpaceSize()) {
// The max size cannot exceed the reserved size, since semispaces must be
// always within the reserved space. We can't test new space growing and
// shrinking if the reserved size is the same as the minimum (initial) size.
i::FLAG_trace_incremental_marking = true;
InitializeVM();
v8::HandleScope scope;
+ static const int transitions_count = 256;
- #define TRANSITION_COUNT 256
- for (int i = 0; i < TRANSITION_COUNT; i++) {
- EmbeddedVector<char, 64> buffer;
- OS::SNPrintF(buffer, "var o = new Object; o.prop%d = %d;", i, i);
- CompileRun(buffer.start());
+ {
+ AlwaysAllocateScope always_allocate;
+ for (int i = 0; i < transitions_count; i++) {
+ EmbeddedVector<char, 64> buffer;
+ OS::SNPrintF(buffer, "var o = new Object; o.prop%d = %d;", i, i);
+ CompileRun(buffer.start());
+ }
+ CompileRun("var root = new Object;");
}
- CompileRun("var root = new Object;");
+
Handle<JSObject> root =
v8::Utils::OpenHandle(
*v8::Handle<v8::Object>::Cast(
// Count number of live transitions before marking.
int transitions_before = CountMapTransitions(root->map());
CompileRun("%DebugPrint(root);");
- CHECK_EQ(TRANSITION_COUNT, transitions_before);
+ CHECK_EQ(transitions_count, transitions_before);
// Go through all incremental marking steps in one swoop.
IncrementalMarking* marking = HEAP->incremental_marking();
}
CHECK(marking->IsComplete());
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
- CHECK(marking->IsStopped());
// Count number of live transitions after marking. Note that one transition
// is left, because 'o' still holds an instance of one transition target.
// Explicitly request GC to perform final marking step and sweeping.
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
- CHECK(marking->IsStopped());
Handle<JSObject> root =
v8::Utils::OpenHandle(
// Explicitly request GC to perform final marking step and sweeping.
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
- CHECK(marking->IsStopped());
Handle<JSObject> root =
v8::Utils::OpenHandle(
}
CHECK(marking->IsComplete());
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
- CHECK(marking->IsStopped());
CHECK_EQ(2, cells->CellCount());
CHECK(cells->Cell(0)->value()->IsTheHole());