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

Side by Side Diff: runtime/vm/intermediate_language_arm.cc

Issue 14106013: Further improve type optimization reusing the type argument vector of the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after
1451 } 1451 }
1452 1452
1453 1453
1454 void InstantiateTypeArgumentsInstr::EmitNativeCode( 1454 void InstantiateTypeArgumentsInstr::EmitNativeCode(
1455 FlowGraphCompiler* compiler) { 1455 FlowGraphCompiler* compiler) {
1456 Register instantiator_reg = locs()->in(0).reg(); 1456 Register instantiator_reg = locs()->in(0).reg();
1457 Register result_reg = locs()->out().reg(); 1457 Register result_reg = locs()->out().reg();
1458 1458
1459 // 'instantiator_reg' is the instantiator AbstractTypeArguments object 1459 // 'instantiator_reg' is the instantiator AbstractTypeArguments object
1460 // (or null). 1460 // (or null).
1461 if (!type_arguments().IsUninstantiatedIdentity()) { 1461 if (!type_arguments().IsUninstantiatedIdentity() &&
1462 !type_arguments().CanShareInstantiatorTypeArguments(
1463 instantiator_class())) {
1462 // If the instantiator is null and if the type argument vector 1464 // If the instantiator is null and if the type argument vector
1463 // instantiated from null becomes a vector of dynamic, then use null as 1465 // instantiated from null becomes a vector of dynamic, then use null as
1464 // the type arguments. 1466 // the type arguments.
1465 Label type_arguments_instantiated; 1467 Label type_arguments_instantiated;
1466 const intptr_t len = type_arguments().Length(); 1468 const intptr_t len = type_arguments().Length();
1467 if (type_arguments().IsRawInstantiatedRaw(len)) { 1469 if (type_arguments().IsRawInstantiatedRaw(len)) {
1468 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null())); 1470 __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
1469 __ cmp(instantiator_reg, ShifterOperand(IP)); 1471 __ cmp(instantiator_reg, ShifterOperand(IP));
1470 __ b(&type_arguments_instantiated, EQ); 1472 __ b(&type_arguments_instantiated, EQ);
1471 } 1473 }
(...skipping 28 matching lines...) Expand all
1500 1502
1501 1503
1502 void ExtractConstructorTypeArgumentsInstr::EmitNativeCode( 1504 void ExtractConstructorTypeArgumentsInstr::EmitNativeCode(
1503 FlowGraphCompiler* compiler) { 1505 FlowGraphCompiler* compiler) {
1504 Register instantiator_reg = locs()->in(0).reg(); 1506 Register instantiator_reg = locs()->in(0).reg();
1505 Register result_reg = locs()->out().reg(); 1507 Register result_reg = locs()->out().reg();
1506 ASSERT(instantiator_reg == result_reg); 1508 ASSERT(instantiator_reg == result_reg);
1507 1509
1508 // instantiator_reg is the instantiator type argument vector, i.e. an 1510 // instantiator_reg is the instantiator type argument vector, i.e. an
1509 // AbstractTypeArguments object (or null). 1511 // AbstractTypeArguments object (or null).
1510 if (!type_arguments().IsUninstantiatedIdentity()) { 1512 if (!type_arguments().IsUninstantiatedIdentity() &&
1513 !type_arguments().CanShareInstantiatorTypeArguments(
1514 instantiator_class())) {
1511 // If the instantiator is null and if the type argument vector 1515 // If the instantiator is null and if the type argument vector
1512 // instantiated from null becomes a vector of dynamic, then use null as 1516 // instantiated from null becomes a vector of dynamic, then use null as
1513 // the type arguments. 1517 // the type arguments.
1514 Label type_arguments_instantiated; 1518 Label type_arguments_instantiated;
1515 const intptr_t len = type_arguments().Length(); 1519 const intptr_t len = type_arguments().Length();
1516 if (type_arguments().IsRawInstantiatedRaw(len)) { 1520 if (type_arguments().IsRawInstantiatedRaw(len)) {
1517 __ CompareImmediate(instantiator_reg, 1521 __ CompareImmediate(instantiator_reg,
1518 reinterpret_cast<intptr_t>(Object::null())); 1522 reinterpret_cast<intptr_t>(Object::null()));
1519 __ b(&type_arguments_instantiated, EQ); 1523 __ b(&type_arguments_instantiated, EQ);
1520 } 1524 }
(...skipping 21 matching lines...) Expand all
1542 } 1546 }
1543 1547
1544 1548
1545 void ExtractConstructorInstantiatorInstr::EmitNativeCode( 1549 void ExtractConstructorInstantiatorInstr::EmitNativeCode(
1546 FlowGraphCompiler* compiler) { 1550 FlowGraphCompiler* compiler) {
1547 Register instantiator_reg = locs()->in(0).reg(); 1551 Register instantiator_reg = locs()->in(0).reg();
1548 ASSERT(locs()->out().reg() == instantiator_reg); 1552 ASSERT(locs()->out().reg() == instantiator_reg);
1549 1553
1550 // instantiator_reg is the instantiator AbstractTypeArguments object 1554 // instantiator_reg is the instantiator AbstractTypeArguments object
1551 // (or null). 1555 // (or null).
1552 if (type_arguments().IsUninstantiatedIdentity()) { 1556 if (type_arguments().IsUninstantiatedIdentity() ||
1557 type_arguments().CanShareInstantiatorTypeArguments(
1558 instantiator_class())) {
1553 // The instantiator was used in VisitExtractConstructorTypeArguments as the 1559 // The instantiator was used in VisitExtractConstructorTypeArguments as the
1554 // instantiated type arguments, no proper instantiator needed. 1560 // instantiated type arguments, no proper instantiator needed.
1555 __ LoadImmediate(instantiator_reg, 1561 __ LoadImmediate(instantiator_reg,
1556 Smi::RawValue(StubCode::kNoInstantiator)); 1562 Smi::RawValue(StubCode::kNoInstantiator));
1557 } else { 1563 } else {
1558 // If the instantiator is null and if the type argument vector 1564 // If the instantiator is null and if the type argument vector
1559 // instantiated from null becomes a vector of dynamic, then use null as 1565 // instantiated from null becomes a vector of dynamic, then use null as
1560 // the type arguments and do not pass the instantiator. 1566 // the type arguments and do not pass the instantiator.
1561 const intptr_t len = type_arguments().Length(); 1567 const intptr_t len = type_arguments().Length();
1562 if (type_arguments().IsRawInstantiatedRaw(len)) { 1568 if (type_arguments().IsRawInstantiatedRaw(len)) {
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
2613 &label, 2619 &label,
2614 PcDescriptors::kOther, 2620 PcDescriptors::kOther,
2615 locs()); 2621 locs());
2616 __ Drop(2); // Discard type arguments and receiver. 2622 __ Drop(2); // Discard type arguments and receiver.
2617 } 2623 }
2618 2624
2619 } // namespace dart 2625 } // namespace dart
2620 2626
2621 #endif // defined TARGET_ARCH_ARM 2627 #endif // defined TARGET_ARCH_ARM
2622 2628
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698