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

Issue 1227093005: Fix uses of eval() with non-string arguments under nosnap/--use-strict (Closed)

Created:
5 years, 5 months ago by adamk
Modified:
5 years, 5 months ago
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Fix lazy compilation of eval() under nosnap/--use-strict When running without a snapshot, the GlobalEval function gets lazy compiled. By the time we compile it, its name is "eval", which causes the parser to choke (functions named "eval" aren't allowed in strict mode!). Instead, we now always skip checking the function name when lazy-parsing, as the name has already been checked appropriately by the preparser. Also cleaned up other cases that don't require name checking by introducing FunctionNameValidity enum and passing appropriate values throughout the parser and preparser. This lets us pass an additional 18 test262 tests. BUG=v8:4198 LOG=n Committed: https://crrev.com/33a373985be86a52b788f0277a8e61a804c602da Cr-Commit-Position: refs/heads/master@{#29559}

Patch Set 1 #

Patch Set 2 : Use ParseInfo::is_native and compare eval_string instead #

Total comments: 2

Patch Set 3 : Totally different approach: skip all function name checks when lazy-parsing #

Patch Set 4 : Whitespace #

Patch Set 5 : Undo reordering #

Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -59 lines) Patch
M src/parser.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M src/parser.cc View 1 2 3 5 chunks +11 lines, -11 lines 0 comments Download
M src/preparser.h View 1 2 3 4 8 chunks +23 lines, -18 lines 0 comments Download
M src/preparser.cc View 1 2 4 chunks +9 lines, -7 lines 0 comments Download
M test/test262-es6/test262-es6.status View 1 chunk +0 lines, -21 lines 0 comments Download

Messages

Total messages: 15 (3 generated)
adamk
5 years, 5 months ago (2015-07-09 00:31:51 UTC) #2
arv (Not doing code reviews)
LGTM This makes me wonder if we have more failures when we do --use-strict with ...
5 years, 5 months ago (2015-07-09 14:16:55 UTC) #3
adamk
Looks like my access of global_eval_fun() sometimes occurs at a time when it's not yet ...
5 years, 5 months ago (2015-07-09 15:21:25 UTC) #4
adamk
Hmm, those failing tests are doing something pretty exotic, in that they create fresh isolates ...
5 years, 5 months ago (2015-07-09 17:28:55 UTC) #6
adamk
Here's a different approach which seems to work, so far: ParseInfo has an "is_native" bit ...
5 years, 5 months ago (2015-07-09 18:53:42 UTC) #7
arv (Not doing code reviews)
LGTM https://codereview.chromium.org/1227093005/diff/20001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1227093005/diff/20001/src/parser.cc#newcode1147 src/parser.cc:1147: name = isolate->factory()->empty_string(); Would it be possible to ...
5 years, 5 months ago (2015-07-09 19:00:59 UTC) #8
adamk
https://codereview.chromium.org/1227093005/diff/20001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1227093005/diff/20001/src/parser.cc#newcode1147 src/parser.cc:1147: name = isolate->factory()->empty_string(); On 2015/07/09 at 19:00:59, arv wrote: ...
5 years, 5 months ago (2015-07-09 19:09:00 UTC) #9
adamk
Totally different approach, PTAL
5 years, 5 months ago (2015-07-09 20:54:24 UTC) #10
arv (Not doing code reviews)
LGTM Very nice
5 years, 5 months ago (2015-07-09 20:58:10 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1227093005/80001
5 years, 5 months ago (2015-07-09 21:29:12 UTC) #13
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 5 months ago (2015-07-09 21:31:21 UTC) #14
commit-bot: I haz the power
5 years, 5 months ago (2015-07-09 21:31:29 UTC) #15
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/33a373985be86a52b788f0277a8e61a804c602da
Cr-Commit-Position: refs/heads/master@{#29559}

Powered by Google App Engine
This is Rietveld 408576698