| Index: pkg/analyzer/tool/summary/generate.dart
|
| diff --git a/pkg/analyzer/tool/summary/generate.dart b/pkg/analyzer/tool/summary/generate.dart
|
| index 51dad39cfa4c33cff46d39245972d273c1a9d710..4f9018e545f7fbd49f26b473bcdec22f742f02c9 100644
|
| --- a/pkg/analyzer/tool/summary/generate.dart
|
| +++ b/pkg/analyzer/tool/summary/generate.dart
|
| @@ -749,9 +749,9 @@ class _CodeGenerator {
|
| out('int get size => 1;');
|
| out();
|
| out('@override');
|
| - out('${idlPrefix(name)} read(fb.BufferPointer bp) {');
|
| + out('${idlPrefix(name)} read(fb.BufferContext bc, int offset) {');
|
| indent(() {
|
| - out('int index = const fb.Uint8Reader().read(bp);');
|
| + out('int index = const fb.Uint8Reader().read(bc, offset);');
|
| out('return index < $count ? ${idlPrefix(name)}.values[index] : $def;');
|
| });
|
| out('}');
|
| @@ -766,9 +766,10 @@ class _CodeGenerator {
|
| out('class $implName extends Object with $mixinName'
|
| ' implements ${idlPrefix(name)} {');
|
| indent(() {
|
| - out('final fb.BufferPointer _bp;');
|
| + out('final fb.BufferContext _bc;');
|
| + out('final int _bcOffset;');
|
| out();
|
| - out('$implName(this._bp);');
|
| + out('$implName(this._bc, this._bcOffset);');
|
| out();
|
| // Write cache fields.
|
| for (idlModel.FieldDeclaration field in cls.fields) {
|
| @@ -824,7 +825,7 @@ class _CodeGenerator {
|
| } else {
|
| out('$returnType get $fieldName {');
|
| indent(() {
|
| - String readExpr = '$readCode.vTableGet(_bp, $index, $def)';
|
| + String readExpr = '$readCode.vTableGet(_bc, _bcOffset, $index, $def)';
|
| out('_$fieldName ??= $readExpr;');
|
| out('return _$fieldName;');
|
| });
|
| @@ -906,7 +907,7 @@ class _CodeGenerator {
|
| out('const $readerName();');
|
| out();
|
| out('@override');
|
| - out('$implName createObject(fb.BufferPointer bp) => new $implName(bp);');
|
| + out('$implName createObject(fb.BufferContext bc, int offset) => new $implName(bc, offset);');
|
| });
|
| out('}');
|
| }
|
| @@ -915,8 +916,8 @@ class _CodeGenerator {
|
| String name = cls.name;
|
| out('${idlPrefix(name)} read$name(List<int> buffer) {');
|
| indent(() {
|
| - out('fb.BufferPointer rootRef = new fb.BufferPointer.fromBytes(buffer);');
|
| - out('return const _${name}Reader().read(rootRef);');
|
| + out('fb.BufferContext rootRef = new fb.BufferContext.fromBytes(buffer);');
|
| + out('return const _${name}Reader().read(rootRef, 0);');
|
| });
|
| out('}');
|
| }
|
|
|