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

Unified Diff: test/cctest/cctest.h

Issue 389573006: Change ScriptCompiler::CompileOptions and add d8 --cache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: even more rebase Created 6 years, 5 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/parser.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/cctest.h
diff --git a/test/cctest/cctest.h b/test/cctest/cctest.h
index e1676e5e6fd0c0d0366e657d04095f7a4f15d405..fc6ec398fd03a1464a9cb1e618b67612a17b72ff 100644
--- a/test/cctest/cctest.h
+++ b/test/cctest/cctest.h
@@ -371,14 +371,20 @@ static inline v8::Local<v8::Value> CompileRun(v8::Local<v8::String> source) {
}
-static inline v8::Local<v8::Value> PreCompileCompileRun(const char* source) {
+static inline v8::Local<v8::Value> ParserCacheCompileRun(const char* source) {
// Compile once just to get the preparse data, then compile the second time
// using the data.
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::ScriptCompiler::Source script_source(v8_str(source));
v8::ScriptCompiler::Compile(isolate, &script_source,
- v8::ScriptCompiler::kProduceDataToCache);
- return v8::ScriptCompiler::Compile(isolate, &script_source)->Run();
+ v8::ScriptCompiler::kProduceParserCache);
+
+ // Check whether we received cached data, and if so use it.
+ v8::ScriptCompiler::CompileOptions options =
+ script_source.GetCachedData() ? v8::ScriptCompiler::kConsumeParserCache
+ : v8::ScriptCompiler::kNoCompileOptions;
+
+ return v8::ScriptCompiler::Compile(isolate, &script_source, options)->Run();
}
« no previous file with comments | « src/parser.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698