The LLVM code generator should only consume the serialized IR and not use any other VM functionality.
This CL adds a custom zone which can be used for the deserialized IR nodes and removes any
Dart_SetVMFlags/Dart_Initialize/ApiZone/... calls.
This works with the existing example:
% ninja -C out/ReleaseX64 codegen
% out/ReleaseX64/codegen runtime/llvm_codegen/test/codegen/Inputs/hello.sex
...
define void @"hello.dart::main"() {
B1:
%0 = call i8* @llvm.stacksave()
%1 = ptrtoint i8* %0 to i64
%2 = load i64, i64 addrspace(256)* inttoptr (i64 72 to i64 addrspace(256)*)
%3 = icmp ult i64 %1, %2
br i1 %3, label %4, label %5
...
ret void
}
...
Change-Id: I1d07ba6bc122d100c73f97cfa961d36240489666
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120792
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
Reviewed-by: Teagan Strickland <sstrickl@google.com>
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>