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

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

Issue 882633002: Reland "Only use FreeSpace objects in the free list" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix windows build Created 5 years, 10 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 | « test/cctest/cctest.h ('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 3854 matching lines...) Expand 10 before | Expand all | Expand 10 after
3865 #endif 3865 #endif
3866 CompileRun("%OptimizeFunctionOnNextCall(g);" 3866 CompileRun("%OptimizeFunctionOnNextCall(g);"
3867 "g(false);"); 3867 "g(false);");
3868 3868
3869 // Finish garbage collection cycle. 3869 // Finish garbage collection cycle.
3870 heap->CollectAllGarbage(Heap::kNoGCFlags); 3870 heap->CollectAllGarbage(Heap::kNoGCFlags);
3871 CHECK(shared1->code()->gc_metadata() == NULL); 3871 CHECK(shared1->code()->gc_metadata() == NULL);
3872 } 3872 }
3873 3873
3874 3874
3875 // Helper function that simulates a fill new-space in the heap.
3876 static inline void AllocateAllButNBytes(v8::internal::NewSpace* space,
3877 int extra_bytes) {
3878 int space_remaining = static_cast<int>(
3879 *space->allocation_limit_address() - *space->allocation_top_address());
3880 CHECK(space_remaining >= extra_bytes);
3881 int new_linear_size = space_remaining - extra_bytes;
3882 v8::internal::AllocationResult allocation =
3883 space->AllocateRaw(new_linear_size);
3884 v8::internal::FreeListNode* node =
3885 v8::internal::FreeListNode::cast(allocation.ToObjectChecked());
3886 node->set_size(space->heap(), new_linear_size);
3887 }
3888
3889
3890 TEST(Regress169928) { 3875 TEST(Regress169928) {
3891 i::FLAG_allow_natives_syntax = true; 3876 i::FLAG_allow_natives_syntax = true;
3892 i::FLAG_crankshaft = false; 3877 i::FLAG_crankshaft = false;
3893 CcTest::InitializeVM(); 3878 CcTest::InitializeVM();
3894 Isolate* isolate = CcTest::i_isolate(); 3879 Isolate* isolate = CcTest::i_isolate();
3895 Factory* factory = isolate->factory(); 3880 Factory* factory = isolate->factory();
3896 v8::HandleScope scope(CcTest::isolate()); 3881 v8::HandleScope scope(CcTest::isolate());
3897 3882
3898 // Some flags turn Scavenge collections into Mark-sweep collections 3883 // Some flags turn Scavenge collections into Mark-sweep collections
3899 // and hence are incompatible with this test case. 3884 // and hence are incompatible with this test case.
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
5103 #ifdef DEBUG 5088 #ifdef DEBUG
5104 TEST(PathTracer) { 5089 TEST(PathTracer) {
5105 CcTest::InitializeVM(); 5090 CcTest::InitializeVM();
5106 v8::HandleScope scope(CcTest::isolate()); 5091 v8::HandleScope scope(CcTest::isolate());
5107 5092
5108 v8::Local<v8::Value> result = CompileRun("'abc'"); 5093 v8::Local<v8::Value> result = CompileRun("'abc'");
5109 Handle<Object> o = v8::Utils::OpenHandle(*result); 5094 Handle<Object> o = v8::Utils::OpenHandle(*result);
5110 CcTest::i_isolate()->heap()->TracePathToObject(*o); 5095 CcTest::i_isolate()->heap()->TracePathToObject(*o);
5111 } 5096 }
5112 #endif // DEBUG 5097 #endif // DEBUG
OLDNEW
« no previous file with comments | « test/cctest/cctest.h ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698