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

Issue 2065453002: [module] Track script "module code" status

Created:
4 years, 6 months ago by mike3
Modified:
4 years, 5 months ago
CC:
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

[module] Track script "module code" status A V8 Script object may describe source code that, in ECMAScript2015 terms, is either "module code" or "global code." This distinction is currently available in ParseInfo instances, but because the Script has a longer lifetime, there are some circumstances (e.g. lazily tokenizing function bodies) where the information is relevant but not available. Encode a Script's status as "module code" as a flag on the script instance and reference that flag when creating ParseInfo instances. LOG=N R=vogelheim@chromium.org BUG=v8:1569

Patch Set 1 #

Total comments: 13

Patch Set 2 : Extend compilation cache to recognize module code #

Total comments: 13

Patch Set 3 : Incorporate review feedback #

Total comments: 6

Patch Set 4 : Remove unnecessary ternary and rebase #

Patch Set 5 : Use idiomatic variable names #

Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -58 lines) Patch
M src/compilation-cache.h View 1 3 chunks +6 lines, -8 lines 0 comments Download
M src/compilation-cache.cc View 1 2 3 6 chunks +13 lines, -17 lines 0 comments Download
M src/compiler.cc View 1 2 3 4 chunks +11 lines, -4 lines 0 comments Download
M src/objects.h View 1 2 3 3 chunks +14 lines, -6 lines 0 comments Download
M src/objects.cc View 1 2 3 11 chunks +25 lines, -15 lines 0 comments Download
M src/objects-inl.h View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download
M src/parsing/parser.cc View 1 2 3 2 chunks +9 lines, -0 lines 0 comments Download
M test/cctest/heap/test-heap.cc View 1 2 3 3 chunks +3 lines, -3 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 3 4 1 chunk +25 lines, -0 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 2 3 1 chunk +2 lines, -3 lines 0 comments Download
M test/cctest/test-serialize.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 20 (6 generated)
mike3
4 years, 6 months ago (2016-06-12 19:47:48 UTC) #1
mike3
Hi Daniel, There are a few things I wasn't sure about; I've left details as ...
4 years, 6 months ago (2016-06-12 19:54:48 UTC) #2
vogelheim
Looks mostly good, but I think we still need to sort out the is_module <-> ...
4 years, 6 months ago (2016-06-14 15:20:50 UTC) #3
mike3
Hi Daniel, I'm submitting another attempt in just a moment. Thanks again for the detailed ...
4 years, 6 months ago (2016-06-19 16:59:00 UTC) #4
mike3
Hi again Daniel, I have a few questions regarding the new extensions to CompilationCache--left in-line. ...
4 years, 6 months ago (2016-06-19 17:11:41 UTC) #6
vogelheim
One more bug (CompilationCacheTable::Put), I think, but that should be easy to fix... :) https://codereview.chromium.org/2065453002/diff/20001/src/objects.cc ...
4 years, 6 months ago (2016-06-23 14:53:20 UTC) #7
mike3
You were right--this was easy to fix! I'll have a patch uploaded in just a ...
4 years, 6 months ago (2016-06-25 19:31:46 UTC) #9
vogelheim
lgtm (with one minor issue) https://codereview.chromium.org/2065453002/diff/40001/src/objects.cc File src/objects.cc (right): https://codereview.chromium.org/2065453002/diff/40001/src/objects.cc#newcode15813 src/objects.cc:15813: Smi::cast(other_array->get(3))->value() == 1 ? ...
4 years, 5 months ago (2016-06-28 16:41:27 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2065453002/40001
4 years, 5 months ago (2016-06-28 16:42:05 UTC) #12
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_linux64_avx2_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel_ng/builds/3996) v8_linux64_avx2_rel_ng_triggered on ...
4 years, 5 months ago (2016-06-28 16:58:57 UTC) #14
adamk
This lgtm with a nit and a question, but adding verwaest@ on the off-chance he ...
4 years, 5 months ago (2016-06-28 17:03:54 UTC) #16
adamk
You've got a test failure when compiling with TurboFan: it seems to be pickier about ...
4 years, 5 months ago (2016-06-28 17:06:05 UTC) #17
adamk
+neis, this is running into the fact that we currently build FunctionContexts for modules instead ...
4 years, 5 months ago (2016-06-28 17:38:34 UTC) #19
mike3
4 years, 5 months ago (2016-07-02 22:17:59 UTC) #20
I spoke with Adam on IRC, and he let me know that the team would prefer to wait
on this patch until the underlying issue he reported above has been resolved.
I've rebased my work and removed that unnecessary ternary operator anyway just
so the patch is in a good place while we wait.

https://codereview.chromium.org/2065453002/diff/40001/src/objects.cc
File src/objects.cc (right):

https://codereview.chromium.org/2065453002/diff/40001/src/objects.cc#newcode1...
src/objects.cc:15790: if (is_module) hash ^= 0x4000;
On 2016/06/28 17:03:53, adamk (out until june 12) wrote:
> Curious how you decided to tweak the hash code here?

I just needed a place to store this bit, so I followed the pattern set by
`is_strict`. Does it seem incorrect to you? Or is there a better way to do
this?

https://codereview.chromium.org/2065453002/diff/40001/src/objects.cc#newcode1...
src/objects.cc:15813: Smi::cast(other_array->get(3))->value() == 1 ? true :
false;
On 2016/06/28 16:41:27, vogelheim wrote:
> Please also drop "? true : false" here.

Acknowledged.

https://codereview.chromium.org/2065453002/diff/40001/test/cctest/test-api.cc
File test/cctest/test-api.cc (right):

https://codereview.chromium.org/2065453002/diff/40001/test/cctest/test-api.cc...
test/cctest/test-api.cc:23614: Local<Script> localScript;
On 2016/06/28 17:03:53, adamk (out until june 12) wrote:
> Nit: C++ style is to use lower_case_with_underscores for variable names. Also
> below.

Acknowledged.

Powered by Google App Engine
This is Rietveld 408576698