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

Issue 12114021: Use browsers JSON.parse for parsing JSON. (Closed)

Created:
7 years, 10 months ago by sra1
Modified:
7 years, 10 months ago
CC:
reviews_dartlang.org, Johnni Winther
Visibility:
Public.

Description

Use browsers JSON.parse for parsing JSON. This shrinks swarm by 27k (3.6%) We can't make the error messages be the same since the native error contains only a message. Committed: https://code.google.com/p/dart/source/detail?r=18021

Patch Set 1 : #

Total comments: 21

Patch Set 2 : Add vm patch #

Total comments: 2

Patch Set 3 : #

Patch Set 4 : #

Total comments: 15

Patch Set 5 : #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+178 lines, -21 lines) Patch
M runtime/bin/bin.gypi View 1 2 7 chunks +36 lines, -1 line 0 comments Download
M runtime/bin/builtin.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/builtin.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M runtime/bin/builtin_gen_snapshot.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M runtime/bin/dartutils.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M runtime/bin/dartutils.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A + runtime/bin/json_patch.dart View 1 2 3 4 1 chunk +2 lines, -4 lines 0 comments Download
D runtime/bin/json_sources.gypi View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
A sdk/lib/_internal/compiler/implementation/lib/json_patch.dart View 1 2 3 4 1 chunk +82 lines, -0 lines 0 comments Download
M sdk/lib/_internal/libraries.dart View 1 chunk +2 lines, -1 line 0 comments Download
M sdk/lib/json/json.dart View 1 2 3 4 1 chunk +10 lines, -7 lines 2 comments Download
M tests/json/json_test.dart View 1 3 chunks +36 lines, -3 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
sra1
Addresses Issue 4653
7 years, 10 months ago (2013-01-31 05:02:59 UTC) #1
Lasse Reichstein Nielsen
It looks like a good solution. I would probably have tried using the reviver argument ...
7 years, 10 months ago (2013-01-31 06:58:44 UTC) #2
Lasse Reichstein Nielsen
CC'ing mstarzinger too, as I said I would. Is there any plan for JSON __proto__ ...
7 years, 10 months ago (2013-01-31 07:01:40 UTC) #3
Johnni Winther
lgtm https://codereview.chromium.org/12114021/diff/4001/sdk/lib/_internal/compiler/implementation/lib/json_patch.dart File sdk/lib/_internal/compiler/implementation/lib/json_patch.dart (right): https://codereview.chromium.org/12114021/diff/4001/sdk/lib/_internal/compiler/implementation/lib/json_patch.dart#newcode5 sdk/lib/_internal/compiler/implementation/lib/json_patch.dart:5: part of dart.json; On 2013/01/31 06:58:44, Lasse Reichstein ...
7 years, 10 months ago (2013-01-31 08:32:59 UTC) #4
sra1
https://codereview.chromium.org/12114021/diff/4001/sdk/lib/_internal/compiler/implementation/lib/json_patch.dart File sdk/lib/_internal/compiler/implementation/lib/json_patch.dart (right): https://codereview.chromium.org/12114021/diff/4001/sdk/lib/_internal/compiler/implementation/lib/json_patch.dart#newcode1 sdk/lib/_internal/compiler/implementation/lib/json_patch.dart:1: // Patch file for dart:json library. On 2013/01/31 06:58:44, ...
7 years, 10 months ago (2013-01-31 22:49:36 UTC) #5
sra1
Adding Siva to review the 8 files needed to put the patch in the VM.
7 years, 10 months ago (2013-01-31 23:03:31 UTC) #6
siva
I don't see any json_patch.dart file added to the bin directory. Your comment is also ...
7 years, 10 months ago (2013-01-31 23:16:40 UTC) #7
sra1
Added missing files. PTAL. https://codereview.chromium.org/12114021/diff/10001/runtime/bin/bin.gypi File runtime/bin/bin.gypi (right): https://codereview.chromium.org/12114021/diff/10001/runtime/bin/bin.gypi#newcode235 runtime/bin/bin.gypi:235: '../lib/json_sources.gypi', On 2013/01/31 23:16:40, siva ...
7 years, 10 months ago (2013-02-01 01:19:03 UTC) #8
Johnni Winther
https://codereview.chromium.org/12114021/diff/4001/sdk/lib/_internal/compiler/implementation/lib/json_patch.dart File sdk/lib/_internal/compiler/implementation/lib/json_patch.dart (right): https://codereview.chromium.org/12114021/diff/4001/sdk/lib/_internal/compiler/implementation/lib/json_patch.dart#newcode23 sdk/lib/_internal/compiler/implementation/lib/json_patch.dart:23: patch parse(String json, [reviver(var key, var value)]) { On ...
7 years, 10 months ago (2013-02-01 06:20:10 UTC) #9
ngeoffray
dart2js changes LGTM https://codereview.chromium.org/12114021/diff/16001/runtime/bin/json_patch.dart File runtime/bin/json_patch.dart (right): https://codereview.chromium.org/12114021/diff/16001/runtime/bin/json_patch.dart#newcode1 runtime/bin/json_patch.dart:1: // Copyright (c) 2012, the Dart ...
7 years, 10 months ago (2013-02-01 08:49:12 UTC) #10
Lasse Reichstein Nielsen
https://codereview.chromium.org/12114021/diff/16001/sdk/lib/_internal/compiler/implementation/lib/json_patch.dart File sdk/lib/_internal/compiler/implementation/lib/json_patch.dart (right): https://codereview.chromium.org/12114021/diff/16001/sdk/lib/_internal/compiler/implementation/lib/json_patch.dart#newcode67 sdk/lib/_internal/compiler/implementation/lib/json_patch.dart:67: String key = keys[i]; Keys also gets property names ...
7 years, 10 months ago (2013-02-01 12:33:32 UTC) #11
Michael Starzinger
On 2013/01/31 07:01:40, Lasse Reichstein Nielsen wrote: > CC'ing mstarzinger too, as I said I ...
7 years, 10 months ago (2013-02-01 13:40:05 UTC) #12
sra1
https://codereview.chromium.org/12114021/diff/16001/sdk/lib/_internal/compiler/implementation/lib/json_patch.dart File sdk/lib/_internal/compiler/implementation/lib/json_patch.dart (right): https://codereview.chromium.org/12114021/diff/16001/sdk/lib/_internal/compiler/implementation/lib/json_patch.dart#newcode10 sdk/lib/_internal/compiler/implementation/lib/json_patch.dart:10: * Parses [json] and build the corresponding parsed JSON ...
7 years, 10 months ago (2013-02-01 21:52:43 UTC) #13
Lasse Reichstein Nielsen
https://codereview.chromium.org/12114021/diff/16001/sdk/lib/_internal/compiler/implementation/lib/json_patch.dart File sdk/lib/_internal/compiler/implementation/lib/json_patch.dart (right): https://codereview.chromium.org/12114021/diff/16001/sdk/lib/_internal/compiler/implementation/lib/json_patch.dart#newcode67 sdk/lib/_internal/compiler/implementation/lib/json_patch.dart:67: String key = keys[i]; Ack, my bad.
7 years, 10 months ago (2013-02-02 11:16:23 UTC) #14
siva
Is this change committed? There was no LGTM from the VM side, we were still ...
7 years, 10 months ago (2013-02-05 23:55:57 UTC) #15
siva
None of the patching stuff is needed for the VM side as you are just ...
7 years, 10 months ago (2013-02-05 23:59:00 UTC) #16
sra1
On 2013/02/05 23:55:57, siva wrote: > Is this change committed? > > There was no ...
7 years, 10 months ago (2013-02-06 00:02:53 UTC) #17
sra1
On 2013/02/05 23:59:00, siva wrote: > None of the patching stuff is needed for the ...
7 years, 10 months ago (2013-02-06 00:18:43 UTC) #18
siva
I believe 'Item 3' is an incorrect interpretation of the rules. It should be possible ...
7 years, 10 months ago (2013-02-06 00:24:32 UTC) #19
kasperl
https://codereview.chromium.org/12114021/diff/17001/sdk/lib/json/json.dart File sdk/lib/json/json.dart (right): https://codereview.chromium.org/12114021/diff/17001/sdk/lib/json/json.dart#newcode55 sdk/lib/json/json.dart:55: _parse(String json, [reviver(var key, var value)]) { If this ...
7 years, 10 months ago (2013-02-06 07:07:11 UTC) #20
sra1
7 years, 10 months ago (2013-02-06 17:22:39 UTC) #21
Message was sent while issue was closed.
https://codereview.chromium.org/12114021/diff/17001/sdk/lib/json/json.dart
File sdk/lib/json/json.dart (right):

https://codereview.chromium.org/12114021/diff/17001/sdk/lib/json/json.dart#ne...
sdk/lib/json/json.dart:55: _parse(String json, [reviver(var key, var value)]) {
On 2013/02/06 07:07:11, kasperl wrote:
> If this code is only used by the VM, it shouldn't live in the
> platform-independent part of the library. That also goes for all the
> implementation code below I guess.

The code can still be used by someone who needs their own custom JsonListener.
dart2js is smart enough to leave it out for 'normal' usage.

I intend to write a benchmark that uses JsonParser and the provided JsonListener
implementations to track dart2js compiled code performance which is currently
similar to VM performance.  Both are currently slower than the browser native
parser.

Powered by Google App Engine
This is Rietveld 408576698