|
Inline instance object hash code into object header on 64 bit.
64 bit objects have 32 bits of free space in the header word.
This is used for the hash code in string objects. We take it
for the default hash code on all objects that don't override
the hashCode getter.
This is both faster and a memory reduction. Eg it shaves about
70% off the running time of this microbenchmark:
List list = [];
class Thing {
get hashCode => 42;
}
class Thing2 {
get hashCode => 42;
}
class Thing3 { }
class Thing4 { }
main() {
int sum = 103;
for (int i = 0; i < 10000000; i++) {
list = [];
list.add("foo");
list.add(123);
list.add(1.23);
list.add(new Object());
list.add(new Thing());
list.add(new Thing2());
list.add(new Thing3());
list.add(new Thing4());
for (int j = 0; j < 2; j++) {
sum ^= biz(list);
}
}
print(sum);
}
int biz(List list) {
int sum = 103;
for (var x in list) {
sum ^= x.hashCode;
}
return sum;
}
R=rmacnak@google.com, vegorov@google.com
BUG=
Committed: https://github.com/dart-lang/sdk/commit/ac6310d5f30af5a338207a9948565096ac47c4a5
Total comments: 2
Total comments: 7
Total comments: 14
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+493 lines, -147 lines) |
Patch |
|
M |
runtime/lib/object.cc
|
View
|
|
1 chunk |
+9 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/lib/object_patch.dart
|
View
|
1
2
|
2 chunks |
+7 lines, -8 lines |
0 comments
|
Download
|
|
M |
runtime/vm/assembler_arm.cc
|
View
|
1
2
3
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
runtime/vm/assembler_arm64.h
|
View
|
1
2
3
|
2 chunks |
+9 lines, -6 lines |
0 comments
|
Download
|
|
M |
runtime/vm/assembler_arm64.cc
|
View
|
1
2
3
|
2 chunks |
+6 lines, -2 lines |
0 comments
|
Download
|
|
M |
runtime/vm/assembler_arm64_test.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+62 lines, -0 lines |
0 comments
|
Download
|
|
M |
runtime/vm/assembler_ia32.cc
|
View
|
1
2
3
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
runtime/vm/assembler_mips.cc
|
View
|
1
2
3
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
runtime/vm/assembler_x64.h
|
View
|
1
2
3
|
2 chunks |
+5 lines, -8 lines |
0 comments
|
Download
|
|
M |
runtime/vm/assembler_x64.cc
|
View
|
1
2
3
|
2 chunks |
+6 lines, -2 lines |
0 comments
|
Download
|
|
M |
runtime/vm/assembler_x64_test.cc
|
View
|
1
2
3
4
5
6
|
3 chunks |
+43 lines, -2 lines |
0 comments
|
Download
|
|
M |
runtime/vm/become.h
|
View
|
1
2
3
4
5
6
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/become.cc
|
View
|
1
2
3
|
2 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/clustered_snapshot.cc
|
View
|
1
2
3
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/freelist.h
|
View
|
1
2
3
|
1 chunk |
+4 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/freelist.cc
|
View
|
1
2
3
|
1 chunk |
+6 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/heap.h
|
View
|
1
2
3
4
|
3 chunks |
+10 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/heap.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/intermediate_language_dbc.cc
|
View
|
1
2
3
|
3 chunks |
+3 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/intrinsifier_arm64.cc
|
View
|
1
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
|
M |
runtime/vm/intrinsifier_x64.cc
|
View
|
1
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
|
M |
runtime/vm/method_recognizer.h
|
View
|
1
|
2 chunks |
+14 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/object.h
|
View
|
1
2
3
|
3 chunks |
+8 lines, -12 lines |
0 comments
|
Download
|
|
M |
runtime/vm/object.cc
|
View
|
1
2
3
4
5
6
|
13 chunks |
+86 lines, -24 lines |
0 comments
|
Download
|
|
M |
runtime/vm/profiler.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/raw_object.h
|
View
|
1
2
3
4
5
|
17 chunks |
+56 lines, -31 lines |
0 comments
|
Download
|
|
M |
runtime/vm/raw_object.cc
|
View
|
1
2
3
|
6 chunks |
+7 lines, -7 lines |
0 comments
|
Download
|
|
M |
runtime/vm/simulator_arm64.h
|
View
|
1
2
3
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
|
M |
runtime/vm/simulator_arm64.cc
|
View
|
1
2
3
|
3 chunks |
+39 lines, -9 lines |
0 comments
|
Download
|
|
M |
runtime/vm/simulator_dbc.cc
|
View
|
1
2
3
|
5 chunks |
+7 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/snapshot.h
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/snapshot.cc
|
View
|
1
2
3
4
5
|
7 chunks |
+26 lines, -4 lines |
0 comments
|
Download
|
|
M |
runtime/vm/stub_code_arm.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/stub_code_arm64.cc
|
View
|
1
2
3
|
3 chunks |
+7 lines, -4 lines |
0 comments
|
Download
|
|
M |
runtime/vm/stub_code_ia32.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/stub_code_mips.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
runtime/vm/stub_code_x64.cc
|
View
|
1
2
3
|
2 chunks |
+9 lines, -6 lines |
0 comments
|
Download
|
Total messages: 16 (3 generated)
|