Skip to content

Commit

Permalink
Merge pull request #1148 from glimmerjs/remove-aot-rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue authored Sep 2, 2020
2 parents a716e5c + 67c2510 commit 622e35b
Show file tree
Hide file tree
Showing 88 changed files with 598 additions and 2,967 deletions.
2 changes: 1 addition & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "glimmer-benchmark",
"version": "0.59.0",
"version": "0.60.0",
"private": true,
"dependencies": {
"@glimmer/benchmark-env": "*",
Expand Down
2 changes: 1 addition & 1 deletion lib/local-linker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "local-linker",
"version": "0.59.0",
"version": "0.60.0",
"private": true,
"keywords": [
"ember-addon"
Expand Down
1 change: 1 addition & 0 deletions packages/@glimmer/benchmark-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"repository": "https://github.com/glimmerjs/glimmer-vm/tree/master/packages/@glimmer/benchmark-env",
"dependencies": {
"@glimmer/global-context": "^0.60.0",
"@glimmer/program": "^0.60.0",
"@glimmer/reference": "^0.60.0",
"@glimmer/runtime": "^0.60.0",
"@glimmer/validator": "^0.60.0",
Expand Down
27 changes: 21 additions & 6 deletions packages/@glimmer/benchmark-env/src/benchmark/create-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import {
ModifierManager,
CompilableProgram,
Dict,
PartialDefinition,
} from '@glimmer/interfaces';
import { JitContext } from '@glimmer/opcode-compiler';
import { syntaxCompilationContext } from '@glimmer/opcode-compiler';
import { artifacts } from '@glimmer/program';
import { SimpleComponentManager } from '@glimmer/runtime';
import { SimpleElement } from '@simple-dom/interface';

Expand Down Expand Up @@ -128,20 +130,33 @@ export default function createRegistry(): Registry {
);
},
render: (entry, args, element, isIteractive) => {
const context = JitContext({
lookupHelper: (name) => helpers.get(name)?.handle,
lookupModifier: (name) => modifiers.get(name)?.handle,
lookupComponent: (name) => components.get(name),
const sharedArtifacts = artifacts();
const context = syntaxCompilationContext(sharedArtifacts, {
lookupHelper: (name) => helpers.get(name)?.handle ?? null,
lookupModifier: (name) => modifiers.get(name)?.handle ?? null,
lookupComponent: (name) => components.get(name) ?? null,
lookupPartial: () => null,
resolve: () => null,
});
const component = components.get(entry);
if (!component) {
throw new Error(`missing ${entry} component`);
}

return renderBenchmark(
sharedArtifacts,
context,
{
resolve: (handle) => values[handle].definition,
resolve<U extends ComponentDefinition | Helper | ModifierDefinition | PartialDefinition>(
handle: number
): U {
return values[handle].definition as U;
},
lookupComponent: () => null,
lookupPartial: () => null,
compilable() {
throw new Error('not implemented');
},
},
component.definition,
component.compilable,
Expand Down
25 changes: 11 additions & 14 deletions packages/@glimmer/benchmark-env/src/benchmark/render-benchmark.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
import { SimpleElement } from '@simple-dom/interface';
import {
Dict,
RuntimeResolverDelegate,
RuntimeResolver,
SyntaxCompilationContext,
ComponentDefinition,
CompilableProgram,
RuntimeArtifacts,
} from '@glimmer/interfaces';
import { createConstRef, Reference, childRefFor } from '@glimmer/reference';
import {
NewElementBuilder,
JitRuntime,
JitSyntaxCompilationContext,
renderSync,
renderJitComponent,
} from '@glimmer/runtime';
import { NewElementBuilder, runtimeContext, renderComponent, renderSync } from '@glimmer/runtime';

import createEnvDelegate, { registerResult } from './create-env-delegate';
import { measureRender } from './util';
import { UpdateBenchmark } from '../interfaces';

export default async function renderBenchmark(
context: JitSyntaxCompilationContext,
runtimeResolverDelegate: RuntimeResolverDelegate,
artifacts: RuntimeArtifacts,
context: SyntaxCompilationContext,
runtimeResolver: RuntimeResolver,
component: ComponentDefinition,
layout: CompilableProgram,
root: Dict,
Expand All @@ -32,13 +29,13 @@ export default async function renderBenchmark(
await measureRender('render', 'renderStart', 'renderEnd', () => {
const document = element.ownerDocument;
const envDelegate = createEnvDelegate(isInteractive);
const runtime = JitRuntime(
const runtime = runtimeContext(
{
document,
},
envDelegate,
context,
runtimeResolverDelegate
artifacts,
runtimeResolver
);
const env = runtime.env;
const cursor = { element, nextSibling: null };
Expand All @@ -52,7 +49,7 @@ export default async function renderBenchmark(

const result = renderSync(
env,
renderJitComponent(runtime, treeBuilder, context, component, layout, args)
renderComponent(runtime, treeBuilder, context, component, layout, args)
);

registerResult(result, () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/@glimmer/benchmark-env/src/benchmark/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import {
} from '@glimmer/interfaces';
import { unwrapTemplate, unwrapHandle } from '@glimmer/util';
import { templateFactory } from '@glimmer/opcode-compiler';
import { JitSyntaxCompilationContext } from '@glimmer/interfaces';
import { SyntaxCompilationContext } from '@glimmer/interfaces';

export function createProgram(
template: SerializedTemplateWithLazyBlock<unknown>
): CompilableProgram {
return unwrapTemplate(templateFactory(template).create()).asLayout();
}

export function compileEntry(entry: CompileTimeComponent, context: JitSyntaxCompilationContext) {
export function compileEntry(entry: CompileTimeComponent, context: SyntaxCompilationContext) {
return unwrapHandle(entry.compilable!.compile(context));
}

Expand Down
1 change: 0 additions & 1 deletion packages/@glimmer/bundle-compiler/.npmignore

This file was deleted.

14 changes: 0 additions & 14 deletions packages/@glimmer/bundle-compiler/index.ts

This file was deleted.

Loading

0 comments on commit 622e35b

Please sign in to comment.