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

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

Issue 2065453002: [module] Track script "module code" status Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use idiomatic variable names Created 4 years, 5 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/parsing/parser.cc ('k') | test/cctest/test-api.cc » ('j') | 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 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
1624 1624
1625 { 1625 {
1626 v8::HandleScope scope(CcTest::isolate()); 1626 v8::HandleScope scope(CcTest::isolate());
1627 CompileRun(raw_source); 1627 CompileRun(raw_source);
1628 } 1628 }
1629 1629
1630 // The script should be in the cache now. 1630 // The script should be in the cache now.
1631 MaybeHandle<SharedFunctionInfo> info = compilation_cache->LookupScript( 1631 MaybeHandle<SharedFunctionInfo> info = compilation_cache->LookupScript(
1632 source, Handle<Object>(), 0, 0, 1632 source, Handle<Object>(), 0, 0,
1633 v8::ScriptOriginOptions(false, true, false), native_context, 1633 v8::ScriptOriginOptions(false, true, false), native_context,
1634 language_mode); 1634 language_mode, false);
1635 CHECK(!info.is_null()); 1635 CHECK(!info.is_null());
1636 1636
1637 // Check that the code cache entry survives at least on GC. 1637 // Check that the code cache entry survives at least on GC.
1638 // (Unless --optimize-for-size, in which case it might get collected 1638 // (Unless --optimize-for-size, in which case it might get collected
1639 // immediately.) 1639 // immediately.)
1640 if (!FLAG_optimize_for_size) { 1640 if (!FLAG_optimize_for_size) {
1641 heap->CollectAllGarbage(); 1641 heap->CollectAllGarbage();
1642 info = compilation_cache->LookupScript( 1642 info = compilation_cache->LookupScript(
1643 source, Handle<Object>(), 0, 0, 1643 source, Handle<Object>(), 0, 0,
1644 v8::ScriptOriginOptions(false, true, false), native_context, 1644 v8::ScriptOriginOptions(false, true, false), native_context,
1645 language_mode); 1645 language_mode, false);
1646 CHECK(!info.is_null()); 1646 CHECK(!info.is_null());
1647 } 1647 }
1648 1648
1649 // Progress code age until it's old and ready for GC. 1649 // Progress code age until it's old and ready for GC.
1650 while (!info.ToHandleChecked()->code()->IsOld()) { 1650 while (!info.ToHandleChecked()->code()->IsOld()) {
1651 // To guarantee progress, we have to MakeOlder with different parities. 1651 // To guarantee progress, we have to MakeOlder with different parities.
1652 // We can't just use NO_MARKING_PARITY, since e.g. kExecutedOnceCodeAge is 1652 // We can't just use NO_MARKING_PARITY, since e.g. kExecutedOnceCodeAge is
1653 // always NO_MARKING_PARITY and the code age only progresses if the parity 1653 // always NO_MARKING_PARITY and the code age only progresses if the parity
1654 // is different. 1654 // is different.
1655 info.ToHandleChecked()->code()->MakeOlder(ODD_MARKING_PARITY); 1655 info.ToHandleChecked()->code()->MakeOlder(ODD_MARKING_PARITY);
1656 info.ToHandleChecked()->code()->MakeOlder(EVEN_MARKING_PARITY); 1656 info.ToHandleChecked()->code()->MakeOlder(EVEN_MARKING_PARITY);
1657 } 1657 }
1658 1658
1659 heap->CollectAllGarbage(); 1659 heap->CollectAllGarbage();
1660 // Ensure code aging cleared the entry from the cache. 1660 // Ensure code aging cleared the entry from the cache.
1661 info = compilation_cache->LookupScript( 1661 info = compilation_cache->LookupScript(
1662 source, Handle<Object>(), 0, 0, 1662 source, Handle<Object>(), 0, 0,
1663 v8::ScriptOriginOptions(false, true, false), native_context, 1663 v8::ScriptOriginOptions(false, true, false), native_context,
1664 language_mode); 1664 language_mode, false);
1665 CHECK(info.is_null()); 1665 CHECK(info.is_null());
1666 } 1666 }
1667 1667
1668 1668
1669 static void OptimizeEmptyFunction(const char* name) { 1669 static void OptimizeEmptyFunction(const char* name) {
1670 HandleScope scope(CcTest::i_isolate()); 1670 HandleScope scope(CcTest::i_isolate());
1671 EmbeddedVector<char, 256> source; 1671 EmbeddedVector<char, 256> source;
1672 SNPrintF(source, 1672 SNPrintF(source,
1673 "function %s() { return 0; }" 1673 "function %s() { return 0; }"
1674 "%s(); %s();" 1674 "%s(); %s();"
(...skipping 5196 matching lines...) Expand 10 before | Expand all | Expand 10 after
6871 chunk, chunk->area_end() - kPointerSize, chunk->area_end()); 6871 chunk, chunk->area_end() - kPointerSize, chunk->area_end());
6872 slots[chunk->area_end() - kPointerSize] = false; 6872 slots[chunk->area_end() - kPointerSize] = false;
6873 RememberedSet<OLD_TO_NEW>::Iterate(chunk, [&slots](Address addr) { 6873 RememberedSet<OLD_TO_NEW>::Iterate(chunk, [&slots](Address addr) {
6874 CHECK(slots[addr]); 6874 CHECK(slots[addr]);
6875 return KEEP_SLOT; 6875 return KEEP_SLOT;
6876 }); 6876 });
6877 } 6877 }
6878 6878
6879 } // namespace internal 6879 } // namespace internal
6880 } // namespace v8 6880 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698