标签: aot

单声道AOT分段故障 - 奇怪的问题

我想测试Mono AOT,所以我用MonoDevelop编写了一个简单的控制台应用程序:

using System;

namespace abc
{
    public class Program
    {
        public static void Main()
        {
            Console.WriteLine("Hello World!");
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

它在bin/debug中创建了一个名为"abc.exe"的文件.当我尝试做的时候:

mono abc.exe
Run Code Online (Sandbox Code Playgroud)

有效.所以,我试着AOT它.我做了:

mono --aot abc.exe
Run Code Online (Sandbox Code Playgroud)

它创建了一个名为abc.exe.so的文件.当我尝试启动它时,它会抛出"Segmentation fault(core dumped)"错误.继承单声道的输出--aot:

Code: 51 Info: 5 Ex Info: 8 Unwind Info: 31 Class Info: 30 PLT: 2 GOT Info: 11 GOT Info Offsets: 16 GOT: 20 Offsets: 48
Compiled 2 out of 3 methods (66%)
1 methods have other problems (33%)
Methods without GOT slots: 1 (33%)
Direct calls: 0 (100%) …
Run Code Online (Sandbox Code Playgroud)

c# mono aot

9
推荐指数
2
解决办法
1577
查看次数

如何将Angular 4+(前端)部署到CDN?

我想将我的Angular应用程序(使用AOT)部署到CDN,同时使用我自己的REST服务器.

我想第一个请求总是转到我的REST服务器(比如说https://example.com).然后第一个响应将指示浏览器从CDN加载Angular的第一个模块.

所有资源请求(API请求)当然都会转到我的REST服务器(假设是https://example.com/api/XXXX).

现在我的问题是:

代码如何知道从哪里加载下一个Angular模块?

有人可以解释一下这背后的机制吗?

rest cdn aot angular

9
推荐指数
1
解决办法
3280
查看次数

装饰器不支持函数调用

我正在尝试使用-aotoption(ng build -aot)构建应用程序.我有以下错误:

ERROR in Error during template compile of 'MyComponent'
  Function calls are not supported in decorators but 'classLogger' was called in 'cLog'
    'cLog' calls 'classLogger'.
Run Code Online (Sandbox Code Playgroud)

但是,我需要这个调用,我不知道我应该如何更改代码以使其工作.

export function classLogger(_classOptions?) {
   const myLogger = new MyLogger();
   myLogger.options = Object.assign({}, defaultClassOptions, _classOptions);

   return myLogger.loggerCB;
}

// export function clog(options = defaultClassOptions): Function {
export function cLog(options?): Function {
   return loggingEnabled ? classLogger(options) : emptyClassDecorator();
}
Run Code Online (Sandbox Code Playgroud)

PS类装饰器采用必须转移到装饰器补丁回调的选项.

decorator aot angular

9
推荐指数
1
解决办法
1430
查看次数

同一项目的角度AOT和JIT

在angular5上,我尝试对我的大多数模块/组件进行相同的项目AOT编译......但我有一部分需要进行JIT编译.

对于第二部分,HTML来自Ajax请求并包含一些必须由angular编译的组件标记.要管理这部分,我使用看起来像这样的指令:

export class ArticleLiveDirective implements OnInit, OnChanges, OnDestroy {

    // [...]    

    constructor(
        private container: ViewContainerRef,
        private compiler: Compiler
    ) { }

    // [...]

    private addHtmlComponent(template: string, properties: any = {}) {
        this.container.clear();
        //Force always rootDomElement.
        const divTag = document.createElement('div');
        divTag.setAttribute('id',this.currentId);
        divTag.innerHTML = template;
        template = divTag.outerHTML;

        // We create dynamic component with injected template
        @Component({ template })
        class ArticleLIveComponent implements OnInit, OnChanges, OnDestroy {
            constructor(
                private articleService: ArticleService
            ) {}
            ngOnInit() {}
            ngOnChanges(changes: SimpleChanges) {}
            ngOnDestroy() {}
            goToPage($event: Event, …
Run Code Online (Sandbox Code Playgroud)

jit aot angular angular-aot angular5

9
推荐指数
1
解决办法
1903
查看次数

如何将ByteCode转换为机器本机代码

我正在寻找一个翻译器,用于在执行之前将Java ByteCode转换为Machine Native Code以提高性能.

我听说OpenOffice是用JAVA制作的,但我在他的安装文件夹中看不到任何jar文件,因此,也许有翻译但我找不到它.

有谁知道这样做的工具或商业产品?

谢谢!

java bytecode aot

8
推荐指数
1
解决办法
6124
查看次数

当静态forRoot具有参数时,在AOT构建期间FeatureModule失败

我正在使用Angular@5.1.0遇到AOT构建问题.

错误是:

ERROR in Error during template compile of 'AppModule'
  Function calls are not supported in decorators but 'FeatureModule' was called.
Run Code Online (Sandbox Code Playgroud)

feature.module.ts

@NgModule({
    imports: [
        BrowserModule,
        RouterModule.forRoot([])
    ],
    declarations: [
        ...    
    ],
    exports: [
        ...      
    ]
})
export class FeatureModule{
    static forRoot(items:any[]): ModuleWithProviders {
        const routes:Routes = items.map(t=> {
            return { path: t.name, component: t.component };
        });

        return {
            ngModule: FeatureModule, 
            providers: [
                provideRoutes(routes)
            ]
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

这在非aot构建中成功编译.这似乎只是AOT构建的一个问题.

为什么会发生这种错误?

aot angular

8
推荐指数
1
解决办法
1640
查看次数

错误:在进行 AngularJS 到 Angular 13 迁移时,可注入类 PlatformLocation {} 的 JIT 编译失败

现在正在将应用程序从 Angularjs 迁移到 Angular v13,我正在尝试双启动该应用程序。

并在浏览器控制台中收到以下错误:

Uncaught Error: The injectable 'PlatformLocation' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.

The injectable is part of a library that has been partially compiled.
However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.

Ideally, the library is processed using the Angular Linker to become fully AOT compiled.
Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server', …
Run Code Online (Sandbox Code Playgroud)

migration jit aot angularjs angular

8
推荐指数
1
解决办法
3940
查看次数

Dotnet 提前:PublishReadyToRun vs PublishAot vs RunAOTCompilation

最近的 dotnet 版本(dotnet 6 和 7)具有提前 (AOT) 编译功能。根据官方文档,有不同的方法可以实现这一目标。

原生 AOT 部署

  <PropertyGroup>
    <PublishAot>true</PublishAot>
  </PropertyGroup>
Run Code Online (Sandbox Code Playgroud)

准备运行编译

  <PropertyGroup>
    <PublishReadyToRun>true</PublishReadyToRun>
  </PropertyGroup>
Run Code Online (Sandbox Code Playgroud)

AOT Blazor WebAssembly

<PropertyGroup>
  <RunAOTCompilation>true</RunAOTCompilation>
</PropertyGroup
Run Code Online (Sandbox Code Playgroud)

仅通过阅读文档很难理解这个概念。PublishReadyToRun 与 PublishAot 之间有什么区别?何时使用其中一种而不是另一种?以及如何为类库、blazor wasm 和 asp.net core 项目启用 AoT 编译?

.net c# aot

8
推荐指数
1
解决办法
5150
查看次数

适用于iOS的Unity3d下的Json.NET

有没有人成功地适应/将Json.NET移植到能够在部署到iOS的Unity3d下运行的版本(以及webplayer和android,但这些看起来不那么成问题),以某种方式克服AOT问题?

或者是否计划发布兼容版本的Json.NET?

非常感谢,

马克斯

json.net unity-game-engine aot ios

7
推荐指数
2
解决办法
1万
查看次数

Angular Ivy 编译器、ngtsc、ngcc、ngc、aot、jit、tsc

我正在学习 Angular Ivy 编译器。这是我的理解。

Ivy 的编译器 - 由 ngtsc 和 ngcc 组成

ngc - AOT 编译器

ngtsc - 是 tsc 的包装

ngcc - 是编译 pre-Ivy 库的兼容性编译器

tsc - 是一个打字稿编译器

参考此链接,了解 Ivy 的架构 https://github.com/angular/angular/blob/master/packages/compiler/design/architecture.md

AOT 编译器的链接, https://github.com/angular/angular/blob/5b31a0a2942c50059cac4c7ccb92047a50473347/aio/content/guide/aot-compiler.md

AOT 编译器和 ngtsc(作为 Ivy 的一部分)都执行此操作 - “将您的 Angular HTML 和 TypeScript 代码转换为高效的 JavaScript 代码”?

Ivy + AOT编译时,ngtsc和AOT编译器(ngc)的功能是什么?

谢谢

ivy aot angular9

7
推荐指数
0
解决办法
3214
查看次数