Skip to content

Commit 1907916

Browse files
committed
cleanup? does ai know what cleanup is?
1 parent 707775f commit 1907916

15 files changed

Lines changed: 31 additions & 88 deletions

File tree

packages/@glimmer-workspace/integration-tests/lib/compile.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ export function createTemplate(
2828
usedLocals.map((key) => [key, scopeValues[key]])
2929
);
3030

31-
if ('emit' in options && options.emit?.debugSymbols) {
32-
block.push(usedLocals);
33-
}
34-
3531
let templateBlock: SerializedTemplateWithLazyBlock = {
3632
id: String(templateId++),
3733
block: JSON.stringify(block),

packages/@glimmer/compiler/lib/compiler.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,6 @@ export function precompile(
119119
): TemplateJavascript {
120120
const [block, usedLexicals] = precompileJSON(source, options);
121121

122-
if ('emit' in options && options.emit?.debugSymbols && usedLexicals.length > 0) {
123-
block.push(usedLexicals);
124-
}
125-
126122
const moduleName = options.meta?.moduleName;
127123
const idFn = options.id || defaultId;
128124
const blockJSON = JSON.stringify(block);

packages/@glimmer/compiler/lib/passes/2-encoding/content.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class ContentEncoder {
5656
private visitContent(stmt: mir.Statement): WireFormat.Statement | WireStatements {
5757
switch (stmt.type) {
5858
case 'Debugger':
59-
return [SexpOpcodes.Debugger, ...stmt.scope.getDebugInfo()];
59+
return [SexpOpcodes.Debugger, stmt.scope.getDebugInfo()];
6060
case 'AppendComment':
6161
return this.AppendComment(stmt);
6262
case 'AppendTextNode':

packages/@glimmer/debug/lib/dism/opcode.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,7 @@ import { array } from '../render/combinators';
2121
import { as, frag, Fragment } from '../render/fragment';
2222

2323
export class SerializeBlockContext {
24-
readonly #symbols: Nullable<BlockSymbolNames>;
25-
26-
constructor(symbols: Nullable<BlockSymbolNames>) {
27-
this.#symbols = symbols;
28-
}
24+
constructor(_symbols: Nullable<BlockSymbolNames>) {}
2925

3026
serialize(param: SomeDisassembledOperand): IntoFragment {
3127
switch (param.type) {
@@ -47,12 +43,6 @@ export class SerializeBlockContext {
4743
const value = param.value;
4844
if (value === 0) {
4945
return frag`{${as.kw('this')}}`;
50-
} else if (this.#symbols?.lexical && this.#symbols.lexical.length >= value) {
51-
// @fixme something is wrong here -- remove the `&&` to get test failures
52-
return frag`${as.varReference(
53-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- @fixme
54-
this.#symbols.lexical[value - 1]!
55-
)}${frag`:${value}`.subtle()}`;
5646
} else {
5747
return frag`{${as.register('$fp')}+${value}}`;
5848
}
@@ -87,8 +77,6 @@ export class SerializeBlockContext {
8777
case 'variable': {
8878
if (value === 0) {
8979
return `{this}`;
90-
} else if (this.#symbols?.lexical && this.#symbols.lexical.length >= (value as number)) {
91-
return `{${this.#symbols.lexical[(value as number) - 1]}:${value}}`;
9280
} else {
9381
return `{$fp+${value}}`;
9482
}

packages/@glimmer/debug/lib/dism/operands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ export const OPERANDS = Disassembler.build((d) => {
9191
])
9292
.add(['register'], ({ value }) => ['register', decodeRegister(value)])
9393
.add(['const/any'], ({ value, constants }) => ['dynamic', constants.getValue<unknown>(value)])
94-
.add(['variable'], ({ value, meta }) => {
95-
return ['variable', value, { name: meta?.symbols.lexical?.at(value) ?? null }];
94+
.add(['variable'], ({ value }) => {
95+
return ['variable', value, { name: value === 0 ? 'this' : null }];
9696
})
9797
.add(['register/instruction'], ({ value }) => ['instruction', value])
9898
.add(['imm/enum<curry>'], ({ value }) => ['enum<curry>', decodeCurry(value)])

packages/@glimmer/debug/lib/render/basic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function value(item: unknown, options?: ValueRefOptions): Fragment {
6363
table.parameters.length === 0
6464
? empty()
6565
: frag` as |${join(
66-
table.parameters.map((s) => item.meta.symbols.lexical?.at(s - 1) ?? `?${s}`),
66+
table.parameters.map((s) => `?${s}`),
6767
' '
6868
)}|`;
6969
return debugValue(item, {

packages/@glimmer/interfaces/lib/compile/operands.d.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ export interface IsStrictModeOperand {
3333

3434
export interface DebugSymbolsOperand {
3535
type: DebugSymbolsOperandType;
36-
value: {
37-
locals: Record<string, number>;
38-
upvars: Record<string, number>;
39-
lexical: Record<string, number>;
40-
};
36+
value: Record<string, number>;
4137
}
4238

4339
export interface BlockOperand {

packages/@glimmer/interfaces/lib/compile/wire-format/api.d.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ export type SexpOpcode = keyof SexpOpcodeMap;
7272
export namespace Core {
7373
export type Expression = Expressions.Expression;
7474

75-
export type DebugSymbols = [
76-
locals: Record<string, number>,
77-
upvars: Record<string, number>,
78-
lexical: Record<string, number>,
79-
];
75+
export type DebugSymbols = Record<string, number>;
8076

8177
export type CallArgs = [Params, Hash];
8278
export type Path = [string, ...string[]];
@@ -259,12 +255,7 @@ export namespace Statements {
259255
| TrustingDynamicAttr
260256
| TrustingComponentAttr;
261257

262-
export type Debugger = [
263-
op: DebuggerOpcode,
264-
locals: Record<string, number>,
265-
upvars: Record<string, number>,
266-
lexical: Record<string, number>,
267-
];
258+
export type Debugger = [op: DebuggerOpcode, locals: Record<string, number>];
268259
export type InElement = [
269260
op: InElementOpcode,
270261
block: SerializedInlineBlock,
@@ -375,9 +366,8 @@ export type SerializedInlineBlock = [statements: Statements.Statement[], paramet
375366
*/
376367
export type SerializedTemplateBlock = [
377368
statements: Statements.Statement[],
378-
locals: string[],
369+
symbols: string[],
379370
upvars: string[],
380-
lexicalSymbols?: string[],
381371
];
382372

383373
/**

packages/@glimmer/interfaces/lib/template.d.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { PresentArray } from './array.js';
22
import type { EncoderError } from './compile/encoder.js';
33
import type { Operand, SerializedInlineBlock, SerializedTemplateBlock } from './compile/index.js';
4-
import type { Nullable, Optional } from './core.js';
4+
import type { Nullable } from './core.js';
55
import type { InternalComponentCapabilities } from './managers/internal/component.js';
66
import type { ConstantPool, EvaluationContext, SerializedHeap } from './program.js';
77
import type { Owner } from './runtime.js';
@@ -105,16 +105,10 @@ export interface CompilableTemplate<S extends SymbolTable = SymbolTable> {
105105
}
106106

107107
export interface BlockSymbolNames {
108-
locals: Nullable<string[]>;
109-
lexical?: Optional<string[]>;
110108
upvars: Nullable<string[]>;
111109
}
112110

113-
export interface DebuggerInfo {
114-
locals: Record<string, number>;
115-
lexical: Record<string, number>;
116-
upvars: Record<string, number>;
117-
}
111+
export type DebuggerInfo = Record<string, number>;
118112

119113
export interface BlockMetadata {
120114
symbols: BlockSymbolNames;

packages/@glimmer/opcode-compiler/lib/opcode-builder/helpers/shared.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,16 @@ export function CompilePositional(
106106
}
107107

108108
export function meta(layout: LayoutWithContext): BlockMetadata {
109-
let [, locals, upvars, lexicalSymbols] = layout.block;
109+
let [, symbols, upvars] = layout.block;
110110

111111
return {
112112
symbols: {
113-
locals,
114113
upvars,
115-
lexical: lexicalSymbols,
116114
},
117115
scopeValues: layout.scope?.() ?? null,
118116
isStrictMode: layout.isStrictMode,
119117
moduleName: layout.moduleName,
120118
owner: layout.owner,
121-
size: locals.length,
119+
size: symbols.length,
122120
};
123121
}

0 commit comments

Comments
 (0)