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 import '../closure.dart'; | 5 import '../closure.dart'; |
6 import '../constants/constant_system.dart'; | 6 import '../constants/constant_system.dart'; |
7 import '../common/codegen.dart' show CodegenRegistry; | 7 import '../common/codegen.dart' show CodegenRegistry; |
8 import '../common_elements.dart'; | 8 import '../common_elements.dart'; |
9 import '../compiler.dart'; | 9 import '../compiler.dart'; |
10 import '../deferred_load.dart'; | 10 import '../deferred_load.dart'; |
11 import '../diagnostics/diagnostic_listener.dart'; | 11 import '../diagnostics/diagnostic_listener.dart'; |
12 import '../elements/elements.dart'; | 12 import '../elements/elements.dart'; |
13 import '../elements/entities.dart' show Entity, Local; | 13 import '../elements/entities.dart' show Entity, Local; |
14 import '../elements/resolution_types.dart'; | 14 import '../elements/resolution_types.dart'; |
| 15 import '../elements/types.dart'; |
| 16 import '../js_backend/backend.dart'; |
15 import '../js_backend/backend_usage.dart'; | 17 import '../js_backend/backend_usage.dart'; |
16 import '../js_backend/constant_handler_javascript.dart'; | 18 import '../js_backend/constant_handler_javascript.dart'; |
17 import '../js_backend/js_backend.dart'; | 19 import '../js_backend/namer.dart'; |
18 import '../js_backend/native_data.dart'; | 20 import '../js_backend/native_data.dart'; |
19 import '../js_backend/js_interop_analysis.dart'; | 21 import '../js_backend/js_interop_analysis.dart'; |
20 import '../js_backend/interceptor_data.dart'; | 22 import '../js_backend/interceptor_data.dart'; |
21 import '../js_backend/mirrors_data.dart'; | 23 import '../js_backend/mirrors_data.dart'; |
| 24 import '../js_backend/runtime_types.dart'; |
22 import '../js_emitter/code_emitter_task.dart'; | 25 import '../js_emitter/code_emitter_task.dart'; |
23 import '../options.dart'; | 26 import '../options.dart'; |
24 import '../resolution/tree_elements.dart'; | 27 import '../resolution/tree_elements.dart'; |
25 import '../types/types.dart'; | 28 import '../types/types.dart'; |
26 import '../world.dart' show ClosedWorld; | 29 import '../world.dart' show ClosedWorld; |
27 import 'jump_handler.dart'; | 30 import 'jump_handler.dart'; |
28 import 'locals_handler.dart'; | 31 import 'locals_handler.dart'; |
29 import 'nodes.dart'; | 32 import 'nodes.dart'; |
30 import 'type_builder.dart'; | 33 import 'type_builder.dart'; |
31 | 34 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 Element get sourceElement; | 246 Element get sourceElement; |
244 | 247 |
245 // TODO(karlklose): this is needed to avoid a bug where the resolved type is | 248 // TODO(karlklose): this is needed to avoid a bug where the resolved type is |
246 // not stored on a type annotation in the closure translator. Remove when | 249 // not stored on a type annotation in the closure translator. Remove when |
247 // fixed. | 250 // fixed. |
248 bool hasDirectLocal(Local local) { | 251 bool hasDirectLocal(Local local) { |
249 return !localsHandler.isAccessedDirectly(local) || | 252 return !localsHandler.isAccessedDirectly(local) || |
250 localsHandler.directLocals[local] != null; | 253 localsHandler.directLocals[local] != null; |
251 } | 254 } |
252 | 255 |
253 HInstruction callSetRuntimeTypeInfoWithTypeArguments(ResolutionDartType type, | 256 HInstruction callSetRuntimeTypeInfoWithTypeArguments(InterfaceType type, |
254 List<HInstruction> rtiInputs, HInstruction newObject) { | 257 List<HInstruction> rtiInputs, HInstruction newObject) { |
255 if (!rtiNeed.classNeedsRti(type.element)) { | 258 if (!rtiNeed.classNeedsRti(type.element)) { |
256 return newObject; | 259 return newObject; |
257 } | 260 } |
258 | 261 |
259 HInstruction typeInfo = new HTypeInfoExpression( | 262 HInstruction typeInfo = new HTypeInfoExpression( |
260 TypeInfoExpressionKind.INSTANCE, | 263 TypeInfoExpressionKind.INSTANCE, |
261 (type.element as ClassElement).thisType, | 264 (type.element as ClassElement).thisType, |
262 rtiInputs, | 265 rtiInputs, |
263 closedWorld.commonMasks.dynamicType); | 266 closedWorld.commonMasks.dynamicType); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 return mirrorsData.mustRetainMetadata; | 298 return mirrorsData.mustRetainMetadata; |
296 case 'USE_CONTENT_SECURITY_POLICY': | 299 case 'USE_CONTENT_SECURITY_POLICY': |
297 return options.useContentSecurityPolicy; | 300 return options.useContentSecurityPolicy; |
298 case 'IS_FULL_EMITTER': | 301 case 'IS_FULL_EMITTER': |
299 return !USE_LAZY_EMITTER && !options.useStartupEmitter; | 302 return !USE_LAZY_EMITTER && !options.useStartupEmitter; |
300 default: | 303 default: |
301 return null; | 304 return null; |
302 } | 305 } |
303 } | 306 } |
304 } | 307 } |
OLD | NEW |