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

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

Issue 1005183006: Serializer: serialize internal references via object visitor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix compilation Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/assembler-x64-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-serialize.cc
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc
index b124974e0c3a113acc92435095a3251bef50e23c..9fadddf4c27a199564430b786307cc4f4a3aee77 100644
--- a/test/cctest/test-serialize.cc
+++ b/test/cctest/test-serialize.cc
@@ -1484,6 +1484,9 @@ TEST(SerializeWithHarmonyScoping) {
TEST(SerializeInternalReference) {
+#ifdef V8_TARGET_ARCH_ARM64
+ return;
+#endif // V8_TARGET_ARCH_ARM64
// Disable experimental natives that are loaded after deserialization.
FLAG_turbo_deoptimization = false;
FLAG_context_specialization = false;
@@ -1502,10 +1505,10 @@ TEST(SerializeInternalReference) {
" case 2:"
" case 3: j = 2; break;"
" case 4:"
- " case 5: j = 3; break;"
+ " case 5: j = foo(3) + 1; break;"
" default: j = 0; break;"
" }"
- " return j|0;"
+ " return j + 10;"
" }"
" return { foo: foo };"
"})(this, {}, undefined).foo;"
@@ -1525,8 +1528,24 @@ TEST(SerializeInternalReference) {
v8::Context::Scope c_scope(context);
v8::Handle<v8::Function> foo =
v8::Handle<v8::Function>::Cast(CompileRun("foo"));
+
+ // There are at least 6 internal references.
+ int mask = RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE) |
+ RelocInfo::ModeMask(RelocInfo::INTERNAL_REFERENCE_ENCODED);
+ RelocIterator it(v8::Utils::OpenHandle(*foo)->code(), mask);
+ for (int i = 0; i < 6; ++i) {
+ CHECK(!it.done());
+ it.next();
+ }
+
CHECK(v8::Utils::OpenHandle(*foo)->code()->is_turbofanned());
- CHECK_EQ(3, CompileRun("foo(4)")->ToInt32(isolate)->Int32Value());
+ CHECK_EQ(11, CompileRun("foo(0)")->ToInt32(isolate)->Int32Value());
+ CHECK_EQ(11, CompileRun("foo(1)")->ToInt32(isolate)->Int32Value());
+ CHECK_EQ(12, CompileRun("foo(2)")->ToInt32(isolate)->Int32Value());
+ CHECK_EQ(12, CompileRun("foo(3)")->ToInt32(isolate)->Int32Value());
+ CHECK_EQ(23, CompileRun("foo(4)")->ToInt32(isolate)->Int32Value());
+ CHECK_EQ(23, CompileRun("foo(5)")->ToInt32(isolate)->Int32Value());
+ CHECK_EQ(10, CompileRun("foo(6)")->ToInt32(isolate)->Int32Value());
}
isolate->Dispose();
}
« no previous file with comments | « src/x64/assembler-x64-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698