Commit Graph

5 Commits

Author SHA1 Message Date
saam barati
c90af30f0b 8-byte align bytecode ops
#rb yiliang.siew

We're soon gonna be storing to VValue/pointer fields in the bytecode stream that the GC will scan and the mutator will write to. Let's 8-byte align so we don't see tearing.

[CL 28779525 by saam barati in ue5-main branch]
2023-10-13 19:27:38 -04:00
yiliang siew
664fd7f23c Introduces VClass. Emergent types are vended by VClass when a new object is requested to be constructed given a class and the fields that are being overrriden.
- Opcodes now support having immediate operands.
- Fixes the indices not being generated correctly for object shapes.
- New opcodes `NewClass`, `NewObject`, `LoadField` and `UnifyField` for working with classes and objects.
- Some `const` cleanup of arguments.
- Also update UBT to disable the "first include must match in terms of filename" check on `VerseVM`, since it brings us no benefits and actively interferes with the way we do inline versions of our headers.

#rnx
#rb Saam.Barati
#rb Phil.Pizlo

[CL 28541942 by yiliang siew in ue5-main branch]
2023-10-06 11:32:14 -04:00
niklas rojemo
528b8e6d85 IR->bytecode lowering: map and iteration over maps
VerseCLR can now compile verse code with maps, and iterations over maps, to the new VM.
Fix unrelated bug triggered by nested for-iterations over arrays, returning an array of arrays.

#rb Saam.Barati
#rnx

[CL 27582449 by niklas rojemo in ue5-main branch]
2023-09-04 04:06:16 -04:00
saam barati
7157db4ca9 Don't allocate tuples unnecessarily for calls with multiple arguments
#rb markus.breyer

This patch makes it so calls with multiple arguments don't require a tuple allocation. We just allow functions to have multiple arguments and be called normally. However, when such functions are invoked with a tuple, we'll unbox the tuple into the argument slots.

We also allow functions with single-param-as-tuple to be invoked with multiple arguments. And such functions will box the arguments into a tuple when being called.

A function with N arguments now take up the first N register slots in the frame.

This patch also fills out some more of the bytecode generator to make some tests I wrote work.

[CL 27510491 by saam barati in ue5-main branch]
2023-08-30 20:56:02 -04:00
tim smith
d758896471 Move VerseVM to CoreUObject to facilitate the merging of UEGC and VerseGC
#rb saam.barati phil.pizlo

[CL 27374952 by tim smith in ue5-main branch]
2023-08-25 09:08:53 -04:00