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 | 4 |
5 library js_backend.serialization; | 5 library js_backend.serialization; |
6 | 6 |
7 import '../common/backend_api.dart' show BackendSerialization; | 7 import '../common/backend_api.dart' show BackendSerialization; |
8 import '../dart_types.dart'; | 8 import '../dart_types.dart'; |
9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
10 import '../js/js.dart' as js; | 10 import '../js/js.dart' as js; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 SideEffects sideEffects = | 133 SideEffects sideEffects = |
134 new SideEffects.fromFlags(decoder.getInt(SIDE_EFFECTS)); | 134 new SideEffects.fromFlags(decoder.getInt(SIDE_EFFECTS)); |
135 NativeBehavior behavior = new NativeBehavior.internal(sideEffects); | 135 NativeBehavior behavior = new NativeBehavior.internal(sideEffects); |
136 | 136 |
137 behavior.typesReturned | 137 behavior.typesReturned |
138 .addAll(decoder.getTypes(DART_TYPES_RETURNED, isOptional: true)); | 138 .addAll(decoder.getTypes(DART_TYPES_RETURNED, isOptional: true)); |
139 behavior.typesReturned.addAll(decoder | 139 behavior.typesReturned.addAll(decoder |
140 .getStrings(SPECIAL_TYPES_RETURNED, isOptional: true) | 140 .getStrings(SPECIAL_TYPES_RETURNED, isOptional: true) |
141 .map(SpecialType.fromName)); | 141 .map(SpecialType.fromName)); |
142 | 142 |
143 behavior.typesReturned | 143 behavior.typesInstantiated |
144 .addAll(decoder.getTypes(DART_TYPES_INSTANTIATED, isOptional: true)); | 144 .addAll(decoder.getTypes(DART_TYPES_INSTANTIATED, isOptional: true)); |
145 behavior.typesReturned.addAll(decoder | 145 behavior.typesInstantiated.addAll(decoder |
146 .getStrings(SPECIAL_TYPES_INSTANTIATED, isOptional: true) | 146 .getStrings(SPECIAL_TYPES_INSTANTIATED, isOptional: true) |
147 .map(SpecialType.fromName)); | 147 .map(SpecialType.fromName)); |
148 | 148 |
149 behavior.codeTemplateText = | 149 behavior.codeTemplateText = |
150 decoder.getString(CODE_TEMPLATE, isOptional: true); | 150 decoder.getString(CODE_TEMPLATE, isOptional: true); |
151 if (behavior.codeTemplateText != null) { | 151 if (behavior.codeTemplateText != null) { |
152 behavior.codeTemplate = js.js.parseForeignJS(behavior.codeTemplateText); | 152 behavior.codeTemplate = js.js.parseForeignJS(behavior.codeTemplateText); |
153 } | 153 } |
154 | 154 |
155 behavior.throwBehavior = | 155 behavior.throwBehavior = |
156 decoder.getEnum(THROW_BEHAVIOR, NativeThrowBehavior.values); | 156 decoder.getEnum(THROW_BEHAVIOR, NativeThrowBehavior.values); |
157 behavior.isAllocation = decoder.getBool(IS_ALLOCATION); | 157 behavior.isAllocation = decoder.getBool(IS_ALLOCATION); |
158 behavior.useGvn = decoder.getBool(USE_GVN); | 158 behavior.useGvn = decoder.getBool(USE_GVN); |
159 return behavior; | 159 return behavior; |
160 } | 160 } |
161 } | 161 } |
OLD | NEW |