-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lots of documentation and clarity improvements
- Loading branch information
Showing
31 changed files
with
580 additions
and
308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/@glimmer-workspace/benchmark-env/lib/benchmark/util.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export class VmSnapshot {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import type { JitConstants, RuntimeHeap } from '../program.js'; | ||
import type { Stack } from '../stack.js'; | ||
import type { BlockMetadata } from '../template.js'; | ||
import type { DynamicScope, Scope } from './scope.js'; | ||
import type { UpdatingBlockOpcode, UpdatingOpcode } from './vm.js'; | ||
import type { $fp, $pc, $ra, $s0, $s1, $sp, $t0, $t1, $v0 } from './vm-state.js'; | ||
|
||
export interface DebugRegisters extends Array<unknown> { | ||
[$pc]: number; | ||
[$ra]: number; | ||
[$fp]: number; | ||
[$sp]: number; | ||
[$s0]: unknown; | ||
[$s1]: unknown; | ||
[$t0]: unknown; | ||
[$t1]: unknown; | ||
[$v0]: unknown; | ||
} | ||
|
||
/** | ||
* All parts of `DebugVmState` are _snapshots_. They will not change if the piece of VM state that | ||
* they reference changes. | ||
*/ | ||
export interface DebugVmState { | ||
readonly stacks: DebugStacks; | ||
readonly destroyableStack: object[]; | ||
readonly constants: JitConstants; | ||
|
||
/** | ||
* These values can change for each opcode | ||
*/ | ||
readonly state: { | ||
readonly stack: unknown[]; | ||
readonly registers: DebugRegisters; | ||
}; | ||
|
||
/** | ||
* These values are the same for the entire program | ||
*/ | ||
readonly program: { | ||
readonly heap: RuntimeHeap; | ||
}; | ||
|
||
/** | ||
* These values change whenever the VM moves to a new block | ||
*/ | ||
readonly block: { | ||
readonly metadata: BlockMetadata | null; | ||
}; | ||
} | ||
|
||
export interface DebugStacks { | ||
scope: Stack<Scope>; | ||
dynamicScope: Stack<DynamicScope>; | ||
updating: Stack<UpdatingOpcode[]>; | ||
cache: Stack<UpdatingOpcode>; | ||
list: Stack<UpdatingBlockOpcode>; | ||
} | ||
|
||
// class Stacks { | ||
// readonly scope = new Stack<Scope>(); | ||
// readonly dynamicScope = new Stack<DynamicScope>(); | ||
// readonly updating = new Stack<UpdatingOpcode[]>(); | ||
// readonly cache = new Stack<JumpIfNotModifiedOpcode>(); | ||
// readonly list = new Stack<ListBlockOpcode>(); | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
export interface SyscallRegisters extends Array<unknown> { | ||
[$pc]: null; | ||
[$ra]: null; | ||
[$fp]: null; | ||
[$sp]: null; | ||
[$s0]: unknown; | ||
[$s1]: unknown; | ||
[$t0]: unknown; | ||
[$t1]: unknown; | ||
[$v0]: unknown; | ||
} | ||
|
||
/** | ||
* Registers | ||
* | ||
* For the most part, these follows MIPS naming conventions, however the | ||
* register numbers are different. | ||
*/ | ||
|
||
// $0 or $pc (program counter): pointer into `program` for the next insturction; -1 means exit | ||
export type $pc = 0; | ||
declare const $pc: $pc; | ||
// $1 or $ra (return address): pointer into `program` for the return | ||
export type $ra = 1; | ||
declare const $ra: $ra; | ||
// $2 or $fp (frame pointer): pointer into the `evalStack` for the base of the stack | ||
export type $fp = 2; | ||
declare const $fp: $fp; | ||
// $3 or $sp (stack pointer): pointer into the `evalStack` for the top of the stack | ||
export type $sp = 3; | ||
declare const $sp: $sp; | ||
// $4-$5 or $s0-$s1 (saved): callee saved general-purpose registers | ||
export type $s0 = 4; | ||
declare const $s0: $s0; | ||
export type $s1 = 5; | ||
declare const $s1: $s1; | ||
// $6-$7 or $t0-$t1 (temporaries): caller saved general-purpose registers | ||
export type $t0 = 6; | ||
declare const $t0: $t0; | ||
export type $t1 = 7; | ||
declare const $t1: $t1; | ||
// $8 or $v0 (return value) | ||
export type $v0 = 8; | ||
declare const $v0: $v0; | ||
|
||
export type MachineRegister = $pc | $ra | $fp | $sp; | ||
|
||
export type SavedRegister = $s0 | $s1; | ||
export type TemporaryRegister = $t0 | $t1; | ||
|
||
export type Register = MachineRegister | SavedRegister | TemporaryRegister | $v0; | ||
export type SyscallRegister = SavedRegister | TemporaryRegister | $v0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.