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

Issue 1564913004: Initial flat buffers implementation. (Closed)

Created:
4 years, 11 months ago by scheglov
Modified:
4 years, 11 months ago
Reviewers:
Paul Berry
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Initial flat buffers implementation. It supports tables and lists. Virtual tables are not shared yet. Construction is done forward. R=paulberry@google.com BUG= Committed: https://github.com/dart-lang/sdk/commit/5d7e5cc4bdf27b429747d1821717aa97ab4af5e4

Patch Set 1 #

Total comments: 17

Patch Set 2 : Rewrite using backward construction approach. #

Total comments: 7

Patch Set 3 : Fixes for review comments. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+726 lines, -0 lines) Patch
A pkg/analyzer/lib/src/summary/flat_buffers.dart View 1 2 1 chunk +509 lines, -0 lines 2 comments Download
A pkg/analyzer/test/src/summary/flat_buffers_test.dart View 1 2 1 chunk +215 lines, -0 lines 0 comments Download
M pkg/analyzer/test/src/summary/test_all.dart View 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (1 generated)
scheglov
4 years, 11 months ago (2016-01-07 06:21:32 UTC) #1
Paul Berry
I'm concerned about the decision to write the output in forward order rather than reverse ...
4 years, 11 months ago (2016-01-07 15:55:03 UTC) #2
scheglov
PTAL https://codereview.chromium.org/1564913004/diff/1/pkg/analyzer/lib/src/summary/flat_buffers.dart File pkg/analyzer/lib/src/summary/flat_buffers.dart (right): https://codereview.chromium.org/1564913004/diff/1/pkg/analyzer/lib/src/summary/flat_buffers.dart#newcode15 pkg/analyzer/lib/src/summary/flat_buffers.dart:15: ByteBuffer byteBuffer = new Int8List.fromList(byteList).buffer; On 2016/01/07 15:55:03, ...
4 years, 11 months ago (2016-01-07 22:07:40 UTC) #3
Paul Berry
Thanks, Konstantin! Lgtm with some minor nits. https://codereview.chromium.org/1564913004/diff/1/pkg/analyzer/lib/src/summary/flat_buffers.dart File pkg/analyzer/lib/src/summary/flat_buffers.dart (right): https://codereview.chromium.org/1564913004/diff/1/pkg/analyzer/lib/src/summary/flat_buffers.dart#newcode217 pkg/analyzer/lib/src/summary/flat_buffers.dart:217: for (int ...
4 years, 11 months ago (2016-01-07 22:44:54 UTC) #4
scheglov
https://codereview.chromium.org/1564913004/diff/20001/pkg/analyzer/lib/src/summary/flat_buffers.dart File pkg/analyzer/lib/src/summary/flat_buffers.dart (right): https://codereview.chromium.org/1564913004/diff/20001/pkg/analyzer/lib/src/summary/flat_buffers.dart#newcode27 pkg/analyzer/lib/src/summary/flat_buffers.dart:27: int uOffset = _getInt32(); On 2016/01/07 22:44:54, Paul Berry ...
4 years, 11 months ago (2016-01-07 23:21:08 UTC) #5
scheglov
Committed patchset #3 (id:40001) manually as 5d7e5cc4bdf27b429747d1821717aa97ab4af5e4 (presubmit successful).
4 years, 11 months ago (2016-01-07 23:21:50 UTC) #7
Paul Berry
https://codereview.chromium.org/1564913004/diff/40001/pkg/analyzer/lib/src/summary/flat_buffers.dart File pkg/analyzer/lib/src/summary/flat_buffers.dart (right): https://codereview.chromium.org/1564913004/diff/40001/pkg/analyzer/lib/src/summary/flat_buffers.dart#newcode173 pkg/analyzer/lib/src/summary/flat_buffers.dart:173: int alignedTail = _tail + ((-_tail) % _maxAlign); I ...
4 years, 11 months ago (2016-01-07 23:50:28 UTC) #8
scheglov
4 years, 11 months ago (2016-01-08 03:58:59 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/1564913004/diff/40001/pkg/analyzer/lib/src/su...
File pkg/analyzer/lib/src/summary/flat_buffers.dart (right):

https://codereview.chromium.org/1564913004/diff/40001/pkg/analyzer/lib/src/su...
pkg/analyzer/lib/src/summary/flat_buffers.dart:173: int alignedTail = _tail +
((-_tail) % _maxAlign);
On 2016/01/07 23:50:28, Paul Berry wrote:
> I think this isn't going to do what you want.  Consider what happens if
> _maxAlign is 8 and _tail is 64 on entry to this method.  _prepare will change
> _tail to 68, so _setUint32AtTail will store a value at a tail offset of 68. 
> Then we will compute a value of 72 for alignedTail.  As a result, the returned
> buffer will begin with 4 bytes of padding, followed by the offset to the root
> object.

Ah... Right.
At the moment we don't cannot write Int64, but yes, I see how it may be a
problem.
We need to write the root object reference at alignedTail.
https://codereview.chromium.org/1571593002/ should fix it.

Powered by Google App Engine
This is Rietveld 408576698