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

Side by Side Diff: pkg/kernel/lib/binary/ast_from_binary.dart

Issue 2748333002: [kernel] offsets on direct property get/set (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « pkg/kernel/binary.md ('k') | pkg/kernel/lib/binary/ast_to_binary.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library kernel.ast_from_binary; 4 library kernel.ast_from_binary;
5 5
6 import 'dart:convert'; 6 import 'dart:convert';
7 import 'dart:typed_data'; 7 import 'dart:typed_data';
8 8
9 import '../ast.dart'; 9 import '../ast.dart';
10 import '../transformations/flags.dart'; 10 import '../transformations/flags.dart';
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 readMemberReference(allowNull: true))..fileOffset = offset; 680 readMemberReference(allowNull: true))..fileOffset = offset;
681 case Tag.SuperPropertyGet: 681 case Tag.SuperPropertyGet:
682 addTransformerFlag(TransformerFlag.superCalls); 682 addTransformerFlag(TransformerFlag.superCalls);
683 return new SuperPropertyGet.byReference( 683 return new SuperPropertyGet.byReference(
684 readName(), readMemberReference(allowNull: true)); 684 readName(), readMemberReference(allowNull: true));
685 case Tag.SuperPropertySet: 685 case Tag.SuperPropertySet:
686 addTransformerFlag(TransformerFlag.superCalls); 686 addTransformerFlag(TransformerFlag.superCalls);
687 return new SuperPropertySet.byReference( 687 return new SuperPropertySet.byReference(
688 readName(), readExpression(), readMemberReference(allowNull: true)); 688 readName(), readExpression(), readMemberReference(allowNull: true));
689 case Tag.DirectPropertyGet: 689 case Tag.DirectPropertyGet:
690 int offset = readOffset();
690 return new DirectPropertyGet.byReference( 691 return new DirectPropertyGet.byReference(
691 readExpression(), readMemberReference()); 692 readExpression(), readMemberReference())..fileOffset = offset;
692 case Tag.DirectPropertySet: 693 case Tag.DirectPropertySet:
694 int offset = readOffset();
693 return new DirectPropertySet.byReference( 695 return new DirectPropertySet.byReference(
694 readExpression(), readMemberReference(), readExpression()); 696 readExpression(), readMemberReference(), readExpression())
697 ..fileOffset = offset;
695 case Tag.StaticGet: 698 case Tag.StaticGet:
696 int offset = readOffset(); 699 int offset = readOffset();
697 return new StaticGet.byReference(readMemberReference()) 700 return new StaticGet.byReference(readMemberReference())
698 ..fileOffset = offset; 701 ..fileOffset = offset;
699 case Tag.StaticSet: 702 case Tag.StaticSet:
700 int offset = readOffset(); 703 int offset = readOffset();
701 return new StaticSet.byReference( 704 return new StaticSet.byReference(
702 readMemberReference(), readExpression())..fileOffset = offset; 705 readMemberReference(), readExpression())..fileOffset = offset;
703 case Tag.MethodInvocation: 706 case Tag.MethodInvocation:
704 int offset = readOffset(); 707 int offset = readOffset();
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 ..fileOffset = offset 1111 ..fileOffset = offset
1109 ..fileEqualsOffset = fileEqualsOffset; 1112 ..fileEqualsOffset = fileEqualsOffset;
1110 } 1113 }
1111 1114
1112 int readOffset() { 1115 int readOffset() {
1113 // Offset is saved as unsigned, 1116 // Offset is saved as unsigned,
1114 // but actually ranges from -1 and up (thus the -1) 1117 // but actually ranges from -1 and up (thus the -1)
1115 return readUInt() - 1; 1118 return readUInt() - 1;
1116 } 1119 }
1117 } 1120 }
OLDNEW
« no previous file with comments | « pkg/kernel/binary.md ('k') | pkg/kernel/lib/binary/ast_to_binary.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698