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

Side by Side Diff: pkg/compiler/lib/src/js_backend/impact_transformer.dart

Issue 2721403006: Split NativeData (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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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.backend.impact_transformer; 5 library js_backend.backend.impact_transformer;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/backend_api.dart' show ImpactTransformer; 8 import '../common/backend_api.dart' show ImpactTransformer;
9 import '../common/codegen.dart' show CodegenImpact; 9 import '../common/codegen.dart' show CodegenImpact;
10 import '../common/resolution.dart' show ResolutionImpact; 10 import '../common/resolution.dart' show ResolutionImpact;
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 if (type.isTypeVariable) { 297 if (type.isTypeVariable) {
298 registerImpact(impacts.typeVariableTypeCheck); 298 registerImpact(impacts.typeVariableTypeCheck);
299 if (inCheckedMode) { 299 if (inCheckedMode) {
300 registerImpact(impacts.typeVariableCheckedModeTypeCheck); 300 registerImpact(impacts.typeVariableCheckedModeTypeCheck);
301 } 301 }
302 } 302 }
303 } 303 }
304 if (type is ResolutionFunctionType) { 304 if (type is ResolutionFunctionType) {
305 registerImpact(impacts.functionTypeCheck); 305 registerImpact(impacts.functionTypeCheck);
306 } 306 }
307 if (type.element != null && backend.isNative(type.element)) { 307 if (type is ResolutionInterfaceType &&
308 backend.nativeData.isNativeClass(type.element)) {
308 registerImpact(impacts.nativeTypeCheck); 309 registerImpact(impacts.nativeTypeCheck);
309 } 310 }
310 } 311 }
311 312
312 void onIsCheckForCodegen( 313 void onIsCheckForCodegen(
313 ResolutionDartType type, TransformedWorldImpact transformed) { 314 ResolutionDartType type, TransformedWorldImpact transformed) {
314 if (type.isDynamic) return; 315 if (type.isDynamic) return;
315 type = type.unaliased; 316 type = type.unaliased;
316 impacts.typeCheck.registerImpact(transformed, elementEnvironment); 317 impacts.typeCheck.registerImpact(transformed, elementEnvironment);
317 318
(...skipping 15 matching lines...) Expand all
333 helper = backend.checkedModeHelpers 334 helper = backend.checkedModeHelpers
334 .getNativeCheckedModeHelper(type, typeCast: false); 335 .getNativeCheckedModeHelper(type, typeCast: false);
335 if (helper != null) { 336 if (helper != null) {
336 StaticUse staticUse = helper.getStaticUse(backend.helpers); 337 StaticUse staticUse = helper.getStaticUse(backend.helpers);
337 transformed.registerStaticUse(staticUse); 338 transformed.registerStaticUse(staticUse);
338 } 339 }
339 } 340 }
340 if (!type.treatAsRaw || type.containsTypeVariables) { 341 if (!type.treatAsRaw || type.containsTypeVariables) {
341 impacts.genericIsCheck.registerImpact(transformed, elementEnvironment); 342 impacts.genericIsCheck.registerImpact(transformed, elementEnvironment);
342 } 343 }
343 if (type.element != null && backend.isNative(type.element)) { 344 if (type is ResolutionInterfaceType &&
345 backend.nativeData.isNativeClass(type.element)) {
344 // We will neeed to add the "$is" and "$as" properties on the 346 // We will neeed to add the "$is" and "$as" properties on the
345 // JavaScript object prototype, so we make sure 347 // JavaScript object prototype, so we make sure
346 // [:defineProperty:] is compiled. 348 // [:defineProperty:] is compiled.
347 impacts.nativeTypeCheck.registerImpact(transformed, elementEnvironment); 349 impacts.nativeTypeCheck.registerImpact(transformed, elementEnvironment);
348 } 350 }
349 } 351 }
350 352
351 @override 353 @override
352 WorldImpact transformCodegenImpact(CodegenImpact impact) { 354 WorldImpact transformCodegenImpact(CodegenImpact impact) {
353 TransformedWorldImpact transformed = new TransformedWorldImpact(impact); 355 TransformedWorldImpact transformed = new TransformedWorldImpact(impact);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 case AsyncMarker.ASYNC_STAR: 426 case AsyncMarker.ASYNC_STAR:
425 impacts.asyncStarBody.registerImpact(transformed, elementEnvironment); 427 impacts.asyncStarBody.registerImpact(transformed, elementEnvironment);
426 break; 428 break;
427 } 429 }
428 } 430 }
429 431
430 // TODO(johnniwinther): Remove eager registration. 432 // TODO(johnniwinther): Remove eager registration.
431 return transformed; 433 return transformed;
432 } 434 }
433 } 435 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698