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

Unified Diff: runtime/vm/isolate_reload_test.cc

Issue 2253733002: Fix handle sharing bug in implementation of shape changes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 | « runtime/vm/isolate_reload.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate_reload_test.cc
diff --git a/runtime/vm/isolate_reload_test.cc b/runtime/vm/isolate_reload_test.cc
index 57455b47754a0c8df641cb46542f2de10d3c6ebc..018ed1ce390802e2748200bf86f09c36f916b75d 100644
--- a/runtime/vm/isolate_reload_test.cc
+++ b/runtime/vm/isolate_reload_test.cc
@@ -2776,6 +2776,46 @@ TEST_CASE(IsolateReload_ChangeInstanceFormat7) {
EXPECT_VALID(lib);
}
+
+// Regression for handle sharing bug: Change the shape of two classes and see
+// that their instances don't change class.
+TEST_CASE(IsolateReload_ChangeInstanceFormat8) {
+ const char* kScript =
+ "class A{\n"
+ " var x;\n"
+ "}\n"
+ "class B {\n"
+ " var x, y, z, w;\n"
+ "}\n"
+ "var a, b;\n"
+ "main() {\n"
+ " a = new A();\n"
+ " b = new B();\n"
+ " return '$a $b';\n"
+ "}\n";
+
+ Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+ EXPECT_VALID(lib);
+ EXPECT_STREQ("Instance of 'A' Instance of 'B'", SimpleInvokeStr(lib, "main"));
+
+ const char* kReloadScript =
+ "class A{\n"
+ " var x, y;\n"
+ "}\n"
+ "class B {\n"
+ " var x, y, z, w, v;\n"
+ "}\n"
+ "var a, b;\n"
+ "main() {\n"
+ " return '$a $b';\n"
+ "}\n";
+
+ lib = TestCase::ReloadTestScript(kReloadScript);
+ EXPECT_VALID(lib);
+ EXPECT_STREQ("Instance of 'A' Instance of 'B'", SimpleInvokeStr(lib, "main"));
+}
+
+
static bool NothingModifiedCallback(const char* url, int64_t since) {
return false;
}
« no previous file with comments | « runtime/vm/isolate_reload.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698