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 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 " if (i >= 3) live.push(object, prototype);" | 1941 " if (i >= 3) live.push(object, prototype);" |
1942 "}"); | 1942 "}"); |
1943 | 1943 |
1944 Handle<JSObject> baseObject = | 1944 Handle<JSObject> baseObject = |
1945 v8::Utils::OpenHandle( | 1945 v8::Utils::OpenHandle( |
1946 *v8::Handle<v8::Object>::Cast( | 1946 *v8::Handle<v8::Object>::Cast( |
1947 v8::Context::GetCurrent()->Global()->Get(v8_str("base")))); | 1947 v8::Context::GetCurrent()->Global()->Get(v8_str("base")))); |
1948 | 1948 |
1949 // Verify that only dead prototype transitions are cleared. | 1949 // Verify that only dead prototype transitions are cleared. |
1950 CHECK_EQ(10, baseObject->map()->NumberOfProtoTransitions()); | 1950 CHECK_EQ(10, baseObject->map()->NumberOfProtoTransitions()); |
1951 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 1951 HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
1952 const int transitions = 10 - 3; | 1952 const int transitions = 10 - 3; |
1953 CHECK_EQ(transitions, baseObject->map()->NumberOfProtoTransitions()); | 1953 CHECK_EQ(transitions, baseObject->map()->NumberOfProtoTransitions()); |
1954 | 1954 |
1955 // Verify that prototype transitions array was compacted. | 1955 // Verify that prototype transitions array was compacted. |
1956 FixedArray* trans = baseObject->map()->GetPrototypeTransitions(); | 1956 FixedArray* trans = baseObject->map()->GetPrototypeTransitions(); |
1957 for (int i = 0; i < transitions; i++) { | 1957 for (int i = 0; i < transitions; i++) { |
1958 int j = Map::kProtoTransitionHeaderSize + | 1958 int j = Map::kProtoTransitionHeaderSize + |
1959 i * Map::kProtoTransitionElementsPerEntry; | 1959 i * Map::kProtoTransitionElementsPerEntry; |
1960 CHECK(trans->get(j + Map::kProtoTransitionMapOffset)->IsMap()); | 1960 CHECK(trans->get(j + Map::kProtoTransitionMapOffset)->IsMap()); |
1961 Object* proto = trans->get(j + Map::kProtoTransitionPrototypeOffset); | 1961 Object* proto = trans->get(j + Map::kProtoTransitionPrototypeOffset); |
(...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3348 " var a = new Array(n);" | 3348 " var a = new Array(n);" |
3349 " for (var i = 0; i < n; i += 100) a[i] = i;" | 3349 " for (var i = 0; i < n; i += 100) a[i] = i;" |
3350 "};" | 3350 "};" |
3351 "f(10 * 1024 * 1024);"); | 3351 "f(10 * 1024 * 1024);"); |
3352 IncrementalMarking* marking = HEAP->incremental_marking(); | 3352 IncrementalMarking* marking = HEAP->incremental_marking(); |
3353 if (marking->IsStopped()) marking->Start(); | 3353 if (marking->IsStopped()) marking->Start(); |
3354 // This big step should be sufficient to mark the whole array. | 3354 // This big step should be sufficient to mark the whole array. |
3355 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); | 3355 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); |
3356 ASSERT(marking->IsComplete()); | 3356 ASSERT(marking->IsComplete()); |
3357 } | 3357 } |
OLD | NEW |