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

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

Issue 389573006: Change ScriptCompiler::CompileOptions and add d8 --cache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 8656bee4391a2e92ec7efb460f6eafb77801071e..e27282cdea572b1846fc48c01df7816a5f2517f4 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -219,15 +219,17 @@ TEST(UsingCachedData) {
isolate, new ScriptResource(source, source_length)));
i::FLAG_min_preparse_length = 0;
v8::ScriptCompiler::Compile(isolate, &script_source,
- v8::ScriptCompiler::kProduceDataToCache);
+ v8::ScriptCompiler::kProduceParserCache);
CHECK(script_source.GetCachedData());
// Compile the script again, using the cached data.
bool lazy_flag = i::FLAG_lazy;
i::FLAG_lazy = true;
- v8::ScriptCompiler::Compile(isolate, &script_source);
+ v8::ScriptCompiler::Compile(isolate, &script_source,
+ v8::ScriptCompiler::kConsumeParserCache);
i::FLAG_lazy = false;
- v8::ScriptCompiler::CompileUnbound(isolate, &script_source);
+ v8::ScriptCompiler::CompileUnbound(isolate, &script_source,
+ v8::ScriptCompiler::kConsumeParserCache);
i::FLAG_lazy = lazy_flag;
}
@@ -255,7 +257,7 @@ TEST(PreparseFunctionDataIsUsed) {
v8::ScriptCompiler::Source good_source(v8_str(good_code));
v8::ScriptCompiler::Compile(isolate, &good_source,
- v8::ScriptCompiler::kProduceDataToCache);
+ v8::ScriptCompiler::kProduceParserCache);
const v8::ScriptCompiler::CachedData* cached_data =
good_source.GetCachedData();
@@ -268,7 +270,8 @@ TEST(PreparseFunctionDataIsUsed) {
v8_str(bad_code), new v8::ScriptCompiler::CachedData(
cached_data->data, cached_data->length));
v8::Local<v8::Value> result =
- v8::ScriptCompiler::Compile(isolate, &bad_source)->Run();
+ v8::ScriptCompiler::Compile(
+ isolate, &bad_source, v8::ScriptCompiler::kConsumeParserCache)->Run();
CHECK(result->IsInt32());
CHECK_EQ(25, result->Int32Value());
}
@@ -353,7 +356,7 @@ TEST(PreparsingObjectLiterals) {
{
const char* source = "var myo = {if: \"foo\"}; myo.if;";
- v8::Local<v8::Value> result = PreCompileCompileRun(source);
+ v8::Local<v8::Value> result = ParserCacheCompileRun(source);
CHECK(result->IsString());
v8::String::Utf8Value utf8(result);
CHECK_EQ("foo", *utf8);
@@ -361,7 +364,7 @@ TEST(PreparsingObjectLiterals) {
{
const char* source = "var myo = {\"bar\": \"foo\"}; myo[\"bar\"];";
- v8::Local<v8::Value> result = PreCompileCompileRun(source);
+ v8::Local<v8::Value> result = ParserCacheCompileRun(source);
CHECK(result->IsString());
v8::String::Utf8Value utf8(result);
CHECK_EQ("foo", *utf8);
@@ -369,7 +372,7 @@ TEST(PreparsingObjectLiterals) {
{
const char* source = "var myo = {1: \"foo\"}; myo[1];";
- v8::Local<v8::Value> result = PreCompileCompileRun(source);
+ v8::Local<v8::Value> result = ParserCacheCompileRun(source);
CHECK(result->IsString());
v8::String::Utf8Value utf8(result);
CHECK_EQ("foo", *utf8);
@@ -2186,7 +2189,7 @@ TEST(DontRegressPreParserDataSizes) {
i::Handle<i::Script> script = factory->NewScript(source);
i::CompilationInfoWithZone info(script);
i::ScriptData* sd = NULL;
- info.SetCachedData(&sd, i::PRODUCE_CACHED_DATA);
+ info.SetCachedData(&sd, v8::ScriptCompiler::kProduceParserCache);
i::Parser::Parse(&info, true);
i::ParseData pd(sd);

Powered by Google App Engine
This is Rietveld 408576698