-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use InternPool for all types and constant values #15569
Merged
Merged
Changes from all commits
Commits
Show all changes
205 commits
Select commit
Hold shift + click to select a range
9aec275
stage2: start the InternPool transition
andrewrk cac60a0
std.builtin: give some enums integer types
andrewrk c7e84dd
InternPool: flesh out some of the implementations
andrewrk 00f82f1
stage2: add `interned` AIR tag
andrewrk 50f3373
stage2: isGenericPoison InternPool awareness
andrewrk b125063
InternPool: implement typeHasOnePossibleValue for simple_type
andrewrk d1887ab
InternPool: implement hasRuntimeBitsAdvanced for simple_type
andrewrk cdf6acb
InternPool: implement hasWellDefinedLayout for simple_type
andrewrk 264292f
InternPool: implement resolveTypeFields
andrewrk e77dede
InternPool: implement typePtrOrOptionalPtrTy
andrewrk aa1bb55
InternPool: implement isSinglePointer
andrewrk 4cd8a40
stage2: move float types to InternPool
andrewrk bcd4bb8
stage2: move named int types to InternPool
andrewrk 836d8a1
stage2: move most simple types to InternPool
andrewrk ca3cf93
stage2: move most simple values to InternPool
andrewrk fb16ad3
Type: update to use InternPool for some methods
andrewrk 85c69c5
Type.isSlice: make it InternPool aware
andrewrk 9d422bf
stage2: move all integer types to InternPool
andrewrk 5e63664
stage2: move many Type encodings to InternPool
andrewrk 773fabf
InternPool: add the missing pointer data
andrewrk 6ab8b6f
stage2: move undef, unreach, null values to InternPool
andrewrk 41cdcd5
stage2: add a few more Value checks for InternPool
andrewrk 75cf06c
std.mem.alignForwardGeneric: manually inline the assertions
andrewrk ac07dda
InternPool: enhance integer values
andrewrk 2f05b14
Sema: update core comptime detection logic to be InternPool aware
andrewrk 70a4b76
std.builtin.AddressSpace: allocate one more bit to this enum
andrewrk 9ec0017
stage2: migrate many pointer types to the InternPool
andrewrk 0471638
InternPool: add a dump function
andrewrk ce3cffb
fill out more InternPool Type methods
andrewrk 3e6dd0d
stage2: add tmp_hack_arena for the InternPool transition
andrewrk 80bf5af
fix AIR printing of interned constants
andrewrk 08e9763
stage2: add missing comptimeOnly logic for InternPool
andrewrk 31aee50
InternPool: add a slice encoding
andrewrk 9626811
Sema: add typeHasOnePossibleValue logic for InternPool
andrewrk 6350aab
InternPool: fix bug in addLimbsExtraAssumeCapacity
andrewrk 27d641e
stage2: fix interned integer value printing
andrewrk f7bd427
LLVM backend: update integer constant lowering for InternPool
andrewrk 73720b6
Sema: update onePossibleValue for InternPool
andrewrk 75900ec
stage2: move integer values to InternPool
andrewrk 6c713b4
InternPool: add an encoding for arrays with sentinels
andrewrk 9d9e1a2
InternPool: implement indexToKey and equality for int values
andrewrk c1ca16d
wip: progress towards compiling tests
mlugg 4c3c605
InternPool: add getCoercedInt to avoid copy in Sema
andrewrk 2ffef60
Replace uses of Value.zero, Value.one, Value.negative_one
mlugg 8699cdc
InternPool: fix UAF in getCoercedInt and add u16 int value encoding
andrewrk a5fb169
stage2: bug fixes related to Type/Value/InternPool
andrewrk 4d88f82
stage2: implement intTagType logic
andrewrk 4fe0c58
stage2: more InternPool-related fixes
andrewrk 2f9b7dc
InternPool: add an int_u8 value encoding
andrewrk 3116477
stage2: move empty struct type and value to InternPool
andrewrk 8587e51
stage2: more InternPool related fixes
andrewrk ad06b24
Sema: introduce Value.enum_field_0
andrewrk fd674d9
InternPool: add indexToKey for empty struct types
andrewrk 68b95a3
InternPool: add ptr-to-int value
andrewrk e94a81c
InternPool: add optional values
andrewrk 275652f
stage2: move opaque types to InternPool
andrewrk 8297f28
stage2: move struct types and aggregate values to InternPool
andrewrk 3ba099b
stage2: move union types and values to InternPool
andrewrk 1c7095c
add std.hash.uint32
andrewrk 50bebb9
InternPool: ability to encode enums
andrewrk 404cbc3
InternPool: fix deinit leaking inner maps
andrewrk 5881a2d
stage2: move enum types into the InternPool
andrewrk 466328d
InternPool: transition float values
mlugg d89807e
stage2: remove legacy Type array and array_sentinel
andrewrk 88dbd62
stage2: move enum tag values into the InternPool
andrewrk d18881d
stage2: move anon tuples and anon structs to InternPool
andrewrk 6a9a918
stage2: encode one-possible-value tuple specially
andrewrk 1788216
stage2: move function types to InternPool
andrewrk f21ca3d
compiler: move `anyframe->T` to InternPool
andrewrk 607737d
compiler: eliminate legacy Type.Tag.optional
andrewrk 7bf91fc
compiler: eliminate legacy Type.Tag.pointer
andrewrk 9ff514b
compiler: move error union types and error set types to InternPool
andrewrk d28fc5b
InternPool: add repeated aggregate storage
jacobly0 f8b6eb6
Sema: add coerceTupleToStruct result to the InternPool
jacobly0 c473594
Sema: port reify struct access to use InternPool
jacobly0 be78a12
Sema: port Value.decl_ptr to InternPool
jacobly0 115c089
Value: add `intern` and `unintern` to facilitate code conversion
jacobly0 dfb3521
compiler: remove var_args_param_type from SimpleType
andrewrk 65d65f5
Module: remove tmp_hack_arena
andrewrk 7e19c95
Sema: move `inferred_alloc_const/mut_type` to InternPool
andrewrk e4d498c
InternPool: add missing ensureCapacity call with enums
andrewrk 25cd4bb
Type: hack around `isNoReturn` queries for the remaining legacy tags
jacobly0 cbf304d
InternPool: fix coersion issues
jacobly0 dfd91ab
InternPool: add more pointer values
jacobly0 9584fea
InternPool: fix logic bugs
jacobly0 be1b231
InternPool: add missing logic
jacobly0 84099e5
TypedValue: fix debug print crashes
jacobly0 a6fcf46
Value: remove legacy type values
jacobly0 a7c3ca3
InternPool: add lldb pretty printing for indices
jacobly0 484c3e8
llvm: fix incorrect slice lowering
jacobly0 1b64eed
remove the kludges from std.builtin
andrewrk 01ca841
Sema: improve the types_to_resolve mechanism
andrewrk 2052260
Sema: update zirSliceLength to avoid resolveInst(.none)
andrewrk 5555bdc
InternPool: support int->comptime_int in getCoerced
andrewrk 6e0de1d
InternPool: port most of value tags
jacobly0 1a4626d
InternPool: remove more legacy values
jacobly0 72e4ea3
InternPool: fix crashes up to in progress comptime mutation
jacobly0 70cc68e
Air: remove constant tag
jacobly0 5d0d589
Sema: fix some issues with the inferred alloc tag change
jacobly0 f37c0a4
Sema: inferred allocations no longer abuse type/value system
andrewrk 9a738c0
Module: intern the values of decls when they are marked alive
jacobly0 9afa974
InternPool: fix enough crashes to run `build-obj` on a simple program
jacobly0 66c4396
AIR: eliminate the `values` array
andrewrk f2c7161
InternPool: fix more crashes
jacobly0 abded5c
TypedValue: implement more prints
jacobly0 63dc044
wasm: fix error union constant lowering
andrewrk ace5a5e
llvm: simplify control flow lowering structs
andrewrk d5f0ee0
codegen: fix lowering of constant structs
andrewrk 9cd0ca9
Module: rename functions to make ownership checks explicit
jacobly0 1dc01f1
InternPool: fix build-exe and compiler-rt crashes
jacobly0 e156c1c
InternPool: correct the logic for struct size dump
andrewrk 270f9e2
AstGen: generate tests with anyerror!void
andrewrk 8011faa
compiler: fix populateTestFunctions InternPool usage
andrewrk a596ea6
CLI: introduce --verbose-intern-pool
andrewrk fc35843
C backend: InternPool fixes
andrewrk c8b0d4d
InternPool: optimize zigTypeTag()
andrewrk 2d5bc01
behavior: get more test cases passing with llvm
jacobly0 d40b83d
behavior: pass more tests on llvm again
jacobly0 3b6ca1d
Module: move memoized data to the intern pool
jacobly0 3064d2a
behavior: additional llvm fixes
jacobly0 3269256
behavior: fix more compiler crashes
jacobly0 4f70863
InternPool: fix various pointer issues
jacobly0 a702af0
x86_64: fix InternPool regressions
jacobly0 5580a69
cbe: fix InternPool regressions
jacobly0 804740a
InternPool: avoid indexToKey recursion for type_slice
andrewrk b336866
InternPool: avoid indexToKey recursion for ptr_elem,ptr_field
andrewrk f2778f7
InternPool: avoid indexToKey recursion for only_possible_value
andrewrk f7177fb
InternPool: avoid indexToKey recursion for opt_payload
andrewrk 55cda9a
InternPool: avoid indexToKey recursion for ptr_slice
andrewrk 66ae42b
Sema: fix pointer arithmetic on single array pointers
jacobly0 a803e9c
Sema: fix vector comparison and interning of -0
jacobly0 27f1ad8
Module: add allowzero canonicalization to pointer types
jacobly0 66f83f2
InternPool: avoid indexToKey recursion for type_enum_auto
andrewrk 61978c8
InternPool: eliminate indexToKey call graph cycle
andrewrk d0cd1c8
Sema: port lazy value usage to be InternPool aware
jacobly0 f673c98
Sema: fix sus overflow behavior in RangeSetUnhandledIterator
jacobly0 494d4f9
behavior: update for different inferred error set order
jacobly0 6b81546
Type: fix `@typeName` for `undefined`
jacobly0 90a877f
InternPool: pass by const pointer
andrewrk c7d65fa
std.hash: add xxhash to benchmark and fix its API
andrewrk 82f6f16
InternPool: improve hashing performance
andrewrk 91fb45a
Sema: fix comptime error set comparisons
jacobly0 1430ac2
Type: fix `@sizeOf(?anyerror)`
jacobly0 99531b0
Sema: make sentinel load through array pointer comptime known
jacobly0 a0d4ef0
InternPool: add representation for value of empty enums and unions
mlugg aed142e
InternPool: further optimize Key hashing
andrewrk d019229
Sema: avoid invalided key access
jacobly0 26fac15
math.big.int: fix ctz of zero
jacobly0 71c4077
Value: fix null test for c pointers
jacobly0 b2391a7
Sema: remove opv status from arrays with sentinels
jacobly0 870e384
Sema: elide comptime-checked slice safety
andrewrk bb52642
InternPool: remove memoized_decl
andrewrk c82a04d
InternPool: debug dump all the data
andrewrk 08ae212
InternPool: fix key for empty array with sentinel
jacobly0 828756c
InternPool: fix element pointer type computations
jacobly0 123cfab
codegen: fix doubled global sentinels
jacobly0 a3b3ac0
llvm: fix lowering of lazy values
jacobly0 0777e98
Sema: disable repeated aggregate storage use with mismatching sentinel
jacobly0 cab79b0
lib: add const to avoid regression
jacobly0 9b48fc2
Allocate capture scopes in gpa instead of Decl.value_arena
mlugg 8299ddf
InternPool: fix more key lifetime issues
jacobly0 e217442
wasm: implement missing case
jacobly0 dc18739
process: add more missing const
jacobly0 e8bcdca
Sema: fix in-memory coercion during comptime load
jacobly0 e017964
Sema: intern values of mutable decls after analysis
mlugg 34dae73
std.hash: auto hash signed ints as bitcasts of unsigned ints
andrewrk 69b7b91
compiler: eliminate Decl.value_arena and Sema.perm_arena
andrewrk f1c900c
compiler: avoid use of undefined memory
andrewrk 35550c8
Module: fix populateTestFunctions UAF
andrewrk bc3b56f
llvm: fix undefined pointer type
jacobly0 fdfe730
InternPool: fix more key lifetime issues
jacobly0 04e66e6
InternPool: add optional coercion
jacobly0 da24ea7
Sema: rewrite `monomorphed_funcs` usage
jacobly0 7a59cd2
Sema: hack around UAF
jacobly0 0f80652
Sema: remove leftover references to value_arena
mlugg 0fd52cd
InternPool: avoid aggregate null bytes storage
mlugg ad54f47
InternPool: optimize previous fix
jacobly0 6a15fc8
Sema: handle generic types when coercing functions in memory
jacobly0 e23b0a0
InternPool: fix yet more key lifetime issues
jacobly0 7c12e06
Sema: reword compile error about LLVM extensions and C import
andrewrk ab86b20
std.hash: improve small-key hashing in Wyhash
andrewrk 2a6b918
stage2: pass most test cases under InternPool
mlugg 7702af5
Sema: fix int arithmetic overflow checks
mlugg dce80f6
Sema: fix crashes accessing undefined values
jacobly0 44d8cf9
wasm: address behavior test regressions
jacobly0 f94c668
langref: fix error set order
jacobly0 a01bc77
llvm: fix name lifetime
jacobly0 b9a4eae
llvm: fix more name lifetimes
jacobly0 0ec012e
TypedValue: fix code formatting
jacobly0 7e5dea6
Sema: fix `std.builtin.Type.EnumField.value` when not auto-numbered
jacobly0 7507a76
link: use `Wasm.string_table` offsets for `Wasm.undefs` keys
jacobly0 2afc689
Sema: fix condition for emitting noreturn safety check
jacobly0 6360402
stage2: fix InternPool compile errors on 32-bit targets
mlugg 5b6906c
InternPool: fix dbHelper after 4976b58
mlugg 54460e3
Autodoc: make it work under InternPool
mlugg d37ebfc
InternPool: avoid as many slices pointing to `string_bytes` as possible
jacobly0 028f2ed
InternPool: fix one more compile error on 32-bit targets
jacobly0 9e61ba1
std.crypto.tls.Client: fix @memcpy crash in limitedOverlapCopy
mlugg 415dbe9
link: fix compile error with only-c
mlugg 1ec1498
build: add -Dno-bin option
mlugg 52e7934
std.dwarf: fix findCompileUnit when ranges offset is given by const
mlugg 3d48c40
Sema: redo monomorphed funcs to make more sense
jacobly0 ff35a18
Sema: intern values from resolved inferred allocs
mlugg 4b7c1e5
tools: add LLDB pretty printer for InternPool.NullTerminatedString
mlugg 2ad073e
link/Plan9: fix UAF of symbol names
andrewrk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This article was updated to point to skeeto/hash-prospector#19 for an improved function - skeeto/hash-prospector#19 (comment) or the previous comment on that issue seem to be the latest and greatest:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!