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

Unified Diff: pkg/analyzer/tool/summary/generate.dart

Issue 1998833002: Use BufferContext + offset instead of BufferPointer. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: tweaks Created 4 years, 7 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 | « pkg/analyzer/tool/summary/build_sdk_summaries.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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('}');
}
« no previous file with comments | « pkg/analyzer/tool/summary/build_sdk_summaries.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698