Commit 1d73a81a authored by vogelheim's avatar vogelheim Committed by Commit bot

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}
parent 40b7d874
...@@ -1284,10 +1284,7 @@ class V8_EXPORT ScriptCompiler { ...@@ -1284,10 +1284,7 @@ class V8_EXPORT ScriptCompiler {
kProduceParserCache, kProduceParserCache,
kConsumeParserCache, kConsumeParserCache,
kProduceCodeCache, kProduceCodeCache,
kConsumeCodeCache, kConsumeCodeCache
// Support the previous API for a transition period.
kProduceDataToCache
}; };
/** /**
......
...@@ -1715,15 +1715,6 @@ MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal( ...@@ -1715,15 +1715,6 @@ MaybeLocal<UnboundScript> ScriptCompiler::CompileUnboundInternal(
PREPARE_FOR_EXECUTION_WITH_ISOLATE( PREPARE_FOR_EXECUTION_WITH_ISOLATE(
isolate, "v8::ScriptCompiler::CompileUnbound()", UnboundScript); 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. // Don't try to produce any kind of cache when the debugger is loaded.
if (isolate->debug()->is_loaded() && if (isolate->debug()->is_loaded() &&
(options == kProduceParserCache || options == kProduceCodeCache)) { (options == kProduceParserCache || options == kProduceCodeCache)) {
......
...@@ -277,7 +277,7 @@ TEST(PreparseFunctionDataIsUsed) { ...@@ -277,7 +277,7 @@ TEST(PreparseFunctionDataIsUsed) {
for (unsigned i = 0; i < arraysize(good_code); i++) { for (unsigned i = 0; i < arraysize(good_code); i++) {
v8::ScriptCompiler::Source good_source(v8_str(good_code[i])); v8::ScriptCompiler::Source good_source(v8_str(good_code[i]));
v8::ScriptCompiler::Compile(isolate, &good_source, v8::ScriptCompiler::Compile(isolate, &good_source,
v8::ScriptCompiler::kProduceDataToCache); v8::ScriptCompiler::kProduceParserCache);
const v8::ScriptCompiler::CachedData* cached_data = const v8::ScriptCompiler::CachedData* cached_data =
good_source.GetCachedData(); good_source.GetCachedData();
...@@ -291,7 +291,9 @@ TEST(PreparseFunctionDataIsUsed) { ...@@ -291,7 +291,9 @@ TEST(PreparseFunctionDataIsUsed) {
v8_str(bad_code[i]), new v8::ScriptCompiler::CachedData( v8_str(bad_code[i]), new v8::ScriptCompiler::CachedData(
cached_data->data, cached_data->length)); cached_data->data, cached_data->length));
v8::Local<v8::Value> result = 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(result->IsInt32());
CHECK_EQ(25, result->Int32Value()); CHECK_EQ(25, result->Int32Value());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment