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

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

Issue 184923002: Clear optimized code cache in shared function info when code gets deoptimized (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix assert Created 6 years, 9 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
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 3018 matching lines...) Expand 10 before | Expand all | Expand 10 after
3029 CompileRun(accessor); 3029 CompileRun(accessor);
3030 CcTest::heap()->CollectAllAvailableGarbage(); 3030 CcTest::heap()->CollectAllAvailableGarbage();
3031 3031
3032 // External source has been released. 3032 // External source has been released.
3033 CHECK(resource->IsDisposed()); 3033 CHECK(resource->IsDisposed());
3034 delete resource; 3034 delete resource;
3035 } 3035 }
3036 3036
3037 3037
3038 TEST(ReleaseStackTraceData) { 3038 TEST(ReleaseStackTraceData) {
3039 if (i::FLAG_always_opt) {
3040 // TODO(ulan): Remove this once the memory leak via code_next_link is fixed.
3041 // See: https://codereview.chromium.org/181833004/
3042 return;
3043 }
3039 FLAG_use_ic = false; // ICs retain objects. 3044 FLAG_use_ic = false; // ICs retain objects.
3040 FLAG_concurrent_recompilation = false; 3045 FLAG_concurrent_recompilation = false;
3041 CcTest::InitializeVM(); 3046 CcTest::InitializeVM();
3042 static const char* source1 = "var error = null; " 3047 static const char* source1 = "var error = null; "
3043 /* Normal Error */ "try { " 3048 /* Normal Error */ "try { "
3044 " throw new Error(); " 3049 " throw new Error(); "
3045 "} catch (e) { " 3050 "} catch (e) { "
3046 " error = e; " 3051 " error = e; "
3047 "} "; 3052 "} ";
3048 static const char* source2 = "var error = null; " 3053 static const char* source2 = "var error = null; "
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
3681 code = scope.CloseAndEscape(Handle<Code>(bar->code())); 3686 code = scope.CloseAndEscape(Handle<Code>(bar->code()));
3682 } 3687 }
3683 3688
3684 // Now make sure that a gc should get rid of the function 3689 // Now make sure that a gc should get rid of the function
3685 for (int i = 0; i < 4; i++) { 3690 for (int i = 0; i < 4; i++) {
3686 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask); 3691 heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
3687 } 3692 }
3688 3693
3689 ASSERT(code->marked_for_deoptimization()); 3694 ASSERT(code->marked_for_deoptimization());
3690 } 3695 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698