dart-sdk/tests/language_2
Alexander Aprelev 8c0df46887 [vm] Better implementation of hashCode function.
With this cl hashCode function for integers which used to be identity function becomes `uint128_t hash = value * constant; hash ^= hash >> 64; hash ^= hash >> 32; hash &= 0x3fffffff`. Note that the hashCode has to stay the same across platforms(64-bit/32-bit).

This dramatically improves performance of integer HashSet/HashMap lookups when integers differ in higher bits only(see the issue referenced below).

AOT ARM64 benchmarks:
===
WordSolverIdentity -3.630% (-0.9 noise)
BigInt.parse.0064.bits 15.43% (0.9 noise)
BigInt.parse.4096.bits 40.80% (1.6 noise)
BigInt.parse.0256.bits 42.01% (2.3 noise)
BigInt.parse.1024.bits 50.91% (2.6 noise)
IntegerSetLookup.DefaultHashSet 549916% (14727.6 noise)
IntegerSetLookup.DefaultHashSet 597150% (55520.2 noise)
IntegerSetLookup.HashSet 846924% (78126.7 noise)
IntegerSetLookup.HashSet 791864% (107221.1 noise)
===

AOT x64:
===
Havlak -14.25% (-1.7 noise)
DartMicroBench.Int64Div -7.091% (-1.2 noise)
ObjectHash.manual.5 -9.541% (-0.8 noise)
AsyncLiveVars.LiveInt1 4.726% (0.8 noise)
IsolateJson.SendAndExit_Decode1MBx1 9.067% (0.8 noise)
SplayHarderLatency 4.629% (0.9 noise)
TypedDataDuplicate.Float64List.32.loop 35.01% (1.8 noise)
IntegerSetLookup.DefaultHashSet 627996% (124823.6 noise)
IntegerSetLookup.HashSet 1245362% (244705.3 noise)
===

JIT ARM64:
===
IntegerSetLookup.DefaultHashSet_Random 73.80% (1.2 noise)
IntegerSetLookup.DefaultHashSet 344999% (6202.9 noise)
IntegerSetLookup.HashSet 483731% (7845.7 noise)
===

JIT x64:
===
CollectionSieves-Set-removeLoop -6.294% (-0.9 noise)
Utf8Encode.ru.10M 59.11% (0.8 noise)
Utf8Encode.ru.10k 71.62% (0.9 noise)
Utf8Encode.zh.10M 53.93% (0.9 noise)
Utf8Encode.ne.10k 71.34% (0.9 noise)
Utf8Encode.zh.10k 72.52% (0.9 noise)
Utf8Encode.ne.10M 53.17% (0.9 noise)
IntegerSetLookup.HashSet_Random 27.80% (1.1 noise)
String.replaceAll.String.Zero 8.659% (1.2 noise)
IntegerSetLookup.DefaultHashSet_Random 96.20% (1.3 noise)
IntegerSetLookup.HashSet 481037% (18028.8 noise)
IntegerSetLookup.DefaultHashSet 454450% (31501.3 noise)
==

Fixes https://github.com/dart-lang/sdk/issues/48641
TEST=ci

Change-Id: Id982e4aa30cd1d6a63f93c73917a8b921ad464a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258600
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2022-10-20 20:31:20 +00:00
..
abstract [test] Replace non-implemented @DontInline() annotations 2021-07-26 13:22:31 +00:00
accessor_conflict Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
argument [analyzer] NOT_ENOUGH_POSITIONAL_ARGUMENTS 2022-10-11 17:56:11 +00:00
assert Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
assign Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
async [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
async_nested Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
async_star Fixed various typos in a lot of files 2022-07-25 12:21:59 +00:00
await [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
bool Fix context type for conditionals of conditional expressions. 2022-01-24 01:25:38 +00:00
call [analyzer] NOT_ENOUGH_POSITIONAL_ARGUMENTS 2022-10-11 17:56:11 +00:00
canonicalize Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
cascade Remove nbsp 2022-10-17 08:18:49 +00:00
class [cfe] Add UnresolvedKind for fine grained unresolved reporting 2021-08-25 09:51:54 +00:00
closure [tests] Add regression tests for #46568 2021-07-19 21:49:49 +00:00
compile_time_constant [analyzer] NOT_ENOUGH_POSITIONAL_ARGUMENTS 2022-10-11 17:56:11 +00:00
const Fixed various typos in a lot of files 2022-07-25 12:21:59 +00:00
constants_2018 Fixed various typos in a lot of files 2022-07-25 12:21:59 +00:00
constructor [analyzer] NOT_ENOUGH_POSITIONAL_ARGUMENTS 2022-10-11 17:56:11 +00:00
control_flow_collections Simplify asyncExpectThrows and enhance Expect.throws. 2022-01-06 17:06:47 +00:00
covariant Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
covariant_override Fix typos 2022-06-15 11:08:28 +00:00
deferred Reapply "Account for @pragma("vm:entry-point") creating additional "root" libraries when partitioning the program into loading units." 2022-06-27 18:56:12 +00:00
double Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
double_literals Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
dynamic [vm] Better implementation of hashCode function. 2022-10-20 20:31:20 +00:00
enum Roll dart_style 2.2.2 into the repo. 2022-03-04 13:06:42 +00:00
exception Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
export [test] Fix bug in export/duplicate_import_libd 2021-06-30 07:44:52 +00:00
extension_methods Fix typos 2022-06-10 15:48:54 +00:00
factory [cfe] Add UnresolvedKind for fine grained unresolved reporting 2021-08-25 09:51:54 +00:00
field [dart2wasm] Initialize the function class early. 2022-03-18 17:44:57 +00:00
final Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
fixed_size_int master branch to main 2021-09-15 06:22:23 +00:00
function Issue 46062. Report TYPE_ALIAS_CANNOT_REFERENCE_ITSELF on the name of the alias. 2021-05-19 15:45:21 +00:00
function_subtype [tests] Add nested function subtype test 2021-09-21 19:16:37 +00:00
function_type Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
generic [cfe] Refactor bounds checking 2022-05-17 14:36:19 +00:00
generic_methods [cfe] Refactor bounds checking 2022-05-17 14:36:19 +00:00
getter Fix reporting of INSTANCE_ACCESS_TO_STATIC_MEMBER from within an extension. 2021-10-17 06:22:30 +00:00
identifier [cfe] Refactor TypeBuilders 2022-03-28 18:22:50 +00:00
identity Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
if Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
if_null [cfe] Add UnresolvedKind for fine grained unresolved reporting 2021-08-25 09:51:54 +00:00
implicit_creation Fix typos 2022-04-28 12:53:43 +00:00
implicit_downcast_during Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
import [cfe] Add UnresolvedKind for fine grained unresolved reporting 2021-08-25 09:51:54 +00:00
inference Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
inference_update_2 Fix test to account for obfuscation 2022-09-28 19:24:26 +00:00
initializer_assert
initializing_formal Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
instance [cfe] Add UnresolvedKind for fine grained unresolved reporting 2021-08-25 09:51:54 +00:00
instantiate_to_bound master branch to main 2021-09-15 06:22:23 +00:00
interceptor Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
interface [cfe] Add UnresolvedKind for fine grained unresolved reporting 2021-08-25 09:51:54 +00:00
invalid_returns master branch to main 2021-09-15 06:22:23 +00:00
is [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
label [parser] Add beforeSynthetic to SyntheticStringToken 2021-08-30 11:56:30 +00:00
lazy Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
least_upper_bound Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
library [gardening] Fix env_test/has_mirror_support. 2022-01-14 23:33:11 +00:00
list Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
loop Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
main Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
malbounded [cfe] Refactor bounds checking 2022-05-17 14:36:19 +00:00
malformed [cfe] Refactor TypeBuilders 2022-03-28 18:22:50 +00:00
map [js_runtime] Use custom hashCode for GeneralConstantMap 2021-07-16 22:58:02 +00:00
metadata [cfe] Refactor detection of instance type variable access in static context 2021-10-05 11:58:04 +00:00
method [cfe] Add UnresolvedKind for fine grained unresolved reporting 2021-08-25 09:51:54 +00:00
mixin Fix typos 2022-06-15 11:08:28 +00:00
mixin_constructor_forwarding Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
mixin_declaration Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
new [cfe] Add UnresolvedKind for fine grained unresolved reporting 2021-08-25 09:51:54 +00:00
no_such_method Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
nosuchmethod_forwarding master branch to main 2021-09-15 06:22:23 +00:00
null [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
null_aware Flag additional code as unreachable due to types Null and Never. 2022-08-22 16:50:19 +00:00
number [cfe] Add UnresolvedKind for fine grained unresolved reporting 2021-08-25 09:51:54 +00:00
operator Deprecate IntegerDivisionByZeroException. 2021-10-19 16:07:52 +00:00
optimize [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
override Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
parameter [analyzer] NOT_ENOUGH_POSITIONAL_ARGUMENTS 2022-10-11 17:56:11 +00:00
part Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
prefix [cfe] Add UnresolvedKind for fine grained unresolved reporting 2021-08-25 09:51:54 +00:00
private [cfe] Add UnresolvedKind for fine grained unresolved reporting 2021-08-25 09:51:54 +00:00
propagate Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
redirecting Remove references to dartfmt in various comments and docs. 2021-10-01 00:56:14 +00:00
reg_exp Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
regress [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
resolution Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
return Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
rewrite Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
script Delete unused files in test folders. 2021-05-19 08:05:05 +00:00
set_literals Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
setter Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
spread_collections Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
stack_trace Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
static [ddc] Adding support for static setters of const fields 2022-04-01 23:51:15 +00:00
string [parser-ish] Better errors on invalid unicode escapes 2022-03-17 13:57:45 +00:00
subtyping_dynamic
subtyping_static Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
super Remove INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES warnings 2022-10-04 18:23:10 +00:00
superinterface_variance Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
switch Reland "Reland "[vm/compiler] Optimize switch statements"" 2022-08-23 22:11:50 +00:00
symbol Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
sync_star Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
syntax Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
this Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
top_level Delete unused files in test folders. 2021-05-19 08:05:05 +00:00
type [cfe] Check primitive equals in legacy libraries 2022-02-10 22:13:14 +00:00
type_object Fix typos 2022-06-15 11:08:28 +00:00
type_promotion Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
type_variable [cfe] Refactor bounds checking 2022-05-17 14:36:19 +00:00
typedef Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
unsorted [test] Replace non-implemented @DontInline() annotations 2021-07-26 13:22:31 +00:00
variable Report fewer duplicate errors for invalid superinitializers 2021-11-08 18:53:42 +00:00
vm [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
void master branch to main 2021-09-15 06:22:23 +00:00
await_type_error_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
await_type_test.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
dynamic_type_helper.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
language_2.status [testing] Remove --compiler=none from test.py 2022-10-19 08:09:58 +00:00
language_2_analyzer.status Update all Slow tests to be Slow, Pass. 2020-02-01 00:17:42 +00:00
language_2_dart2js.status Add a language test to check situations where implicit call tearoff does not occur. 2022-02-15 16:37:50 +00:00
language_2_dartdevc.status [ddc] Ensure status file entries are consistent 2022-08-08 17:23:50 +00:00
language_2_kernel.status [gardening] Mark all tests as slow in debug-ia32 mode 2022-07-21 10:22:45 +00:00
language_2_precompiled.status [vm] Fix yield in async* to check if the stream was canceled while generator was suspended 2022-07-15 14:09:20 +00:00
language_2_spec_parser.status [SDK] Removes non-exiting tests from .status 2021-02-04 06:46:13 +00:00
language_2_vm.status [vm] Fix yield in async* to check if the stream was canceled while generator was suspended 2022-07-15 14:09:20 +00:00
library1.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
library2.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
library10.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
library11.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
library12.dart Add language versions to _2 test libraries 2021-04-26 17:58:57 +00:00
record_literal_problems_test.dart [parser] Empty record 2022-10-06 06:34:58 +00:00
record_literal_test.dart [cfe] Use reportIfNotEnabled in endRecordLiteral 2022-10-04 09:30:07 +00:00
record_type_problems_test.dart [parser] Empty record 2022-10-06 06:34:58 +00:00
record_type_test.dart [cfe] Use reportIfNotEnabled in endRecordLiteral 2022-10-04 09:30:07 +00:00
static_type_helper.dart Add unawaited function and ignore extensions member. 2021-06-22 20:03:13 +00:00
syntax_helper.dart [testing] Rely on language versions in the analyzer tests 2021-06-02 07:47:46 +00:00