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

Side by Side Diff: gin/v8_initializer.cc

Issue 1989883002: [Gin] Add V8IgnitionEager feature. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « gin/public/gin_features.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gin/v8_initializer.h" 5 #include "gin/v8_initializer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 v8::V8::SetFlagsFromString(use_strict, sizeof(use_strict) - 1); 433 v8::V8::SetFlagsFromString(use_strict, sizeof(use_strict) - 1);
434 } 434 }
435 if (IsolateHolder::kStableAndExperimentalV8Extras == v8_extras_mode) { 435 if (IsolateHolder::kStableAndExperimentalV8Extras == v8_extras_mode) {
436 static const char flag[] = "--experimental_extras"; 436 static const char flag[] = "--experimental_extras";
437 v8::V8::SetFlagsFromString(flag, sizeof(flag) - 1); 437 v8::V8::SetFlagsFromString(flag, sizeof(flag) - 1);
438 } 438 }
439 439
440 if (base::FeatureList::IsEnabled(features::kV8Ignition)) { 440 if (base::FeatureList::IsEnabled(features::kV8Ignition)) {
441 std::string flag("--ignition"); 441 std::string flag("--ignition");
442 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size())); 442 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size()));
443
444 if (base::FeatureList::IsEnabled(features::kV8IgnitionEager)) {
445 std::string eager_flag("--ignition-eager");
446 v8::V8::SetFlagsFromString(
447 eager_flag.c_str(), static_cast<int>(eager_flag.size()));
448 }
449
450 if (base::FeatureList::IsEnabled(features::kV8IgnitionLazy)) {
451 std::string lazy_flag("--no-ignition-eager");
452 v8::V8::SetFlagsFromString(
453 lazy_flag.c_str(), static_cast<int>(lazy_flag.size()));
454 }
443 } 455 }
444 456
445 if (base::FeatureList::IsEnabled(features::kV8IgnitionLazy)) {
446 std::string flag("--no-ignition-eager");
447 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size()));
448 }
449 457
450 #if defined(V8_USE_EXTERNAL_STARTUP_DATA) 458 #if defined(V8_USE_EXTERNAL_STARTUP_DATA)
451 v8::StartupData natives; 459 v8::StartupData natives;
452 natives.data = reinterpret_cast<const char*>(g_mapped_natives->data()); 460 natives.data = reinterpret_cast<const char*>(g_mapped_natives->data());
453 natives.raw_size = static_cast<int>(g_mapped_natives->length()); 461 natives.raw_size = static_cast<int>(g_mapped_natives->length());
454 v8::V8::SetNativesDataBlob(&natives); 462 v8::V8::SetNativesDataBlob(&natives);
455 463
456 if (g_mapped_snapshot != NULL) { 464 if (g_mapped_snapshot != NULL) {
457 v8::StartupData snapshot; 465 v8::StartupData snapshot;
458 snapshot.data = reinterpret_cast<const char*>(g_mapped_snapshot->data()); 466 snapshot.data = reinterpret_cast<const char*>(g_mapped_snapshot->data());
(...skipping 24 matching lines...) Expand all
483 *snapshot_data_out = 491 *snapshot_data_out =
484 reinterpret_cast<const char*>(g_mapped_snapshot->data()); 492 reinterpret_cast<const char*>(g_mapped_snapshot->data());
485 *snapshot_size_out = static_cast<int>(g_mapped_snapshot->length()); 493 *snapshot_size_out = static_cast<int>(g_mapped_snapshot->length());
486 } else { 494 } else {
487 *snapshot_data_out = NULL; 495 *snapshot_data_out = NULL;
488 *snapshot_size_out = 0; 496 *snapshot_size_out = 0;
489 } 497 }
490 } 498 }
491 499
492 } // namespace gin 500 } // namespace gin
OLDNEW
« no previous file with comments | « gin/public/gin_features.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698