dart-sdk/runtime/vm/base_isolate.h
Clement Skau 2d36c85ff8 [vm] Removes support for --causal-async-stacks
All existing embedders have been opted into --lazy-async-stacks, the
VM also uses it as it's default in all configurations.

After this CL, any user of --causal-async-stacks will get an error
message when trying to use it.
=> In any such case, please simply remove the flag.

TEST=Exhaustive CQ.

Bug: https://github.com/dart-lang/sdk/issues/37668
Change-Id: Ia440afcf2dba464aa8b8cf381b93bbac8eb9f8dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172564
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-12-01 07:27:14 +00:00

63 lines
1.8 KiB
C++

// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#ifndef RUNTIME_VM_BASE_ISOLATE_H_
#define RUNTIME_VM_BASE_ISOLATE_H_
#include "platform/assert.h"
#include "vm/globals.h"
namespace dart {
class HandleScope;
class StackResource;
class Thread;
class Zone;
// A BaseIsolate contains just enough functionality to allocate
// StackResources. This allows us to inline the StackResource
// constructor/destructor for performance.
class BaseIsolate {
public:
#if defined(DEBUG)
void AssertCurrentThreadIsMutator() const;
#else
void AssertCurrentThreadIsMutator() const {}
#endif // DEBUG
#if defined(DEBUG)
static void AssertCurrent(BaseIsolate* isolate);
#endif
protected:
BaseIsolate() {}
~BaseIsolate() {
// Do not delete stack resources: top_resource_ and current_zone_.
}
Thread* scheduled_mutator_thread_ = nullptr;
// TODO(asiva): Currently we treat a mutator thread as a special thread
// and always schedule execution of Dart code on the same mutator thread
// object. The ApiLocalScope has been made thread specific but we still
// have scenarios where we do a temporary exit of an Isolate with live
// zones/handles in the API scope :
// - Dart_RunLoop()
// - IsolateSaver in Dart_NewNativePort
// We probably need a mechanism to return to the specific thread only
// for these specific cases. We should also determine if the embedder
// should allow exiting an isolate with live state in zones/handles in
// which case a new API for returning to the specific thread needs to be
// added.
Thread* mutator_thread_ = nullptr;
private:
DISALLOW_COPY_AND_ASSIGN(BaseIsolate);
};
} // namespace dart
#endif // RUNTIME_VM_BASE_ISOLATE_H_