| OLD | NEW |
| 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 if (IsolateHolder::kStrictMode == mode) { | 360 if (IsolateHolder::kStrictMode == mode) { |
| 361 static const char use_strict[] = "--use_strict"; | 361 static const char use_strict[] = "--use_strict"; |
| 362 v8::V8::SetFlagsFromString(use_strict, sizeof(use_strict) - 1); | 362 v8::V8::SetFlagsFromString(use_strict, sizeof(use_strict) - 1); |
| 363 } | 363 } |
| 364 if (IsolateHolder::kStableAndExperimentalV8Extras == v8_extras_mode) { | 364 if (IsolateHolder::kStableAndExperimentalV8Extras == v8_extras_mode) { |
| 365 static const char flag[] = "--experimental_extras"; | 365 static const char flag[] = "--experimental_extras"; |
| 366 v8::V8::SetFlagsFromString(flag, sizeof(flag) - 1); | 366 v8::V8::SetFlagsFromString(flag, sizeof(flag) - 1); |
| 367 } | 367 } |
| 368 | 368 |
| 369 const char* ignition_enabled_crash_key = "N"; | 369 const char* ignition_enabled_crash_key = "N"; |
| 370 if (base::FeatureList::IsEnabled(features::kV8Future)) { | 370 if (base::FeatureList::IsEnabled(features::kV8NoTurbo)) { |
| 371 ignition_enabled_crash_key = "N"; |
| 372 std::string flag("--no-turbo"); |
| 373 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size())); |
| 374 } else if (base::FeatureList::IsEnabled(features::kV8Future)) { |
| 371 ignition_enabled_crash_key = "Y"; | 375 ignition_enabled_crash_key = "Y"; |
| 372 std::string flag("--future"); | 376 std::string flag("--future"); |
| 373 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size())); | 377 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size())); |
| 374 } else if (base::FeatureList::IsEnabled(features::kV8IgnitionLowEnd) && | 378 } else if (base::FeatureList::IsEnabled(features::kV8IgnitionLowEnd) && |
| 375 base::SysInfo::IsLowEndDevice()) { | 379 base::SysInfo::IsLowEndDevice()) { |
| 376 ignition_enabled_crash_key = "Y"; | 380 ignition_enabled_crash_key = "Y"; |
| 377 std::string flag("--ignition"); | 381 std::string flag("--ignition"); |
| 378 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size())); | 382 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size())); |
| 379 } | 383 } |
| 380 static const char kIgnitionEnabledKey[] = "v8-ignition"; | 384 static const char kIgnitionEnabledKey[] = "v8-ignition"; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 *snapshot_data_out = | 422 *snapshot_data_out = |
| 419 reinterpret_cast<const char*>(g_mapped_snapshot->data()); | 423 reinterpret_cast<const char*>(g_mapped_snapshot->data()); |
| 420 *snapshot_size_out = static_cast<int>(g_mapped_snapshot->length()); | 424 *snapshot_size_out = static_cast<int>(g_mapped_snapshot->length()); |
| 421 } else { | 425 } else { |
| 422 *snapshot_data_out = NULL; | 426 *snapshot_data_out = NULL; |
| 423 *snapshot_size_out = 0; | 427 *snapshot_size_out = 0; |
| 424 } | 428 } |
| 425 } | 429 } |
| 426 | 430 |
| 427 } // namespace gin | 431 } // namespace gin |
| OLD | NEW |