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

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

Issue 1028483003: Version 4.2.77.10 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.2
Patch Set: 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/compiler.cc ('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 9a348ad434d8fac5a7b02e20071ae86b2a674585..55eac60f37a27b27d9e923d2820f6dc2bf149352 100644
--- a/test/cctest/test-serialize.cc
+++ b/test/cctest/test-serialize.cc
@@ -793,6 +793,37 @@ TEST(SerializeToplevelOnePlusOne) {
}
+TEST(CodeCachePromotedToCompilationCache) {
+ FLAG_serialize_toplevel = true;
+ LocalContext context;
+ Isolate* isolate = CcTest::i_isolate();
+
+ v8::HandleScope scope(CcTest::isolate());
+
+ const char* source = "1 + 1";
+
+ Handle<String> src = isolate->factory()
+ ->NewStringFromUtf8(CStrVector(source))
+ .ToHandleChecked();
+ ScriptData* cache = NULL;
+
+ CompileScript(isolate, src, src, &cache,
+ v8::ScriptCompiler::kProduceCodeCache);
+
+ DisallowCompilation no_compile_expected(isolate);
+ Handle<SharedFunctionInfo> copy = CompileScript(
+ isolate, src, src, &cache, v8::ScriptCompiler::kConsumeCodeCache);
+
+ CHECK(isolate->compilation_cache()
+ ->LookupScript(src, src, 0, 0, false, false,
+ isolate->native_context(), SLOPPY)
+ .ToHandleChecked()
+ .is_identical_to(copy));
+
+ delete cache;
+}
+
+
TEST(SerializeToplevelInternalizedString) {
FLAG_serialize_toplevel = true;
LocalContext context;
« no previous file with comments | « src/compiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698