87b0dbab2d
This change adds enough functionality to compile hello world from S-expressions in a contrived way. It fails to handle this input realistically in several ways. 1) It assumes the existence of dart:core::print 2) It handles all dart values as C strings 3) It assumes only very static calls can be made with no named arguments 4) If a stack overflow is detected it just traps. 5) I'm not sure how the current dart runtime works but the contrived runtime used here puts a contrived thread object in `gs`. This change adds a basic framework for implementing new instructions that should make it possible to implement new instructions with much smaller changes however. Change-Id: Ic167a29908a875bfc234c4e9bf5f4ac2ff52a3a2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117222 Commit-Queue: Jake Ehrlich <jakehehrlich@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
46 lines
988 B
Plaintext
46 lines
988 B
Plaintext
# Copyright (c) 2019, 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.
|
|
|
|
import("../../vm/compiler/compiler_sources.gni")
|
|
|
|
config("config") {
|
|
include_dirs = [
|
|
"../../"
|
|
]
|
|
|
|
cflags = [
|
|
"-Wno-unused-private-field"
|
|
]
|
|
}
|
|
|
|
_lib_llvm_so = "../../../third_party/llvm/lib/libLLVM-9svn.so"
|
|
|
|
config("llvm") {
|
|
include_dirs = [ "../../../third_party/llvm/include" ]
|
|
libs = [ _lib_llvm_so ]
|
|
}
|
|
|
|
copy("lib_llvm") {
|
|
sources = [ _lib_llvm_so ]
|
|
outputs = [ "$root_out_dir/libLLVM-9svn.so" ]
|
|
public_configs = [ ":llvm" ]
|
|
}
|
|
|
|
executable("codegen") {
|
|
sources = [
|
|
"main.cc",
|
|
"dart.cc",
|
|
"dart.h"
|
|
]
|
|
|
|
deps = [
|
|
":lib_llvm",
|
|
"../..:libdart_nosnapshot_with_precompiler",
|
|
"../../vm:libdart_vm_nosnapshot_with_precompiler",
|
|
"../../platform:libdart_platform_nosnapshot_with_precompiler",
|
|
]
|
|
|
|
configs += [ ":config" ]
|
|
}
|