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

Unified Diff: pkg/analyzer/lib/src/summary/flat_buffers.dart

Issue 1568343002: Support for writing Int32 lists. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/flat_buffers_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/flat_buffers.dart
diff --git a/pkg/analyzer/lib/src/summary/flat_buffers.dart b/pkg/analyzer/lib/src/summary/flat_buffers.dart
index 85fd0c9be99a93b6223147d7caaddf2b6a60f0be..f3e1e88f18fc2a57754eedd6ebfaa100a9194f29 100644
--- a/pkg/analyzer/lib/src/summary/flat_buffers.dart
+++ b/pkg/analyzer/lib/src/summary/flat_buffers.dart
@@ -249,6 +249,26 @@ class Builder {
}
/**
+ * Write the given list of signed 32-bit integer [values].
+ */
+ Offset writeListInt32(List<int> values) {
+ if (_currentVTableBuilder != null) {
+ throw new StateError(
+ 'Cannot write a non-scalar value while writing a table.');
+ }
+ _prepare(4, 1 + values.length);
+ Offset result = new Offset(_tail);
+ int tail = _tail;
+ _setUint32AtTail(_buf, tail, values.length);
+ tail -= 4;
+ for (int value in values) {
+ _setInt32AtTail(_buf, tail, value);
+ tail -= 4;
+ }
+ return result;
+ }
+
+ /**
* Write the given string [value] and return its [Offset], or `null` if
* the [value] is equal to [def].
*/
@@ -329,7 +349,7 @@ class Int32Reader extends Reader<int> {
const Int32Reader() : super();
@override
- int get size => 2;
+ int get size => 4;
@override
int read(BufferPointer bp) => bp._getInt32();
@@ -349,7 +369,7 @@ class Int8Reader extends Reader<int> {
}
/**
- * The reader of object.
+ * The reader of lists of objects.
*
* The returned unmodifiable lists lazily read objects on access.
*/
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/flat_buffers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698