From 1d73a81ae0341a0d9c8d78c3fcf67bc2827d75d0 Mon Sep 17 00:00:00 2001 From: vogelheim Date: Thu, 25 Jun 2015 07:03:41 -0700 Subject: [PATCH] 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} --- include/v8.h | 5 +---- src/api.cc | 9 --------- test/cctest/test-parsing.cc | 6 ++++-- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/include/v8.h b/include/v8.h index e16c2b372f..ab188535fb 100644 --- a/include/v8.h +++ b/include/v8.h @@ -1284,10 +1284,7 @@ class V8_EXPORT ScriptCompiler { kProduceParserCache, kConsumeParserCache, kProduceCodeCache, - kConsumeCodeCache, - - // Support the previous API for a transition period. - kProduceDataToCache + kConsumeCodeCache }; /** diff --git a/src/api.cc b/src/api.cc index 3b2c9909bb..0dbebc14e5 100644 --- a/src/api.cc +++ b/src/api.cc @@ -1715,15 +1715,6 @@ MaybeLocal 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)) { diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc index 1aa520183d..daefa7a5c3 100644 --- a/test/cctest/test-parsing.cc +++ b/test/cctest/test-parsing.cc @@ -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 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()); }