Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 630 : (tagByte & Tag.SpecializedTagMask); | 630 : (tagByte & Tag.SpecializedTagMask); |
| 631 switch (tag) { | 631 switch (tag) { |
| 632 case Tag.LoadLibrary: | 632 case Tag.LoadLibrary: |
| 633 return new LoadLibrary(readDeferredImportReference()); | 633 return new LoadLibrary(readDeferredImportReference()); |
| 634 case Tag.CheckLibraryIsLoaded: | 634 case Tag.CheckLibraryIsLoaded: |
| 635 return new CheckLibraryIsLoaded(readDeferredImportReference()); | 635 return new CheckLibraryIsLoaded(readDeferredImportReference()); |
| 636 case Tag.InvalidExpression: | 636 case Tag.InvalidExpression: |
| 637 return new InvalidExpression(); | 637 return new InvalidExpression(); |
| 638 case Tag.VariableGet: | 638 case Tag.VariableGet: |
| 639 int offset = readOffset(); | 639 int offset = readOffset(); |
| 640 readUInt(); // offset in binary. Unused here. | |
|
Kevin Millikin (Google)
2017/04/05 08:59:57
// Offset of the declaration.
I think it's obviou
| |
| 640 return new VariableGet(readVariableReference(), readDartTypeOption()) | 641 return new VariableGet(readVariableReference(), readDartTypeOption()) |
| 641 ..fileOffset = offset; | 642 ..fileOffset = offset; |
| 642 case Tag.SpecializedVariableGet: | 643 case Tag.SpecializedVariableGet: |
| 643 int index = tagByte & Tag.SpecializedPayloadMask; | 644 int index = tagByte & Tag.SpecializedPayloadMask; |
| 644 int offset = readOffset(); | 645 int offset = readOffset(); |
| 646 readUInt(); // offset in binary. Unused here. | |
| 645 return new VariableGet(variableStack[index])..fileOffset = offset; | 647 return new VariableGet(variableStack[index])..fileOffset = offset; |
| 646 case Tag.VariableSet: | 648 case Tag.VariableSet: |
| 647 int offset = readOffset(); | 649 int offset = readOffset(); |
| 648 return new VariableSet(readVariableReference(), readExpression()) | 650 return new VariableSet(readVariableReference(), readExpression()) |
| 649 ..fileOffset = offset; | 651 ..fileOffset = offset; |
| 650 case Tag.SpecializedVariableSet: | 652 case Tag.SpecializedVariableSet: |
| 651 int index = tagByte & Tag.SpecializedPayloadMask; | 653 int index = tagByte & Tag.SpecializedPayloadMask; |
| 652 int offset = readOffset(); | 654 int offset = readOffset(); |
| 653 return new VariableSet(variableStack[index], readExpression()) | 655 return new VariableSet(variableStack[index], readExpression()) |
| 654 ..fileOffset = offset; | 656 ..fileOffset = offset; |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1119 ..fileOffset = offset | 1121 ..fileOffset = offset |
| 1120 ..fileEqualsOffset = fileEqualsOffset; | 1122 ..fileEqualsOffset = fileEqualsOffset; |
| 1121 } | 1123 } |
| 1122 | 1124 |
| 1123 int readOffset() { | 1125 int readOffset() { |
| 1124 // Offset is saved as unsigned, | 1126 // Offset is saved as unsigned, |
| 1125 // but actually ranges from -1 and up (thus the -1) | 1127 // but actually ranges from -1 and up (thus the -1) |
| 1126 return readUInt() - 1; | 1128 return readUInt() - 1; |
| 1127 } | 1129 } |
| 1128 } | 1130 } |
| OLD | NEW |