Commit c4f4d635 authored by ulan's avatar ulan Committed by Commit bot

Make v8::Isolate::SetRAILMode thread safe and remove the

PERFORMANCE_DEFAULT mode.

BUG=

Review-Url: https://codereview.chromium.org/2108503003
Cr-Commit-Position: refs/heads/master@{#37340}
parent efa7095e
......@@ -5378,16 +5378,13 @@ struct JitCodeEvent {
* profile/evaluate-performance/rail
*/
enum RAILMode {
// Default performance mode: V8 will optimize for both latency and
// throughput in this mode.
PERFORMANCE_DEFAULT,
// Response performance mode: In this mode very low virtual machine latency
// is provided. V8 will try to avoid JavaScript execution interruptions.
// Throughput may be throttled.
PERFORMANCE_RESPONSE,
// Animation performance mode: In this mode low virtual machine latency is
// provided. V8 will try to avoid as many JavaScript execution interruptions
// as possible. Throughput may be throttled
// as possible. Throughput may be throttled. This is the default mode.
PERFORMANCE_ANIMATION,
// Idle performance mode: The embedder is idle. V8 can complete deferred work
// in this mode.
......
......@@ -1839,7 +1839,7 @@ Isolate::Isolate(bool enable_serializer)
// TODO(bmeurer) Initialized lazily because it depends on flags; can
// be fixed once the default isolate cleanup is done.
random_number_generator_(NULL),
rail_mode_(PERFORMANCE_DEFAULT),
rail_mode_(PERFORMANCE_ANIMATION),
serializer_enabled_(enable_serializer),
has_fatal_error_(false),
initialized_from_snapshot_(false),
......@@ -2995,9 +2995,9 @@ void Isolate::CheckDetachedContextsAfterGC() {
}
void Isolate::SetRAILMode(RAILMode rail_mode) {
rail_mode_ = rail_mode;
rail_mode_.SetValue(rail_mode);
if (FLAG_trace_rail) {
PrintIsolate(this, "RAIL mode: %s\n", RAILModeName(rail_mode_));
PrintIsolate(this, "RAIL mode: %s\n", RAILModeName(rail_mode));
}
}
......
......@@ -1253,8 +1253,6 @@ class Isolate {
const char* RAILModeName(RAILMode rail_mode) const {
switch (rail_mode) {
case PERFORMANCE_DEFAULT:
return "DEFAULT";
case PERFORMANCE_RESPONSE:
return "RESPONSE";
case PERFORMANCE_ANIMATION:
......@@ -1263,8 +1261,6 @@ class Isolate {
return "IDLE";
case PERFORMANCE_LOAD:
return "LOAD";
default:
UNREACHABLE();
}
return "";
}
......@@ -1315,7 +1311,7 @@ class Isolate {
DateCache* date_cache_;
CallInterfaceDescriptorData* call_descriptor_data_;
base::RandomNumberGenerator* random_number_generator_;
RAILMode rail_mode_;
base::AtomicValue<RAILMode> rail_mode_;
// Whether the isolate has been created for snapshotting.
bool serializer_enabled_;
......
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