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

Issue 389573006: Change ScriptCompiler::CompileOptions and add d8 --cache. (Closed)

Created:
6 years, 5 months ago by vogelheim
Modified:
6 years, 5 months ago
Reviewers:
ulan, Yang, marja
CC:
v8-dev, Paweł Hajdan Jr., jochen (gone - plz use gerrit)
Project:
v8
Visibility:
Public.

Description

Change ScriptCompiler::CompileOptions to allow for two 'cache' modes (parser or code) and to be explicit about cache consumption or production (rather than making presence of cached_data imply one or the other.) Also add a --cache flag to d8, to allow testing the functionality. ----------------------------- API change Reason: Currently, V8 supports a 'parser cache' for repeatedly executing the same script. We'd like to add a 2nd mode that would cache code, and would like to let the embedder decide which mode they chose (if any). Note: Previously, the 'use cached data' property was implied by the presence of the cached data itself. (That is, kNoCompileOptions and source->cached_data != NULL.) That is no longer sufficient, since the presence of data is no longer sufficient to determine /which kind/ of data is present. Changes from old behaviour: - If you previously didn't use caching, nothing changes. Example: v8::CompileUnbound(isolate, source, kNoCompileOptions); - If you previously used caching, it worked like this: - 1st run: v8::CompileUnbound(isolate, source, kProduceToCache); Then, source->cached_data would contain the data-to-be cached. This remains the same, except you need to tell V8 which type of data you want. v8::CompileUnbound(isolate, source, kProduceParserCache); - 2nd run: v8::CompileUnbound(isolate, source, kNoCompileOptions); with source->cached_data set to the data you received in the first run. This will now ignore the cached data, and you need to explicitly tell V8 to use it: v8::CompileUnbound(isolate, source, kConsumeParserCache); ----------------------------- BUG= R=marja@chromium.org, yangguo@chromium.org Committed: https://code.google.com/p/v8/source/detail?r=22431

Patch Set 1 #

Total comments: 4

Patch Set 2 : rebase plus fix tests #

Patch Set 3 : "Emulate old API for a transition period. Also rebase." #

Patch Set 4 : rebase #

Patch Set 5 : even more rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+194 lines, -143 lines) Patch
M include/v8.h View 1 2 1 chunk +11 lines, -5 lines 0 comments Download
M src/api.cc View 1 2 3 4 3 chunks +19 lines, -11 lines 0 comments Download
M src/bootstrapper.cc View 1 chunk +2 lines, -9 lines 0 comments Download
M src/compiler.h View 5 chunks +10 lines, -21 lines 0 comments Download
M src/compiler.cc View 1 2 3 4 6 chunks +22 lines, -21 lines 0 comments Download
M src/d8.h View 3 chunks +22 lines, -17 lines 0 comments Download
M src/d8.cc View 1 3 chunks +46 lines, -3 lines 0 comments Download
M src/debug.cc View 1 2 1 chunk +3 lines, -6 lines 0 comments Download
M src/parser.h View 1 2 chunks +3 lines, -2 lines 0 comments Download
M src/parser.cc View 1 2 5 chunks +8 lines, -7 lines 0 comments Download
M test/cctest/cctest.h View 1 1 chunk +9 lines, -3 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/test-compiler.cc View 1 1 chunk +4 lines, -9 lines 0 comments Download
M test/cctest/test-debug.cc View 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/test-parsing.cc View 1 2 7 chunks +12 lines, -9 lines 0 comments Download
M test/cctest/test-serialize.cc View 1 2 3 4 3 chunks +17 lines, -16 lines 0 comments Download
M tools/parser-shell.cc View 1 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
vogelheim
The full change, as previously discussed. Does this make sense, overall?
6 years, 5 months ago (2014-07-11 17:39:56 UTC) #1
vogelheim
+ulan, because API change.
6 years, 5 months ago (2014-07-11 17:52:11 UTC) #2
marja
lgtm https://codereview.chromium.org/389573006/diff/1/src/api.cc File src/api.cc (right): https://codereview.chromium.org/389573006/diff/1/src/api.cc#newcode1755 src/api.cc:1755: script_data != NULL) { I don't think it's ...
6 years, 5 months ago (2014-07-14 07:45:46 UTC) #3
vogelheim
https://codereview.chromium.org/389573006/diff/1/src/api.cc File src/api.cc (right): https://codereview.chromium.org/389573006/diff/1/src/api.cc#newcode1755 src/api.cc:1755: script_data != NULL) { On 2014/07/14 07:45:46, marja wrote: ...
6 years, 5 months ago (2014-07-14 10:40:04 UTC) #4
marja
https://codereview.chromium.org/389573006/diff/1/src/api.cc File src/api.cc (right): https://codereview.chromium.org/389573006/diff/1/src/api.cc#newcode1755 src/api.cc:1755: script_data != NULL) { On 2014/07/14 10:40:04, vogelheim wrote: ...
6 years, 5 months ago (2014-07-14 10:41:12 UTC) #5
Yang
lgtm. https://codereview.chromium.org/389573006/diff/1/test/cctest/test-compiler.cc File test/cctest/test-compiler.cc (right): https://codereview.chromium.org/389573006/diff/1/test/cctest/test-compiler.cc#newcode397 test/cctest/test-compiler.cc:397: TEST(SerializeToplevel) { Note that I updated and moved ...
6 years, 5 months ago (2014-07-14 11:22:49 UTC) #6
ulan
On 2014/07/14 11:22:49, Yang wrote: > lgtm. > > https://codereview.chromium.org/389573006/diff/1/test/cctest/test-compiler.cc > File test/cctest/test-compiler.cc (right): > ...
6 years, 5 months ago (2014-07-15 06:47:33 UTC) #7
vogelheim
Minor fixes to tests. Added emulation of the old enum values so that embedders have ...
6 years, 5 months ago (2014-07-15 11:55:37 UTC) #8
vogelheim
6 years, 5 months ago (2014-07-16 12:18:55 UTC) #9
Message was sent while issue was closed.
Committed patchset #5 manually as r22431 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698