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 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1573 CcTest::heap()->CollectGarbage(NEW_SPACE); | 1573 CcTest::heap()->CollectGarbage(NEW_SPACE); |
1574 CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[i])); | 1574 CHECK_EQ(opt ? 3 : 0, CountOptimizedUserFunctions(ctx[i])); |
1575 } | 1575 } |
1576 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); | 1576 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); |
1577 CHECK_EQ(opt ? 2 : 0, CountOptimizedUserFunctions(ctx[i])); | 1577 CHECK_EQ(opt ? 2 : 0, CountOptimizedUserFunctions(ctx[i])); |
1578 | 1578 |
1579 ctx[i]->Exit(); | 1579 ctx[i]->Exit(); |
1580 } | 1580 } |
1581 | 1581 |
1582 // Force compilation cache cleanup. | 1582 // Force compilation cache cleanup. |
1583 CcTest::heap()->NotifyContextDisposed(); | 1583 CcTest::heap()->NotifyContextDisposed(true); |
1584 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); | 1584 CcTest::heap()->CollectAllGarbage(Heap::kNoGCFlags); |
1585 | 1585 |
1586 // Dispose the native contexts one by one. | 1586 // Dispose the native contexts one by one. |
1587 for (int i = 0; i < kNumTestContexts; i++) { | 1587 for (int i = 0; i < kNumTestContexts; i++) { |
1588 // TODO(dcarney): is there a better way to do this? | 1588 // TODO(dcarney): is there a better way to do this? |
1589 i::Object** unsafe = reinterpret_cast<i::Object**>(*ctx[i]); | 1589 i::Object** unsafe = reinterpret_cast<i::Object**>(*ctx[i]); |
1590 *unsafe = CcTest::heap()->undefined_value(); | 1590 *unsafe = CcTest::heap()->undefined_value(); |
1591 ctx[i].Clear(); | 1591 ctx[i].Clear(); |
1592 | 1592 |
1593 // Scavenge treats these references as strong. | 1593 // Scavenge treats these references as strong. |
(...skipping 3536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5130 #ifdef DEBUG | 5130 #ifdef DEBUG |
5131 TEST(PathTracer) { | 5131 TEST(PathTracer) { |
5132 CcTest::InitializeVM(); | 5132 CcTest::InitializeVM(); |
5133 v8::HandleScope scope(CcTest::isolate()); | 5133 v8::HandleScope scope(CcTest::isolate()); |
5134 | 5134 |
5135 v8::Local<v8::Value> result = CompileRun("'abc'"); | 5135 v8::Local<v8::Value> result = CompileRun("'abc'"); |
5136 Handle<Object> o = v8::Utils::OpenHandle(*result); | 5136 Handle<Object> o = v8::Utils::OpenHandle(*result); |
5137 CcTest::i_isolate()->heap()->TracePathToObject(*o); | 5137 CcTest::i_isolate()->heap()->TracePathToObject(*o); |
5138 } | 5138 } |
5139 #endif // DEBUG | 5139 #endif // DEBUG |
OLD | NEW |