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

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

Issue 1008363002: Promote code from code cache to compilation cache. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: improve test case slightly 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 8511b740859197f9bb97f5930562db4cc97436b7..71e5d82181d59183a4e53283b19977a2fddf61b3 100644
--- a/test/cctest/test-serialize.cc
+++ b/test/cctest/test-serialize.cc
@@ -819,6 +819,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