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

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: 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 | « test/cctest/test-debug.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index bf5362c25a3daeff84dd91c54d6d6d8c3cfeb39e..32a545d7a9179e7869f2edba80a47cac95af6410 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());
}
@@ -355,7 +358,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);
@@ -363,7 +366,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);
@@ -371,7 +374,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);
@@ -2251,7 +2254,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);
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/cctest/test-serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698