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

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

Issue 23519010: cleanup cctest generally and remove ctest::context (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: arm fix Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-compiler.cc ('k') | test/cctest/test-log-stack-tracer.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 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after
2889 }; 2889 };
2890 2890
2891 2891
2892 void ReleaseStackTraceDataTest(const char* source, const char* accessor) { 2892 void ReleaseStackTraceDataTest(const char* source, const char* accessor) {
2893 // Test that the data retained by the Error.stack accessor is released 2893 // Test that the data retained by the Error.stack accessor is released
2894 // after the first time the accessor is fired. We use external string 2894 // after the first time the accessor is fired. We use external string
2895 // to check whether the data is being released since the external string 2895 // to check whether the data is being released since the external string
2896 // resource's callback is fired when the external string is GC'ed. 2896 // resource's callback is fired when the external string is GC'ed.
2897 FLAG_use_ic = false; // ICs retain objects. 2897 FLAG_use_ic = false; // ICs retain objects.
2898 FLAG_concurrent_recompilation = false; 2898 FLAG_concurrent_recompilation = false;
2899 CcTest::InitializeVM();
2900 v8::HandleScope scope(CcTest::isolate()); 2899 v8::HandleScope scope(CcTest::isolate());
2901 SourceResource* resource = new SourceResource(i::StrDup(source)); 2900 SourceResource* resource = new SourceResource(i::StrDup(source));
2902 { 2901 {
2903 v8::HandleScope scope(CcTest::isolate()); 2902 v8::HandleScope scope(CcTest::isolate());
2904 v8::Handle<v8::String> source_string = v8::String::NewExternal(resource); 2903 v8::Handle<v8::String> source_string = v8::String::NewExternal(resource);
2905 CcTest::heap()->CollectAllAvailableGarbage(); 2904 CcTest::heap()->CollectAllAvailableGarbage();
2906 v8::Script::Compile(source_string)->Run(); 2905 v8::Script::Compile(source_string)->Run();
2907 CHECK(!resource->IsDisposed()); 2906 CHECK(!resource->IsDisposed());
2908 } 2907 }
2909 // CcTest::heap()->CollectAllAvailableGarbage(); 2908 // CcTest::heap()->CollectAllAvailableGarbage();
2910 CHECK(!resource->IsDisposed()); 2909 CHECK(!resource->IsDisposed());
2911 2910
2912 CompileRun(accessor); 2911 CompileRun(accessor);
2913 CcTest::heap()->CollectAllAvailableGarbage(); 2912 CcTest::heap()->CollectAllAvailableGarbage();
2914 2913
2915 // External source has been released. 2914 // External source has been released.
2916 CHECK(resource->IsDisposed()); 2915 CHECK(resource->IsDisposed());
2917 delete resource; 2916 delete resource;
2918 } 2917 }
2919 2918
2920 2919
2921 TEST(ReleaseStackTraceData) { 2920 TEST(ReleaseStackTraceData) {
2921 CcTest::InitializeVM();
2922 static const char* source1 = "var error = null; " 2922 static const char* source1 = "var error = null; "
2923 /* Normal Error */ "try { " 2923 /* Normal Error */ "try { "
2924 " throw new Error(); " 2924 " throw new Error(); "
2925 "} catch (e) { " 2925 "} catch (e) { "
2926 " error = e; " 2926 " error = e; "
2927 "} "; 2927 "} ";
2928 static const char* source2 = "var error = null; " 2928 static const char* source2 = "var error = null; "
2929 /* Stack overflow */ "try { " 2929 /* Stack overflow */ "try { "
2930 " (function f() { f(); })(); " 2930 " (function f() { f(); })(); "
2931 "} catch (e) { " 2931 "} catch (e) { "
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
3440 " var a = new Array(n);" 3440 " var a = new Array(n);"
3441 " for (var i = 0; i < n; i += 100) a[i] = i;" 3441 " for (var i = 0; i < n; i += 100) a[i] = i;"
3442 "};" 3442 "};"
3443 "f(10 * 1024 * 1024);"); 3443 "f(10 * 1024 * 1024);");
3444 IncrementalMarking* marking = CcTest::heap()->incremental_marking(); 3444 IncrementalMarking* marking = CcTest::heap()->incremental_marking();
3445 if (marking->IsStopped()) marking->Start(); 3445 if (marking->IsStopped()) marking->Start();
3446 // This big step should be sufficient to mark the whole array. 3446 // This big step should be sufficient to mark the whole array.
3447 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD); 3447 marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD);
3448 ASSERT(marking->IsComplete()); 3448 ASSERT(marking->IsComplete());
3449 } 3449 }
OLDNEW
« no previous file with comments | « test/cctest/test-compiler.cc ('k') | test/cctest/test-log-stack-tracer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698