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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 48383003: Support checking of malbounded types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of js_backend; 5 part of js_backend;
6 6
7 class JavaScriptItemCompilationContext extends ItemCompilationContext { 7 class JavaScriptItemCompilationContext extends ItemCompilationContext {
8 final Set<HInstruction> boundsChecked; 8 final Set<HInstruction> boundsChecked;
9 9
10 JavaScriptItemCompilationContext() 10 JavaScriptItemCompilationContext()
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after
1070 enqueueClass(compiler.enqueuer.resolution, compiler.listClass, elements); 1070 enqueueClass(compiler.enqueuer.resolution, compiler.listClass, elements);
1071 enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, elements); 1071 enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, elements);
1072 } 1072 }
1073 1073
1074 void registerThrowRuntimeError(TreeElements elements) { 1074 void registerThrowRuntimeError(TreeElements elements) {
1075 enqueueInResolution(getThrowRuntimeError(), elements); 1075 enqueueInResolution(getThrowRuntimeError(), elements);
1076 // Also register the types of the arguments passed to this method. 1076 // Also register the types of the arguments passed to this method.
1077 enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, elements); 1077 enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, elements);
1078 } 1078 }
1079 1079
1080 void registerTypeVariableBoundsSubtypeCheck(DartType typeArgument,
1081 DartType bound) {
1082 rti.registerTypeVariableBoundsSubtypeCheck(typeArgument, bound);
1083 }
1084
1085 void registerTypeVariableBoundCheck(TreeElements elements) {
1086 enqueueInResolution(getThrowTypeError(), elements);
1087 enqueueInResolution(getAssertIsSubtype(), elements);
1088 }
1089
1080 void registerAbstractClassInstantiation(TreeElements elements) { 1090 void registerAbstractClassInstantiation(TreeElements elements) {
1081 enqueueInResolution(getThrowAbstractClassInstantiationError(), elements); 1091 enqueueInResolution(getThrowAbstractClassInstantiationError(), elements);
1082 // Also register the types of the arguments passed to this method. 1092 // Also register the types of the arguments passed to this method.
1083 enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, elements); 1093 enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, elements);
1084 } 1094 }
1085 1095
1086 void registerFallThroughError(TreeElements elements) { 1096 void registerFallThroughError(TreeElements elements) {
1087 enqueueInResolution(getFallThroughError(), elements); 1097 enqueueInResolution(getFallThroughError(), elements);
1088 } 1098 }
1089 1099
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 } 1485 }
1476 1486
1477 Element getExceptionUnwrapper() { 1487 Element getExceptionUnwrapper() {
1478 return compiler.findHelper('unwrapException'); 1488 return compiler.findHelper('unwrapException');
1479 } 1489 }
1480 1490
1481 Element getThrowRuntimeError() { 1491 Element getThrowRuntimeError() {
1482 return compiler.findHelper('throwRuntimeError'); 1492 return compiler.findHelper('throwRuntimeError');
1483 } 1493 }
1484 1494
1495 Element getThrowTypeError() {
1496 return compiler.findHelper('throwTypeError');
1497 }
1498
1485 Element getThrowAbstractClassInstantiationError() { 1499 Element getThrowAbstractClassInstantiationError() {
1486 return compiler.findHelper('throwAbstractClassInstantiationError'); 1500 return compiler.findHelper('throwAbstractClassInstantiationError');
1487 } 1501 }
1488 1502
1489 Element getStringInterpolationHelper() { 1503 Element getStringInterpolationHelper() {
1490 return compiler.findHelper('S'); 1504 return compiler.findHelper('S');
1491 } 1505 }
1492 1506
1493 Element getWrapExceptionHelper() { 1507 Element getWrapExceptionHelper() {
1494 return compiler.findHelper(r'wrapException'); 1508 return compiler.findHelper(r'wrapException');
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 } 1541 }
1528 1542
1529 Element getGetRuntimeTypeArgument() { 1543 Element getGetRuntimeTypeArgument() {
1530 return compiler.findHelper('getRuntimeTypeArgument'); 1544 return compiler.findHelper('getRuntimeTypeArgument');
1531 } 1545 }
1532 1546
1533 Element getRuntimeTypeToString() { 1547 Element getRuntimeTypeToString() {
1534 return compiler.findHelper('runtimeTypeToString'); 1548 return compiler.findHelper('runtimeTypeToString');
1535 } 1549 }
1536 1550
1551 Element getAssertIsSubtype() {
1552 return compiler.findHelper('assertIsSubtype');
1553 }
1554
1537 Element getCheckSubtype() { 1555 Element getCheckSubtype() {
1538 return compiler.findHelper('checkSubtype'); 1556 return compiler.findHelper('checkSubtype');
1539 } 1557 }
1540 1558
1541 Element getAssertSubtype() { 1559 Element getAssertSubtype() {
1542 return compiler.findHelper('assertSubtype'); 1560 return compiler.findHelper('assertSubtype');
1543 } 1561 }
1544 1562
1545 Element getCheckSubtypeOfRuntimeType() { 1563 Element getCheckSubtypeOfRuntimeType() {
1546 return compiler.findHelper('checkSubtypeOfRuntimeType'); 1564 return compiler.findHelper('checkSubtypeOfRuntimeType');
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1873 copy(constant.values); 1891 copy(constant.values);
1874 copy(constant.protoValue); 1892 copy(constant.protoValue);
1875 copy(constant); 1893 copy(constant);
1876 } 1894 }
1877 1895
1878 void visitConstructed(ConstructedConstant constant) { 1896 void visitConstructed(ConstructedConstant constant) {
1879 copy(constant.fields); 1897 copy(constant.fields);
1880 copy(constant); 1898 copy(constant);
1881 } 1899 }
1882 } 1900 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698