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
accessor_conflict
argument [analyzer] NOT_ENOUGH_POSITIONAL_ARGUMENTS 2022-10-11 17:56:11 +00:00
assert
assign
async [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
async_nested
async_star
await [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
bool
call [analyzer] NOT_ENOUGH_POSITIONAL_ARGUMENTS 2022-10-11 17:56:11 +00:00
canonicalize
cascade Remove nbsp 2022-10-17 08:18:49 +00:00
class
closure
compile_time_constant [analyzer] NOT_ENOUGH_POSITIONAL_ARGUMENTS 2022-10-11 17:56:11 +00:00
const
constants_2018
constructor [analyzer] NOT_ENOUGH_POSITIONAL_ARGUMENTS 2022-10-11 17:56:11 +00:00
control_flow_collections
covariant
covariant_override
deferred
double
double_literals
dynamic [vm] Better implementation of hashCode function. 2022-10-20 20:31:20 +00:00
enum
exception
export
extension_methods
factory
field
final
fixed_size_int
function
function_subtype
function_type
generic
generic_methods
getter
identifier
identity
if
if_null
implicit_creation
implicit_downcast_during
import
inference
inference_update_2 Fix test to account for obfuscation 2022-09-28 19:24:26 +00:00
initializer_assert
initializing_formal
instance
instantiate_to_bound
interceptor
interface
invalid_returns
is [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
label
lazy
least_upper_bound
library
list
loop
main
malbounded
malformed
map
metadata
method
mixin
mixin_constructor_forwarding
mixin_declaration
new
no_such_method
nosuchmethod_forwarding
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
operator
optimize [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
override
parameter [analyzer] NOT_ENOUGH_POSITIONAL_ARGUMENTS 2022-10-11 17:56:11 +00:00
part
prefix
private
propagate
redirecting
reg_exp
regress [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
resolution
return
rewrite
script
set_literals
setter
spread_collections
stack_trace
static
string
subtyping_dynamic
subtyping_static
super Remove INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES warnings 2022-10-04 18:23:10 +00:00
superinterface_variance
switch Reland "Reland "[vm/compiler] Optimize switch statements"" 2022-08-23 22:11:50 +00:00
symbol
sync_star
syntax
this
top_level
type
type_object
type_promotion
type_variable
typedef
unsorted
variable
vm [tests] Avoid small --optimization-counter-threshold in tests 2022-10-10 21:04:18 +00:00
void
await_type_error_test.dart
await_type_test.dart
dynamic_type_helper.dart
language_2.status [testing] Remove --compiler=none from test.py 2022-10-19 08:09:58 +00:00
language_2_analyzer.status
language_2_dart2js.status
language_2_dartdevc.status
language_2_kernel.status
language_2_precompiled.status
language_2_spec_parser.status
language_2_vm.status
library1.dart
library2.dart
library10.dart
library11.dart
library12.dart
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
syntax_helper.dart