Chromium Code Reviews| Index: runtime/vm/isolate.h |
| diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h |
| index e9c255b0e5ebf84d67bf71c9d4887d5d4568bae4..97bea3ca86e706621064120aa19f463154af28fb 100644 |
| --- a/runtime/vm/isolate.h |
| +++ b/runtime/vm/isolate.h |
| @@ -337,42 +337,6 @@ class Isolate : public BaseIsolate { |
| void set_has_compiled_code(bool value) { has_compiled_code_ = value; } |
| bool has_compiled_code() const { return has_compiled_code_; } |
| - // TODO(iposva): Evaluate whether two different isolate flag structures are |
| - // needed. Currently it serves as a separation between publicly visible flags |
| - // and VM internal flags. |
| - class Flags : public ValueObject { |
| - public: |
| - // Construct default flags as specified by the options. |
| - Flags(); |
| - |
| - bool type_checks() const { return type_checks_; } |
| - bool asserts() const { return asserts_; } |
| - bool error_on_bad_type() const { return error_on_bad_type_; } |
| - bool error_on_bad_override() const { return error_on_bad_override_; } |
| - |
| - void set_checked(bool val) { |
| - type_checks_ = val; |
| - asserts_ = val; |
| - } |
| - |
| - void CopyFrom(const Flags& orig); |
| - void CopyFrom(const Dart_IsolateFlags& api_flags); |
| - void CopyTo(Dart_IsolateFlags* api_flags) const; |
| - |
| - private: |
| - bool type_checks_; |
| - bool asserts_; |
| - bool error_on_bad_type_; |
| - bool error_on_bad_override_; |
| - |
| - friend class Isolate; |
| - |
| - DISALLOW_ALLOCATION(); |
| - DISALLOW_COPY_AND_ASSIGN(Flags); |
| - }; |
| - |
| - const Flags& flags() const { return flags_; } |
| - |
| // Lets the embedder know that a service message resulted in a resume request. |
| void SetResumeRequest() { |
| resume_request_ = true; |
| @@ -672,6 +636,23 @@ class Isolate : public BaseIsolate { |
| bool is_service_isolate() const { return is_service_isolate_; } |
| + // Isolate-specific flag handling. |
| + static void FlagsInitialize(Dart_IsolateFlags* api_flags); |
| + void FlagsCopyTo(Dart_IsolateFlags* api_flags) const; |
| + void FlagsCopyFrom(const Dart_IsolateFlags& api_flags); |
| + |
| +#if defined(PRODUCT) |
| + bool type_checks() const { return false; } |
| + bool asserts() const { return false; } |
|
Florian Schneider
2016/02/26 01:52:09
Would return FLAG_enable_asserts work here, and fo
Ivan Posva
2016/02/26 02:05:36
Good point. Done.
|
| + bool error_on_bad_type() const { return false; } |
| + bool error_on_bad_override() const { return false; } |
| +#else // defined(PRODUCT) |
| + bool type_checks() const { return type_checks_; } |
| + bool asserts() const { return asserts_; } |
| + bool error_on_bad_type() const { return error_on_bad_type_; } |
| + bool error_on_bad_override() const { return error_on_bad_override_; } |
| +#endif // defined(PRODUCT) |
| + |
| static void KillAllIsolates(LibMsgId msg_id); |
| static void KillIfExists(Isolate* isolate, LibMsgId msg_id); |
| @@ -769,7 +750,6 @@ class Isolate : public BaseIsolate { |
| bool resume_request_; |
| int64_t last_resume_timestamp_; |
| bool has_compiled_code_; // Can check that no compilation occured. |
| - Flags flags_; |
| Random random_; |
| Simulator* simulator_; |
| Mutex* mutex_; // protects stack_limit_, saved_stack_limit_, compiler stats. |
| @@ -791,6 +771,14 @@ class Isolate : public BaseIsolate { |
| bool is_service_isolate_; |
| + // Isolate-specific flags. |
| + NOT_IN_PRODUCT( |
| + bool type_checks_; |
| + bool asserts_; |
| + bool error_on_bad_type_; |
| + bool error_on_bad_override_; |
| + ) |
| + |
| // Status support. |
| char* stacktrace_; |
| intptr_t stack_frame_index_; |
| @@ -997,7 +985,7 @@ class IsolateSpawnState { |
| bool is_spawn_uri() const { return library_url_ == NULL; } |
| bool paused() const { return paused_; } |
| bool errors_are_fatal() const { return errors_are_fatal_; } |
| - Isolate::Flags* isolate_flags() { return &isolate_flags_; } |
| + Dart_IsolateFlags* isolate_flags() { return &isolate_flags_; } |
| RawObject* ResolveFunction(); |
| RawInstance* BuildArgs(Thread* thread); |
| @@ -1028,7 +1016,7 @@ class IsolateSpawnState { |
| Monitor* spawn_count_monitor_; |
| intptr_t* spawn_count_; |
| - Isolate::Flags isolate_flags_; |
| + Dart_IsolateFlags isolate_flags_; |
| bool paused_; |
| bool errors_are_fatal_; |
| }; |