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

Issue 1994733003: Rewrite decodeURL as builtin function, remove now unused runtime functions. (Closed)

Created:
4 years, 7 months ago by Franzi
Modified:
4 years, 6 months ago
Reviewers:
Benedikt Meurer, Yang
CC:
v8-mips-ports_googlegroups.com, v8-ppc-ports_googlegroups.com, v8-reviews_googlegroups.com, v8-x87-ports_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[builtins] Rewrite uri.js as builtin functions. Rewrite decodeURI and decodeURIComponent as builtin functions and install them in the bootstrapper. Delete unused runtime functions: - TruncateString - NewString - OneByteSeqStringGetChar - OneByteSeqStringSetChar - TwoByteSeqStringGetChar - TwoByteSeqStringSetChar Add regression test for decoding large strings. Clusterfuzz detected a problem with %TruncateString, see https://bugs.chromium.org/p/chromium/issues/detail?id=612109#c6 This is automatically fixed by this rewrite because %TruncateString is deleted anyways. Crude benchmark on 585 decodeURI and decodeURIComponent tests averaged over five runs: * builtin functions real 0m9.69s user 2m39.8816s sys 0m12.6398s * JS functions calling into the runtime e.g., for %TruncateString real 0m11.0598s user 3m6.7026s sys 0m13.5756s By running: $ time tools/run-tests.py --arch=x64 --mode=Release --buildbot test262/built-ins/decodeURI* mjsunit/uri >>> Running tests for x64.Release BUG=v8:4912, chromium:612109 R=yangguo@chromium.org, bmeurer@chromium.org Committed: https://crrev.com/8c31bd81f2919aafb4d586f39aa729cdbff23c44 Cr-Commit-Position: refs/heads/master@{#36543}

Patch Set 1 #

Patch Set 2 : Remove test for previously removed runtime function #

Patch Set 3 : Rebase ToT and minor refactoring #

Patch Set 4 : Add regression test for issue 612109 (detected by clusterfuzz) #

Patch Set 5 : Formatting, Replace magic numbers with constants #

Patch Set 6 : Fix bug with values that are too large #

Patch Set 7 : Use Utf8::Encode() and ValueOf() #

Total comments: 10

Patch Set 8 : Address review comments #

Total comments: 23

Patch Set 9 : Fix more review comments #

Patch Set 10 : Move new test 612109.js to regress/ #

Total comments: 6

Patch Set 11 : Another round of review changes #

Patch Set 12 : Rebase #

Patch Set 13 : Change order of decode/encode #

Patch Set 14 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+254 lines, -1368 lines) Patch
M src/bootstrapper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +8 lines, -0 lines 0 comments Download
M src/builtins.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -0 lines 0 comments Download
M src/builtins.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +26 lines, -3 lines 0 comments Download
M src/crankshaft/hydrogen.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -2 lines 0 comments Download
M src/crankshaft/hydrogen.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -32 lines 0 comments Download
M src/full-codegen/arm/full-codegen-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -67 lines 0 comments Download
M src/full-codegen/arm64/full-codegen-arm64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -60 lines 0 comments Download
M src/full-codegen/full-codegen.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -2 lines 0 comments Download
M src/full-codegen/ia32/full-codegen-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -69 lines 0 comments Download
M src/full-codegen/mips/full-codegen-mips.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -74 lines 0 comments Download
M src/full-codegen/mips64/full-codegen-mips64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -75 lines 0 comments Download
M src/full-codegen/ppc/full-codegen-ppc.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -64 lines 0 comments Download
M src/full-codegen/s390/full-codegen-s390.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -62 lines 0 comments Download
M src/full-codegen/x64/full-codegen-x64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -66 lines 0 comments Download
M src/full-codegen/x87/full-codegen-x87.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -69 lines 0 comments Download
M src/js/uri.js View 1 2 3 4 3 chunks +1 line, -198 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +0 lines, -6 lines 0 comments Download
M src/runtime/runtime-strings.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +0 lines, -67 lines 0 comments Download
M src/uri.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +15 lines, -6 lines 0 comments Download
M src/uri.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +194 lines, -21 lines 0 comments Download
M test/cctest/compiler/test-run-intrinsics.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +0 lines, -62 lines 0 comments Download
D test/mjsunit/lithium/SeqStringSetChar.js View 1 chunk +0 lines, -46 lines 0 comments Download
D test/mjsunit/regress/regress-crbug-320922.js View 1 chunk +0 lines, -50 lines 0 comments Download
A test/mjsunit/regress/regress-crbug-612109.js View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 0 comments Download
D test/mjsunit/regress/regress-seqstrsetchar-ex1.js View 1 chunk +0 lines, -59 lines 0 comments Download
D test/mjsunit/regress/regress-seqstrsetchar-ex3.js View 1 chunk +0 lines, -44 lines 0 comments Download
D test/mjsunit/regress/string-set-char-deopt.js View 1 chunk +0 lines, -85 lines 0 comments Download
D test/mjsunit/string-natives.js View 1 chunk +0 lines, -79 lines 0 comments Download

Messages

Total messages: 28 (13 generated)
Franzi
Hi Yang, Hi Benedikt here's the second part of 4912, URL encoding rewritten as builtin ...
4 years, 7 months ago (2016-05-20 12:30:42 UTC) #6
Franzi
I simplified the octed decoding/encoding some more.
4 years, 7 months ago (2016-05-20 17:47:19 UTC) #7
Benedikt Meurer
Looking good, thanks, I like the awesome code removal (wanna kill the rest of uri.js ...
4 years, 7 months ago (2016-05-21 19:28:00 UTC) #9
Franzi
Hi Benedikt, Thanks for looking at this. I implemented your suggestions. Removing the rest of ...
4 years, 7 months ago (2016-05-22 12:34:08 UTC) #10
Benedikt Meurer
Thanks. LGTM from my side.
4 years, 7 months ago (2016-05-22 17:12:44 UTC) #11
Yang
https://codereview.chromium.org/1994733003/diff/180001/src/uri.cc File src/uri.cc (right): https://codereview.chromium.org/1994733003/diff/180001/src/uri.cc#newcode148 src/uri.cc:148: bool IsRepalcementCharacter(List<uint8_t>* octets) { typo. https://codereview.chromium.org/1994733003/diff/180001/src/uri.cc#newcode149 src/uri.cc:149: // 0xFFFD ...
4 years, 7 months ago (2016-05-23 06:44:32 UTC) #12
Franzi
Thanks for the review, I addressed your comments except for the one about src/uri.cc line ...
4 years, 7 months ago (2016-05-23 08:55:57 UTC) #13
Yang
https://codereview.chromium.org/1994733003/diff/180001/src/uri.cc File src/uri.cc (right): https://codereview.chromium.org/1994733003/diff/180001/src/uri.cc#newcode177 src/uri.cc:177: char high = HexValue(uri_content->Get(k + 1)); On 2016/05/23 08:55:57, ...
4 years, 7 months ago (2016-05-23 11:24:59 UTC) #14
Franzi
Hi Yang, I addressed your comments and rebased. Could you have another look. Thanks, Franzi ...
4 years, 6 months ago (2016-05-24 15:07:38 UTC) #15
Yang
On 2016/05/24 15:07:38, Franzi wrote: > Hi Yang, > > I addressed your comments and ...
4 years, 6 months ago (2016-05-27 08:24:34 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1994733003/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1994733003/280001
4 years, 6 months ago (2016-05-27 08:31:09 UTC) #19
commit-bot: I haz the power
Failed to apply patch for src/crankshaft/hydrogen.h: While running git apply --index -3 -p1; error: patch ...
4 years, 6 months ago (2016-05-27 08:59:20 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1994733003/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1994733003/300001
4 years, 6 months ago (2016-05-27 09:27:01 UTC) #24
commit-bot: I haz the power
Committed patchset #14 (id:300001)
4 years, 6 months ago (2016-05-27 09:56:15 UTC) #26
commit-bot: I haz the power
4 years, 6 months ago (2016-05-27 09:57:20 UTC) #28
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/8c31bd81f2919aafb4d586f39aa729cdbff23c44
Cr-Commit-Position: refs/heads/master@{#36543}

Powered by Google App Engine
This is Rietveld 408576698