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

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

Issue 2100073002: [snapshot] revisit snapshot API. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/snapshot/snapshot-common.cc ('k') | test/cctest/test-serialize.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 4811 matching lines...) Expand 10 before | Expand all | Expand 10 after
4822 if (i::FLAG_always_opt || !i::FLAG_crankshaft) return; 4822 if (i::FLAG_always_opt || !i::FLAG_crankshaft) return;
4823 if (!i::FLAG_incremental_marking) return; 4823 if (!i::FLAG_incremental_marking) return;
4824 i::FLAG_weak_embedded_objects_in_optimized_code = true; 4824 i::FLAG_weak_embedded_objects_in_optimized_code = true;
4825 i::FLAG_allow_natives_syntax = true; 4825 i::FLAG_allow_natives_syntax = true;
4826 i::FLAG_compilation_cache = false; 4826 i::FLAG_compilation_cache = false;
4827 i::FLAG_retain_maps_for_n_gc = 0; 4827 i::FLAG_retain_maps_for_n_gc = 0;
4828 CcTest::InitializeVM(); 4828 CcTest::InitializeVM();
4829 Isolate* isolate = CcTest::i_isolate(); 4829 Isolate* isolate = CcTest::i_isolate();
4830 4830
4831 // Do not run for no-snap builds. 4831 // Do not run for no-snap builds.
4832 if (!i::Snapshot::HaveASnapshotToStartFrom(isolate)) return; 4832 if (!i::Snapshot::HasContextSnapshot(isolate, 0)) return;
4833 4833
4834 v8::internal::Heap* heap = CcTest::heap(); 4834 v8::internal::Heap* heap = CcTest::heap();
4835 4835
4836 // Get a clean slate regarding optimized functions on the heap. 4836 // Get a clean slate regarding optimized functions on the heap.
4837 i::Deoptimizer::DeoptimizeAll(isolate); 4837 i::Deoptimizer::DeoptimizeAll(isolate);
4838 heap->CollectAllGarbage(); 4838 heap->CollectAllGarbage();
4839 4839
4840 if (!isolate->use_crankshaft()) return; 4840 if (!isolate->use_crankshaft()) return;
4841 HandleScope outer_scope(heap->isolate()); 4841 HandleScope outer_scope(heap->isolate());
4842 for (int i = 0; i < 3; i++) { 4842 for (int i = 0; i < 3; i++) {
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
5961 5961
5962 5962
5963 TEST(BootstrappingExports) { 5963 TEST(BootstrappingExports) {
5964 // Expose utils object and delete it to observe that it is indeed 5964 // Expose utils object and delete it to observe that it is indeed
5965 // being garbage-collected. 5965 // being garbage-collected.
5966 FLAG_expose_natives_as = "utils"; 5966 FLAG_expose_natives_as = "utils";
5967 CcTest::InitializeVM(); 5967 CcTest::InitializeVM();
5968 v8::Isolate* isolate = CcTest::isolate(); 5968 v8::Isolate* isolate = CcTest::isolate();
5969 LocalContext env; 5969 LocalContext env;
5970 5970
5971 if (Snapshot::HaveASnapshotToStartFrom(CcTest::i_isolate())) return; 5971 if (Snapshot::HasContextSnapshot(CcTest::i_isolate(), 0)) return;
5972 5972
5973 utils_has_been_collected = false; 5973 utils_has_been_collected = false;
5974 5974
5975 v8::Persistent<v8::Object> utils; 5975 v8::Persistent<v8::Object> utils;
5976 5976
5977 { 5977 {
5978 v8::HandleScope scope(isolate); 5978 v8::HandleScope scope(isolate);
5979 v8::Local<v8::String> name = v8_str("utils"); 5979 v8::Local<v8::String> name = v8_str("utils");
5980 utils.Reset(isolate, CcTest::global() 5980 utils.Reset(isolate, CcTest::global()
5981 ->Get(env.local(), name) 5981 ->Get(env.local(), name)
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
6725 int mark_sweeps_performed = mark_sweep_count_after - mark_sweep_count_before; 6725 int mark_sweeps_performed = mark_sweep_count_after - mark_sweep_count_before;
6726 // The memory pressuer handler either performed two GCs or performed one and 6726 // The memory pressuer handler either performed two GCs or performed one and
6727 // started incremental marking. 6727 // started incremental marking.
6728 CHECK(mark_sweeps_performed == 2 || 6728 CHECK(mark_sweeps_performed == 2 ||
6729 (mark_sweeps_performed == 1 && 6729 (mark_sweeps_performed == 1 &&
6730 !heap->incremental_marking()->IsStopped())); 6730 !heap->incremental_marking()->IsStopped()));
6731 } 6731 }
6732 6732
6733 } // namespace internal 6733 } // namespace internal
6734 } // namespace v8 6734 } // namespace v8
OLDNEW
« no previous file with comments | « src/snapshot/snapshot-common.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698