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

Side by Side Diff: pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart

Issue 1112563002: Refactor SsaBuilder.visitStaticSend and visitGetterSend. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 5 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart2js.semantics_visitor; 5 part of dart2js.semantics_visitor;
6 6
7 /// Interface for bulk handling of a [Node] in a semantic visitor. 7 /// Interface for bulk handling of a [Node] in a semantic visitor.
8 abstract class BulkHandle<R, A> { 8 abstract class BulkHandle<R, A> {
9 /// Handle [node] either regardless of semantics or to report that [node] is 9 /// Handle [node] either regardless of semantics or to report that [node] is
10 /// unhandled. [message] contains a message template for the latter case: 10 /// unhandled. [message] contains a message template for the latter case:
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 NewExpression node, 458 NewExpression node,
459 Element constructor, 459 Element constructor,
460 DartType type, 460 DartType type,
461 NodeList arguments, 461 NodeList arguments,
462 Selector selector, 462 Selector selector,
463 A arg) { 463 A arg) {
464 return bulkHandleError(node, arg); 464 return bulkHandleError(node, arg);
465 } 465 }
466 466
467 @override 467 @override
468 R errorUnresolvedGet(
469 Send node,
470 Element element,
471 A arg) {
472 return bulkHandleError(node, arg);
473 }
474
475 @override
476 R errorUnresolvedInvoke(
477 Send node,
478 Element element,
479 NodeList arguments,
480 Selector selector,
481 A arg) {
482 return bulkHandleError(node, arg);
483 }
484
485 @override
486 R errorUnresolvedPostfix( 468 R errorUnresolvedPostfix(
487 Send node, 469 Send node,
488 Element element, 470 Element element,
489 IncDecOperator operator, 471 IncDecOperator operator,
490 A arg) { 472 A arg) {
491 return bulkHandleError(node, arg); 473 return bulkHandleError(node, arg);
492 } 474 }
493 475
494 @override 476 @override
495 R errorUnresolvedPrefix( 477 R errorUnresolvedPrefix(
(...skipping 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1231 R visitStaticFunctionInvoke( 1213 R visitStaticFunctionInvoke(
1232 Send node, 1214 Send node,
1233 MethodElement function, 1215 MethodElement function,
1234 NodeList arguments, 1216 NodeList arguments,
1235 CallStructure callStructure, 1217 CallStructure callStructure,
1236 A arg) { 1218 A arg) {
1237 return bulkHandleInvoke(node, arg); 1219 return bulkHandleInvoke(node, arg);
1238 } 1220 }
1239 1221
1240 @override 1222 @override
1223 R visitStaticFunctionIncompatibleInvoke(
1224 Send node,
1225 MethodElement function,
1226 NodeList arguments,
1227 CallStructure callStructure,
1228 A arg) {
1229 return bulkHandleInvoke(node, arg);
1230 }
1231
1232 @override
1241 R visitStaticGetterInvoke( 1233 R visitStaticGetterInvoke(
1242 Send node, 1234 Send node,
1243 FunctionElement getter, 1235 FunctionElement getter,
1244 NodeList arguments, 1236 NodeList arguments,
1245 CallStructure callStructure, 1237 CallStructure callStructure,
1246 A arg) { 1238 A arg) {
1247 return bulkHandleInvoke(node, arg); 1239 return bulkHandleInvoke(node, arg);
1248 } 1240 }
1249 1241
1250 @override 1242 @override
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1319 R visitTopLevelFunctionInvoke( 1311 R visitTopLevelFunctionInvoke(
1320 Send node, 1312 Send node,
1321 MethodElement function, 1313 MethodElement function,
1322 NodeList arguments, 1314 NodeList arguments,
1323 CallStructure callStructure, 1315 CallStructure callStructure,
1324 A arg) { 1316 A arg) {
1325 return bulkHandleInvoke(node, arg); 1317 return bulkHandleInvoke(node, arg);
1326 } 1318 }
1327 1319
1328 @override 1320 @override
1321 R visitTopLevelFunctionIncompatibleInvoke(
1322 Send node,
1323 MethodElement function,
1324 NodeList arguments,
1325 CallStructure callStructure,
1326 A arg) {
1327 return bulkHandleInvoke(node, arg);
1328 }
1329
1330 @override
1329 R visitTopLevelGetterInvoke( 1331 R visitTopLevelGetterInvoke(
1330 Send node, 1332 Send node,
1331 FunctionElement getter, 1333 FunctionElement getter,
1332 NodeList arguments, 1334 NodeList arguments,
1333 CallStructure callStructure, 1335 CallStructure callStructure,
1334 A arg) { 1336 A arg) {
1335 return bulkHandleInvoke(node, arg); 1337 return bulkHandleInvoke(node, arg);
1336 } 1338 }
1337 1339
1338 @override 1340 @override
(...skipping 20 matching lines...) Expand all
1359 R visitConstantInvoke( 1361 R visitConstantInvoke(
1360 Send node, 1362 Send node,
1361 ConstantExpression constant, 1363 ConstantExpression constant,
1362 NodeList arguments, 1364 NodeList arguments,
1363 CallStructure callStructure, 1365 CallStructure callStructure,
1364 A arg) { 1366 A arg) {
1365 return bulkHandleInvoke(node, arg); 1367 return bulkHandleInvoke(node, arg);
1366 } 1368 }
1367 1369
1368 @override 1370 @override
1371 R visitUnresolvedInvoke(
1372 Send node,
1373 Element element,
1374 NodeList arguments,
1375 Selector selector,
1376 A arg) {
1377 return bulkHandleInvoke(node, arg);
1378 }
1379
1380 @override
1369 R visitUnresolvedSuperInvoke( 1381 R visitUnresolvedSuperInvoke(
1370 Send node, 1382 Send node,
1371 Element function, 1383 Element function,
1372 NodeList arguments, 1384 NodeList arguments,
1373 Selector selector, 1385 Selector selector,
1374 A arg) { 1386 A arg) {
1375 return bulkHandleInvoke(node, arg); 1387 return bulkHandleInvoke(node, arg);
1376 } 1388 }
1377 } 1389 }
1378 1390
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
1540 1552
1541 @override 1553 @override
1542 R visitConstantGet( 1554 R visitConstantGet(
1543 Send node, 1555 Send node,
1544 ConstantExpression constant, 1556 ConstantExpression constant,
1545 A arg) { 1557 A arg) {
1546 return bulkHandleGet(node, arg); 1558 return bulkHandleGet(node, arg);
1547 } 1559 }
1548 1560
1549 @override 1561 @override
1562 R visitUnresolvedGet(
1563 Send node,
1564 Element element,
1565 A arg) {
1566 return bulkHandleGet(node, arg);
1567 }
1568
1569 @override
1550 R visitUnresolvedSuperGet( 1570 R visitUnresolvedSuperGet(
1551 Send node, 1571 Send node,
1552 Element element, 1572 Element element,
1553 A arg) { 1573 A arg) {
1554 return bulkHandleGet(node, arg); 1574 return bulkHandleGet(node, arg);
1555 } 1575 }
1556 } 1576 }
1557 1577
1558 /// Mixin that implements all `visitXSet` methods of [SemanticSendVisitor] by 1578 /// Mixin that implements all `visitXSet` methods of [SemanticSendVisitor] by
1559 /// delegating to a bulk handler. 1579 /// delegating to a bulk handler.
(...skipping 2203 matching lines...) Expand 10 before | Expand all | Expand 10 after
3763 Send node, 3783 Send node,
3764 MethodElement function, 3784 MethodElement function,
3765 NodeList arguments, 3785 NodeList arguments,
3766 CallStructure callStructure, 3786 CallStructure callStructure,
3767 A arg) { 3787 A arg) {
3768 apply(arguments, arg); 3788 apply(arguments, arg);
3769 return null; 3789 return null;
3770 } 3790 }
3771 3791
3772 @override 3792 @override
3793 R visitStaticFunctionIncompatibleInvoke(
3794 Send node,
3795 MethodElement function,
3796 NodeList arguments,
3797 CallStructure callStructure,
3798 A arg) {
3799 apply(arguments, arg);
3800 return null;
3801 }
3802
3803 @override
3773 R visitStaticGetterGet( 3804 R visitStaticGetterGet(
3774 Send node, 3805 Send node,
3775 FunctionElement getter, 3806 FunctionElement getter,
3776 A arg) { 3807 A arg) {
3777 return null; 3808 return null;
3778 } 3809 }
3779 3810
3780 @override 3811 @override
3781 R visitStaticGetterInvoke( 3812 R visitStaticGetterInvoke(
3782 Send node, 3813 Send node,
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
4348 Send node, 4379 Send node,
4349 MethodElement function, 4380 MethodElement function,
4350 NodeList arguments, 4381 NodeList arguments,
4351 CallStructure callStructure, 4382 CallStructure callStructure,
4352 A arg) { 4383 A arg) {
4353 apply(arguments, arg); 4384 apply(arguments, arg);
4354 return null; 4385 return null;
4355 } 4386 }
4356 4387
4357 @override 4388 @override
4389 R visitTopLevelFunctionIncompatibleInvoke(
4390 Send node,
4391 MethodElement function,
4392 NodeList arguments,
4393 CallStructure callStructure,
4394 A arg) {
4395 apply(arguments, arg);
4396 return null;
4397 }
4398
4399 @override
4358 R visitTopLevelGetterGet( 4400 R visitTopLevelGetterGet(
4359 Send node, 4401 Send node,
4360 FunctionElement getter, 4402 FunctionElement getter,
4361 A arg) { 4403 A arg) {
4362 return null; 4404 return null;
4363 } 4405 }
4364 4406
4365 @override 4407 @override
4366 R visitTopLevelGetterInvoke( 4408 R visitTopLevelGetterInvoke(
4367 Send node, 4409 Send node,
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
4558 Send node, 4600 Send node,
4559 Element element, 4601 Element element,
4560 AssignmentOperator operator, 4602 AssignmentOperator operator,
4561 Node rhs, 4603 Node rhs,
4562 A arg) { 4604 A arg) {
4563 apply(rhs, arg); 4605 apply(rhs, arg);
4564 return null; 4606 return null;
4565 } 4607 }
4566 4608
4567 @override 4609 @override
4568 R errorUnresolvedGet( 4610 R visitUnresolvedGet(
4569 Send node, 4611 Send node,
4570 Element element, 4612 Element element,
4571 A arg) { 4613 A arg) {
4572 return null; 4614 return null;
4573 } 4615 }
4574 4616
4575 @override 4617 @override
4576 R errorUnresolvedInvoke( 4618 R visitUnresolvedInvoke(
4577 Send node, 4619 Send node,
4578 Element element, 4620 Element element,
4579 NodeList arguments, 4621 NodeList arguments,
4580 Selector selector, 4622 Selector selector,
4581 A arg) { 4623 A arg) {
4582 apply(arguments, arg); 4624 apply(arguments, arg);
4583 return null; 4625 return null;
4584 } 4626 }
4585 4627
4586 @override 4628 @override
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
5370 MethodElement function, 5412 MethodElement function,
5371 A arg); 5413 A arg);
5372 5414
5373 R handleStaticFunctionInvoke( 5415 R handleStaticFunctionInvoke(
5374 Send node, 5416 Send node,
5375 MethodElement function, 5417 MethodElement function,
5376 NodeList arguments, 5418 NodeList arguments,
5377 CallStructure callStructure, 5419 CallStructure callStructure,
5378 A arg); 5420 A arg);
5379 5421
5422 R handleStaticFunctionIncompatibleInvoke(
5423 Send node,
5424 MethodElement function,
5425 NodeList arguments,
5426 CallStructure callStructure,
5427 A arg);
5428
5380 R handleStaticGetterGet( 5429 R handleStaticGetterGet(
5381 Send node, 5430 Send node,
5382 FunctionElement getter, 5431 FunctionElement getter,
5383 A arg); 5432 A arg);
5384 5433
5385 R handleStaticGetterInvoke( 5434 R handleStaticGetterInvoke(
5386 Send node, 5435 Send node,
5387 FunctionElement getter, 5436 FunctionElement getter,
5388 NodeList arguments, 5437 NodeList arguments,
5389 CallStructure callStructure, 5438 CallStructure callStructure,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
5497 Send node, 5546 Send node,
5498 MethodElement function, 5547 MethodElement function,
5499 NodeList arguments, 5548 NodeList arguments,
5500 CallStructure callStructure, 5549 CallStructure callStructure,
5501 A arg) { 5550 A arg) {
5502 return handleStaticFunctionInvoke( 5551 return handleStaticFunctionInvoke(
5503 node, function, arguments, callStructure, arg); 5552 node, function, arguments, callStructure, arg);
5504 } 5553 }
5505 5554
5506 @override 5555 @override
5556 R visitStaticFunctionIncompatibleInvoke(
5557 Send node,
5558 MethodElement function,
5559 NodeList arguments,
5560 CallStructure callStructure,
5561 A arg) {
5562 return handleStaticFunctionIncompatibleInvoke(
5563 node, function, arguments, callStructure, arg);
5564 }
5565
5566 @override
5507 R visitStaticGetterGet( 5567 R visitStaticGetterGet(
5508 Send node, 5568 Send node,
5509 FunctionElement getter, 5569 FunctionElement getter,
5510 A arg) { 5570 A arg) {
5511 return handleStaticGetterGet(node, getter, arg); 5571 return handleStaticGetterGet(node, getter, arg);
5512 } 5572 }
5513 5573
5514 @override 5574 @override
5515 R visitStaticGetterInvoke( 5575 R visitStaticGetterInvoke(
5516 Send node, 5576 Send node,
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
5669 Send node, 5729 Send node,
5670 MethodElement function, 5730 MethodElement function,
5671 NodeList arguments, 5731 NodeList arguments,
5672 CallStructure callStructure, 5732 CallStructure callStructure,
5673 A arg) { 5733 A arg) {
5674 return handleStaticFunctionInvoke( 5734 return handleStaticFunctionInvoke(
5675 node, function, arguments, callStructure, arg); 5735 node, function, arguments, callStructure, arg);
5676 } 5736 }
5677 5737
5678 @override 5738 @override
5739 R visitTopLevelFunctionIncompatibleInvoke(
5740 Send node,
5741 MethodElement function,
5742 NodeList arguments,
5743 CallStructure callStructure,
5744 A arg) {
5745 return handleStaticFunctionIncompatibleInvoke(
5746 node, function, arguments, callStructure, arg);
5747 }
5748
5749 @override
5679 R visitTopLevelGetterGet( 5750 R visitTopLevelGetterGet(
5680 Send node, 5751 Send node,
5681 FunctionElement getter, 5752 FunctionElement getter,
5682 A arg) { 5753 A arg) {
5683 return handleStaticGetterGet(node, getter, arg); 5754 return handleStaticGetterGet(node, getter, arg);
5684 } 5755 }
5685 5756
5686 @override 5757 @override
5687 R visitTopLevelGetterInvoke( 5758 R visitTopLevelGetterInvoke(
5688 Send node, 5759 Send node,
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
6519 InterfaceType type, 6590 InterfaceType type,
6520 ConstructorElement effectiveTarget, 6591 ConstructorElement effectiveTarget,
6521 InterfaceType effectiveTargetType, 6592 InterfaceType effectiveTargetType,
6522 NodeList arguments, 6593 NodeList arguments,
6523 CallStructure callStructure, 6594 CallStructure callStructure,
6524 A arg) { 6595 A arg) {
6525 return handleConstructorInvoke( 6596 return handleConstructorInvoke(
6526 node, constructor, type, arguments, callStructure, arg); 6597 node, constructor, type, arguments, callStructure, arg);
6527 } 6598 }
6528 } 6599 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/semantic_visitor.dart ('k') | pkg/compiler/lib/src/resolution/send_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698