|
Copy-on-write arrays.
Object model changes
----------------------------------------
New fixed_cow_array_map is used for the elements array of a JSObject
to mark it as COW. The JSObject's map and other fields are not
affected. The JSObject's map still has the "fast elements" bit set. It
means we can do only the receiver map check in keyed loads and the
receiver and the elements map checks in keyed stores. So introducing
COW arrays doesn't hurt performance of these operations. But note that
the elements map check is necessary in all mutating operations because
the "has fast elements" bit now means "has fast elements for reading".
EnsureWritableFastElements can be used in runtime functions to perform
the necessary lazy copying.
Generated code changes
----------------------------------------
Generic keyed load is updated to only do the receiver map check (this
could have been done earlier). FastCloneShallowArrayStub now has two
modes: clone elements and use COW elements. AssertFastElements macro
is added to check the elements when necessary. The custom call IC
generators for Array.prototype.{push,pop} are updated to avoid going
to the slow case (and patching the IC) when calling the builtin should
work.
COW enablement
----------------------------------------
Currently we only put shallow and simple literal arrays in the COW
mode. This is done by the parser.
Committed: http://code.google.com/p/v8/source/detail?r=5275
Total comments: 29
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+523 lines, -200 lines) |
Patch |
|
M |
src/arm/codegen-arm.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/arm/codegen-arm.cc
|
View
|
|
5 chunks |
+35 lines, -12 lines |
0 comments
|
Download
|
|
M |
src/arm/full-codegen-arm.cc
|
View
|
|
1 chunk |
+8 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/arm/ic-arm.cc
|
View
|
|
7 chunks |
+32 lines, -18 lines |
0 comments
|
Download
|
|
M |
src/arm/macro-assembler-arm.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
src/arm/macro-assembler-arm.cc
|
View
|
|
1 chunk |
+19 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/arm/stub-cache-arm.cc
|
View
|
|
2 chunks |
+0 lines, -10 lines |
0 comments
|
Download
|
|
M |
src/builtins.cc
|
View
|
1
|
10 chunks |
+41 lines, -34 lines |
0 comments
|
Download
|
|
M |
src/codegen.h
|
View
|
1
|
2 chunks |
+18 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/heap.h
|
View
|
1
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
|
src/heap.cc
|
View
|
1
|
2 chunks |
+8 lines, -1 line |
0 comments
|
Download
|
|
M |
src/ia32/codegen-ia32.cc
|
View
|
1
|
6 chunks |
+36 lines, -17 lines |
0 comments
|
Download
|
|
M |
src/ia32/full-codegen-ia32.cc
|
View
|
1
|
1 chunk |
+8 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/ia32/ic-ia32.cc
|
View
|
1
|
7 chunks |
+20 lines, -7 lines |
0 comments
|
Download
|
|
M |
src/ia32/macro-assembler-ia32.h
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/ia32/macro-assembler-ia32.cc
|
View
|
1
|
1 chunk |
+15 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/ia32/stub-cache-ia32.cc
|
View
|
1
|
3 chunks |
+8 lines, -7 lines |
0 comments
|
Download
|
|
M |
src/objects.h
|
View
|
1
2
|
6 chunks |
+26 lines, -4 lines |
0 comments
|
Download
|
|
M |
src/objects.cc
|
View
|
1
2
|
7 chunks |
+15 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/objects-debug.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
src/objects-inl.h
|
View
|
1
2
|
12 chunks |
+45 lines, -8 lines |
0 comments
|
Download
|
|
M |
src/parser.h
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/parser.cc
|
View
|
1
|
2 chunks |
+19 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/runtime.cc
|
View
|
1
|
5 chunks |
+50 lines, -21 lines |
0 comments
|
Download
|
|
M |
src/serialize.h
|
View
|
1
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
src/v8-counters.h
|
View
|
1
|
2 chunks |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/x64/codegen-x64.cc
|
View
|
|
6 chunks |
+37 lines, -17 lines |
0 comments
|
Download
|
|
M |
src/x64/full-codegen-x64.cc
|
View
|
|
1 chunk |
+8 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/x64/ic-x64.cc
|
View
|
|
7 chunks |
+22 lines, -9 lines |
0 comments
|
Download
|
|
M |
src/x64/macro-assembler-x64.h
|
View
|
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/x64/macro-assembler-x64.cc
|
View
|
|
1 chunk |
+15 lines, -0 lines |
0 comments
|
Download
|
|
M |
src/x64/stub-cache-x64.cc
|
View
|
|
7 chunks |
+20 lines, -16 lines |
0 comments
|
Download
|
Total messages: 9 (0 generated)
|