Remove obsolete options in ScriptCompiler::CompileOptions.

This is a follow-on to https://code.google.com/p/v8/source/detail?r=22431
This will remove the compatibility logic, so that the API as described
in r22431 is the only API.

I'll let this CL will sit around for a while to give embedders a chance
to update their code.

R=yangguo@chromium.org, ulan@chromium.org
BUG=chromium:399580
LOG=Y

Review URL: https://codereview.chromium.org/392263002

Cr-Commit-Position: refs/heads/master@{#29294}
This commit is contained in:
vogelheim 2015-06-25 07:03:41 -07:00 committed by Commit bot
parent 40b7d874b2
commit 1d73a81ae0
3 changed files with 5 additions and 15 deletions

View File

@ -1284,10 +1284,7 @@ class V8_EXPORT ScriptCompiler {
kProduceParserCache,
kConsumeParserCache,
kProduceCodeCache,
kConsumeCodeCache,
// Support the previous API for a transition period.
kProduceDataToCache
kConsumeCodeCache
};
/**

View File

@ -1715,15 +1715,6 @@ MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal(
PREPARE_FOR_EXECUTION_WITH_ISOLATE(
isolate, "v8::ScriptCompiler::CompileUnbound()", UnboundScript);
// Support the old API for a transition period:
// - kProduceToCache -> kProduceParserCache
// - kNoCompileOptions + cached_data != NULL -> kConsumeParserCache
if (options == kProduceDataToCache) {
options = kProduceParserCache;
} else if (options == kNoCompileOptions && source->cached_data) {
options = kConsumeParserCache;
}
// Don't try to produce any kind of cache when the debugger is loaded.
if (isolate->debug()->is_loaded() &&
(options == kProduceParserCache || options == kProduceCodeCache)) {

View File

@ -277,7 +277,7 @@ TEST(PreparseFunctionDataIsUsed) {
for (unsigned i = 0; i < arraysize(good_code); i++) {
v8::ScriptCompiler::Source good_source(v8_str(good_code[i]));
v8::ScriptCompiler::Compile(isolate, &good_source,
v8::ScriptCompiler::kProduceDataToCache);
v8::ScriptCompiler::kProduceParserCache);
const v8::ScriptCompiler::CachedData* cached_data =
good_source.GetCachedData();
@ -291,7 +291,9 @@ TEST(PreparseFunctionDataIsUsed) {
v8_str(bad_code[i]), 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());
}