Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: test/cctest/test-heap.cc

Issue 823583003: Enable the embedder to specify what kind of context was disposed (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/runtime/runtime-test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698