Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Issue 2170743003: [api] Introduce fast instantiations cache (Closed)

Created:
4 years, 5 months ago by Camillo Bruni
Modified:
4 years, 4 months ago
CC:
jochen (gone - plz use gerrit), v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[api] Introduce fast instantiations cache This CL introduces a new fast flat instantiations cache for the first 1024 object templates. After that we fall back to the existing slower dictionary cache. Drive-by-fix: de-handlify and clean up some code in api-natives.cc BUG=chromium:630217 Committed: https://crrev.com/f3f738fe8e670f95e003656f671f18c6095533cc Cr-Commit-Position: refs/heads/master@{#38146}

Patch Set 1 #

Patch Set 2 : fixing tests #

Patch Set 3 : adding growing fixedarray cache #

Patch Set 4 : improving api object instantiation #

Patch Set 5 : fixes #

Patch Set 6 : respect the context #

Patch Set 7 : updated test expectations #

Patch Set 8 : rebasing #

Patch Set 9 : removing accidental changes #

Patch Set 10 : fixing uint issue under windows #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+304 lines, -207 lines) Patch
M src/api-natives.cc View 1 2 3 4 5 6 7 8 9 12 chunks +123 lines, -103 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 1 chunk +7 lines, -3 lines 0 comments Download
M src/contexts.h View 1 2 3 1 chunk +4 lines, -2 lines 0 comments Download
M src/debug/liveedit.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/heap/object-stats.cc View 1 2 3 4 5 6 7 1 chunk +7 lines, -2 lines 0 comments Download
M src/objects.h View 1 2 3 4 5 8 chunks +56 lines, -42 lines 2 comments Download
M src/objects.cc View 1 2 3 2 chunks +20 lines, -2 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 2 chunks +27 lines, -6 lines 0 comments Download
M src/wasm/wasm-module.cc View 1 2 3 4 5 6 7 8 17 chunks +51 lines, -40 lines 0 comments Download
M test/cctest/heap/test-heap.cc View 1 2 3 4 5 2 chunks +2 lines, -3 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/CallRuntime.golden View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/test-api.cc View 1 2 3 4 5 1 chunk +5 lines, -2 lines 0 comments Download

Messages

Total messages: 45 (33 generated)
Camillo Bruni
PTAL first easy step...
4 years, 5 months ago (2016-07-21 11:53:05 UTC) #5
Toon Verwaest
lgtm
4 years, 5 months ago (2016-07-21 12:34:19 UTC) #7
Camillo Bruni
going to drop this CL in favor of: - directly storing the JSFunction on the ...
4 years, 4 months ago (2016-07-26 09:05:45 UTC) #8
Camillo Bruni
4 years, 4 months ago (2016-07-26 16:56:16 UTC) #11
ahaas
On 2016/07/26 at 16:56:16, cbruni wrote: > wasm lgtm
4 years, 4 months ago (2016-07-27 15:41:24 UTC) #24
Camillo Bruni
mlippautz@ PTAL object-stats changes.
4 years, 4 months ago (2016-07-28 12:00:19 UTC) #35
Michael Lippautz
On 2016/07/28 12:00:19, Camillo Bruni wrote: > mlippautz@ PTAL object-stats changes. object-stats changes lgtm
4 years, 4 months ago (2016-07-28 15:31:25 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2170743003/180001
4 years, 4 months ago (2016-07-28 16:53:58 UTC) #39
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 4 months ago (2016-07-28 17:16:40 UTC) #40
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/f3f738fe8e670f95e003656f671f18c6095533cc Cr-Commit-Position: refs/heads/master@{#38146}
4 years, 4 months ago (2016-07-28 17:20:04 UTC) #42
Mircea Trofin
https://codereview.chromium.org/2170743003/diff/180001/src/objects.h File src/objects.h (right): https://codereview.chromium.org/2170743003/diff/180001/src/objects.h#newcode2678 src/objects.h:2678: Handle<T> GetValueChecked(Isolate* isolate, int index) const; Why was it ...
4 years, 4 months ago (2016-08-01 23:40:02 UTC) #44
Camillo Bruni
4 years, 4 months ago (2016-08-02 07:27:54 UTC) #45
Message was sent while issue was closed.
https://codereview.chromium.org/2170743003/diff/180001/src/objects.h
File src/objects.h (right):

https://codereview.chromium.org/2170743003/diff/180001/src/objects.h#newcode2678
src/objects.h:2678: Handle<T> GetValueChecked(Isolate* isolate, int index)
const;
On 2016/08/01 at 23:40:02, Mircea Trofin wrote:
> Why was it necessary to pass the isolate explicitly, rather than getting it
from the FixedArray?

The calls to GetValueChecked happen in loops and do IsUndefined() internally. 
If you pass in the isolate it actually gets inlined nicely.
I've done a refactoring a while back, replacing all calls of IsUndefined() with
IsUndefined(isolate) yielding some significant speedups in tight loops (kudos to
Toon for discovering this).

Powered by Google App Engine
This is Rietveld 408576698