f5ab173c77
To run a script with the Dart->Kernel parser, use the -dfe option: dart --dfe=runtime/tools/kernel-service.dart --packages=/src/d2/sdk/.packages foo.dart The front end expects a directory named patched_sdk in the build directory (patched_sdk should be a sibling of the directory that contains the dart executable.) Warning: using a debug build dart executable is very slow. It takes 2 minutes to run Hello World in a debug build, and about 7 seconds in a release build. BUG= R=asiva@google.com Review URL: https://codereview.chromium.org/2558673002 .
58 lines
1.4 KiB
C++
58 lines
1.4 KiB
C++
// Copyright (c) 2016, 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_KERNEL_ISOLATE_H_
|
|
#define RUNTIME_VM_KERNEL_ISOLATE_H_
|
|
|
|
#if !defined(DART_PRECOMPILED_RUNTIME)
|
|
|
|
#include "include/dart_api.h"
|
|
|
|
#include "vm/allocation.h"
|
|
#include "vm/dart.h"
|
|
#include "vm/os_thread.h"
|
|
|
|
namespace dart {
|
|
|
|
class KernelIsolate : public AllStatic {
|
|
public:
|
|
static const char* kName;
|
|
|
|
static void Run();
|
|
|
|
static bool Exists();
|
|
static bool IsRunning();
|
|
static bool IsKernelIsolate(const Isolate* isolate);
|
|
static Dart_Port WaitForKernelPort();
|
|
static Dart_Port KernelPort() { return kernel_port_; }
|
|
|
|
static bool LoadScript(const String& url, const String& source);
|
|
|
|
protected:
|
|
static Monitor* monitor_;
|
|
static Dart_IsolateCreateCallback create_callback_;
|
|
|
|
static void InitCallback(Isolate* I);
|
|
static void SetKernelIsolate(Isolate* isolate);
|
|
static void SetLoadPort(Dart_Port port);
|
|
static void FinishedInitializing();
|
|
|
|
static Dart_Port kernel_port_;
|
|
static Isolate* isolate_;
|
|
static bool initializing_;
|
|
|
|
static Dart_IsolateCreateCallback create_callback() {
|
|
return create_callback_;
|
|
}
|
|
|
|
friend class Dart;
|
|
friend class RunKernelTask;
|
|
};
|
|
|
|
} // namespace dart
|
|
|
|
#endif // DART_PRECOMPILED_RUNTIME
|
|
|
|
#endif // RUNTIME_VM_KERNEL_ISOLATE_H_
|