Skip to content

Commit

Permalink
v8: Remove obsolete V8 extras flag
Browse files Browse the repository at this point in the history
Bug: chromium:920347
Tbr: avi@chromium.org,rdevlin.cronin@chromium.org,mmenke@chromium.org,thestig@chromium.org
Change-Id: I6334a195d4804e07563c9a61fe771e005234b134
Reviewed-on: https://chromium-review.googlesource.com/c/1404554
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621611}
  • Loading branch information
peterwmwong authored and Commit Bot committed Jan 10, 2019
1 parent b54ffff commit d9cbb39
Show file tree
Hide file tree
Showing 14 changed files with 5 additions and 33 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ Peter Collingbourne <peter@pcc.me.uk>
Peter Gal <pgal.u-szeged@partner.samsung.com>
Peter Molnar <pmolnar.u-szeged@partner.samsung.com>
Peter Snyder <snyderp@gmail.com>
Peter Wong <peter.wm.wong@gmail.com>
Philip Hanson <philip.hanson@intel.com>
Philipp Hancke <fippo@andyet.net>
Philipp Hancke <philipp.hancke@googlemail.com>
Expand Down
1 change: 0 additions & 1 deletion content/test/fuzzer/fuzzer_support.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ Env::Env() {
gin::V8Initializer::LoadV8Natives();
#endif
gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
gin::IsolateHolder::kStableV8Extras,
gin::ArrayBufferAllocator::SharedInstance());

adapter = std::make_unique<RenderViewTestAdapter>();
Expand Down
1 change: 0 additions & 1 deletion extensions/renderer/bindings/api_binding_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ void APIBindingTest::SetUp() {
#endif

gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
gin::IsolateHolder::kStableV8Extras,
gin::ArrayBufferAllocator::SharedInstance());

isolate_holder_ = std::make_unique<gin::IsolateHolder>(
Expand Down
3 changes: 1 addition & 2 deletions gin/isolate_holder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,10 @@ IsolateHolder::~IsolateHolder() {

// static
void IsolateHolder::Initialize(ScriptMode mode,
V8ExtrasMode v8_extras_mode,
v8::ArrayBuffer::Allocator* allocator,
const intptr_t* reference_table) {
CHECK(allocator);
V8Initializer::Initialize(mode, v8_extras_mode);
V8Initializer::Initialize(mode);
g_array_buffer_allocator = allocator;
g_reference_table = reference_table;
}
Expand Down
7 changes: 0 additions & 7 deletions gin/public/isolate_holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ class GIN_EXPORT IsolateHolder {
kAllowAtomicsWait
};

// Indicates whether V8 works with stable or experimental v8 extras.
enum V8ExtrasMode {
kStableV8Extras,
kStableAndExperimentalV8Extras,
};

// Indicates how the Isolate instance will be created.
enum class IsolateCreationMode {
kNormal,
Expand Down Expand Up @@ -96,7 +90,6 @@ class GIN_EXPORT IsolateHolder {
// external references, |reference_table| needs to point an array of those
// reference pointers. Otherwise, it can be nullptr.
static void Initialize(ScriptMode mode,
V8ExtrasMode v8_extras_mode,
v8::ArrayBuffer::Allocator* allocator,
const intptr_t* reference_table = nullptr);

Expand Down
1 change: 0 additions & 1 deletion gin/shell/gin_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ int main(int argc, char** argv) {

{
gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
gin::IsolateHolder::kStableV8Extras,
gin::ArrayBufferAllocator::SharedInstance());
gin::IsolateHolder instance(
base::ThreadTaskRunnerHandle::Get(),
Expand Down
1 change: 0 additions & 1 deletion gin/shell_runner_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ TEST(RunnerTest, Run) {
#endif

gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
gin::IsolateHolder::kStableV8Extras,
gin::ArrayBufferAllocator::SharedInstance());
gin::IsolateHolder instance(base::ThreadTaskRunnerHandle::Get(),
gin::IsolateHolder::IsolateType::kTest);
Expand Down
1 change: 0 additions & 1 deletion gin/test/v8_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ void V8Test::SetUp() {
gin::V8Initializer::LoadV8Natives();
#endif
gin::IsolateHolder::Initialize(gin::IsolateHolder::kStrictMode,
gin::IsolateHolder::kStableV8Extras,
gin::ArrayBufferAllocator::SharedInstance());

instance_ = CreateIsolateHolder();
Expand Down
7 changes: 1 addition & 6 deletions gin/v8_initializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,7 @@ enum LoadV8FileResult {
} // namespace

// static
void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
IsolateHolder::V8ExtrasMode v8_extras_mode) {
void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) {
static bool v8_is_initialized = false;
if (v8_is_initialized)
return;
Expand All @@ -224,10 +223,6 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
static const char use_strict[] = "--use_strict";
v8::V8::SetFlagsFromString(use_strict, sizeof(use_strict) - 1);
}
if (IsolateHolder::kStableAndExperimentalV8Extras == v8_extras_mode) {
static const char flag[] = "--experimental_extras";
v8::V8::SetFlagsFromString(flag, sizeof(flag) - 1);
}

#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
v8::StartupData natives;
Expand Down
3 changes: 1 addition & 2 deletions gin/v8_initializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ namespace gin {
class GIN_EXPORT V8Initializer {
public:
// This should be called by IsolateHolder::Initialize().
static void Initialize(IsolateHolder::ScriptMode mode,
IsolateHolder::V8ExtrasMode v8_extras_mode);
static void Initialize(IsolateHolder::ScriptMode mode);

// Get address and size information for currently loaded snapshot.
// If no snapshot is loaded, the return values are null for addresses
Expand Down
1 change: 0 additions & 1 deletion net/proxy_resolution/proxy_resolver_v8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ class SharedIsolateFactory {

gin::IsolateHolder::Initialize(
gin::IsolateHolder::kNonStrictMode,
gin::IsolateHolder::kStableV8Extras,
gin::ArrayBufferAllocator::SharedInstance());

has_initialized_v8_ = true;
Expand Down
1 change: 0 additions & 1 deletion pdf/pdfium/pdfium_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@ void SetUpV8() {
const char* recommended = FPDF_GetRecommendedV8Flags();
v8::V8::SetFlagsFromString(recommended, strlen(recommended));
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,
gin::IsolateHolder::kStableV8Extras,
gin::ArrayBufferAllocator::SharedInstance());
DCHECK(!g_isolate_holder);
g_isolate_holder = new gin::IsolateHolder(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,12 +691,8 @@ void V8Initializer::InitializeMainThread(const intptr_t* reference_table) {
WTF::ArrayBufferContents::Initialize(AdjustAmountOfExternalAllocatedMemory);

DEFINE_STATIC_LOCAL(ArrayBufferAllocator, array_buffer_allocator, ());
auto v8_extras_mode = RuntimeEnabledFeatures::ExperimentalV8ExtrasEnabled()
? gin::IsolateHolder::kStableAndExperimentalV8Extras
: gin::IsolateHolder::kStableV8Extras;
gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode,
v8_extras_mode, &array_buffer_allocator,
reference_table);
&array_buffer_allocator, reference_table);

ThreadScheduler* scheduler = ThreadScheduler::Current();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,6 @@
name: "ExperimentalShouldYield",
status: "experimental"
},
{
name: "ExperimentalV8Extras",
status: "experimental",
},
{
name: "ExtendedTextMetrics",
status: "experimental",
Expand Down

0 comments on commit d9cbb39

Please sign in to comment.