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 2192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2203 CHECK_EQ(initialTransitions + 10, | 2203 CHECK_EQ(initialTransitions + 10, |
2204 baseObject->map()->NumberOfProtoTransitions()); | 2204 baseObject->map()->NumberOfProtoTransitions()); |
2205 CcTest::heap()->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); | 2205 CcTest::heap()->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); |
2206 const int transitions = 10 - 3; | 2206 const int transitions = 10 - 3; |
2207 CHECK_EQ(initialTransitions + transitions, | 2207 CHECK_EQ(initialTransitions + transitions, |
2208 baseObject->map()->NumberOfProtoTransitions()); | 2208 baseObject->map()->NumberOfProtoTransitions()); |
2209 | 2209 |
2210 // Verify that prototype transitions array was compacted. | 2210 // Verify that prototype transitions array was compacted. |
2211 FixedArray* trans = baseObject->map()->GetPrototypeTransitions(); | 2211 FixedArray* trans = baseObject->map()->GetPrototypeTransitions(); |
2212 for (int i = initialTransitions; i < initialTransitions + transitions; i++) { | 2212 for (int i = initialTransitions; i < initialTransitions + transitions; i++) { |
2213 int j = Map::kProtoTransitionHeaderSize + | 2213 int j = Map::kProtoTransitionHeaderSize + i; |
2214 i * Map::kProtoTransitionElementsPerEntry; | 2214 CHECK(trans->get(j)->IsMap()); |
2215 CHECK(trans->get(j + Map::kProtoTransitionMapOffset)->IsMap()); | |
2216 Object* proto = trans->get(j + Map::kProtoTransitionPrototypeOffset); | |
2217 CHECK(proto->IsJSObject()); | |
2218 } | 2215 } |
2219 | 2216 |
2220 // Make sure next prototype is placed on an old-space evacuation candidate. | 2217 // Make sure next prototype is placed on an old-space evacuation candidate. |
2221 Handle<JSObject> prototype; | 2218 Handle<JSObject> prototype; |
2222 PagedSpace* space = CcTest::heap()->old_pointer_space(); | 2219 PagedSpace* space = CcTest::heap()->old_pointer_space(); |
2223 { | 2220 { |
2224 AlwaysAllocateScope always_allocate(isolate); | 2221 AlwaysAllocateScope always_allocate(isolate); |
2225 SimulateFullSpace(space); | 2222 SimulateFullSpace(space); |
2226 prototype = factory->NewJSArray(32 * KB, FAST_HOLEY_ELEMENTS, TENURED); | 2223 prototype = factory->NewJSArray(32 * KB, FAST_HOLEY_ELEMENTS, TENURED); |
2227 } | 2224 } |
(...skipping 2761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4989 #ifdef DEBUG | 4986 #ifdef DEBUG |
4990 TEST(PathTracer) { | 4987 TEST(PathTracer) { |
4991 CcTest::InitializeVM(); | 4988 CcTest::InitializeVM(); |
4992 v8::HandleScope scope(CcTest::isolate()); | 4989 v8::HandleScope scope(CcTest::isolate()); |
4993 | 4990 |
4994 v8::Local<v8::Value> result = CompileRun("'abc'"); | 4991 v8::Local<v8::Value> result = CompileRun("'abc'"); |
4995 Handle<Object> o = v8::Utils::OpenHandle(*result); | 4992 Handle<Object> o = v8::Utils::OpenHandle(*result); |
4996 CcTest::i_isolate()->heap()->TracePathToObject(*o); | 4993 CcTest::i_isolate()->heap()->TracePathToObject(*o); |
4997 } | 4994 } |
4998 #endif // DEBUG | 4995 #endif // DEBUG |
OLD | NEW |