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

Unified Diff: test/cctest/heap/test-heap.cc

Issue 1904093002: [interpreter] Heal closures when bytecode array is gone. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Ported to most architectures. Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/test-heap.cc
diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
index 2fc3653af6ee75d433098b0086629b0ede321f11..290ecdd6005e477f61c917601c924eddf8473dcd 100644
--- a/test/cctest/heap/test-heap.cc
+++ b/test/cctest/heap/test-heap.cc
@@ -6275,6 +6275,28 @@ TEST(CanonicalSharedFunctionInfo) {
"check(g1, g2);");
}
+TEST(RemoveCodeFromSharedFunctionInfoButNotFromClosure) {
+ CcTest::InitializeVM();
+ v8::Isolate* isolate = CcTest::isolate();
+ v8::HandleScope scope(isolate);
+ v8::Local<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate);
+ global->Set(isolate, "check", v8::FunctionTemplate::New(
+ isolate, CheckEqualSharedFunctionInfos));
+ global->Set(isolate, "remove",
+ v8::FunctionTemplate::New(isolate, RemoveCodeAndGC));
+ v8::Local<v8::Context> context = v8::Context::New(isolate, NULL, global);
+ v8::Context::Scope cscope(context);
+ CompileRun(
+ "function f() { return function g() {}; }"
+ "var g1 = f();"
+ "var g2 = f();"
+ "check(g1, g2);"
+ "g1();"
+ "g2();"
+ "remove(g1);"
+ "g2();"
+ "check(g1, g2);");
+}
TEST(OldGenerationAllocationThroughput) {
CcTest::InitializeVM();
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698