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

Side by Side Diff: runtime/vm/intermediate_language_mips.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_ia32.cc ('k') | runtime/vm/intermediate_language_x64.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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 1467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1478 1478
1479 1479
1480 void InstantiateTypeArgumentsInstr::EmitNativeCode( 1480 void InstantiateTypeArgumentsInstr::EmitNativeCode(
1481 FlowGraphCompiler* compiler) { 1481 FlowGraphCompiler* compiler) {
1482 __ TraceSimMsg("InstantiateTypeArgumentsInstr"); 1482 __ TraceSimMsg("InstantiateTypeArgumentsInstr");
1483 Register instantiator_reg = locs()->in(0).reg(); 1483 Register instantiator_reg = locs()->in(0).reg();
1484 Register result_reg = locs()->out().reg(); 1484 Register result_reg = locs()->out().reg();
1485 1485
1486 // 'instantiator_reg' is the instantiator AbstractTypeArguments object 1486 // 'instantiator_reg' is the instantiator AbstractTypeArguments object
1487 // (or null). 1487 // (or null).
1488 if (!type_arguments().IsUninstantiatedIdentity()) { 1488 if (!type_arguments().IsUninstantiatedIdentity() &&
1489 !type_arguments().CanShareInstantiatorTypeArguments(
1490 instantiator_class())) {
1489 // If the instantiator is null and if the type argument vector 1491 // If the instantiator is null and if the type argument vector
1490 // instantiated from null becomes a vector of dynamic, then use null as 1492 // instantiated from null becomes a vector of dynamic, then use null as
1491 // the type arguments. 1493 // the type arguments.
1492 Label type_arguments_instantiated; 1494 Label type_arguments_instantiated;
1493 const intptr_t len = type_arguments().Length(); 1495 const intptr_t len = type_arguments().Length();
1494 if (type_arguments().IsRawInstantiatedRaw(len)) { 1496 if (type_arguments().IsRawInstantiatedRaw(len)) {
1495 __ BranchEqual(instantiator_reg, 1497 __ BranchEqual(instantiator_reg,
1496 reinterpret_cast<intptr_t>(Object::null()), 1498 reinterpret_cast<intptr_t>(Object::null()),
1497 &type_arguments_instantiated); 1499 &type_arguments_instantiated);
1498 } 1500 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 1536
1535 1537
1536 void ExtractConstructorTypeArgumentsInstr::EmitNativeCode( 1538 void ExtractConstructorTypeArgumentsInstr::EmitNativeCode(
1537 FlowGraphCompiler* compiler) { 1539 FlowGraphCompiler* compiler) {
1538 Register instantiator_reg = locs()->in(0).reg(); 1540 Register instantiator_reg = locs()->in(0).reg();
1539 Register result_reg = locs()->out().reg(); 1541 Register result_reg = locs()->out().reg();
1540 ASSERT(instantiator_reg == result_reg); 1542 ASSERT(instantiator_reg == result_reg);
1541 1543
1542 // instantiator_reg is the instantiator type argument vector, i.e. an 1544 // instantiator_reg is the instantiator type argument vector, i.e. an
1543 // AbstractTypeArguments object (or null). 1545 // AbstractTypeArguments object (or null).
1544 if (!type_arguments().IsUninstantiatedIdentity()) { 1546 if (!type_arguments().IsUninstantiatedIdentity() &&
1547 !type_arguments().CanShareInstantiatorTypeArguments(
1548 instantiator_class())) {
1545 // If the instantiator is null and if the type argument vector 1549 // If the instantiator is null and if the type argument vector
1546 // instantiated from null becomes a vector of dynamic, then use null as 1550 // instantiated from null becomes a vector of dynamic, then use null as
1547 // the type arguments. 1551 // the type arguments.
1548 Label type_arguments_instantiated; 1552 Label type_arguments_instantiated;
1549 const intptr_t len = type_arguments().Length(); 1553 const intptr_t len = type_arguments().Length();
1550 if (type_arguments().IsRawInstantiatedRaw(len)) { 1554 if (type_arguments().IsRawInstantiatedRaw(len)) {
1551 __ BranchEqual(instantiator_reg, 1555 __ BranchEqual(instantiator_reg,
1552 reinterpret_cast<intptr_t>(Object::null()), 1556 reinterpret_cast<intptr_t>(Object::null()),
1553 &type_arguments_instantiated); 1557 &type_arguments_instantiated);
1554 } 1558 }
(...skipping 21 matching lines...) Expand all
1576 } 1580 }
1577 1581
1578 1582
1579 void ExtractConstructorInstantiatorInstr::EmitNativeCode( 1583 void ExtractConstructorInstantiatorInstr::EmitNativeCode(
1580 FlowGraphCompiler* compiler) { 1584 FlowGraphCompiler* compiler) {
1581 Register instantiator_reg = locs()->in(0).reg(); 1585 Register instantiator_reg = locs()->in(0).reg();
1582 ASSERT(locs()->out().reg() == instantiator_reg); 1586 ASSERT(locs()->out().reg() == instantiator_reg);
1583 1587
1584 // instantiator_reg is the instantiator AbstractTypeArguments object 1588 // instantiator_reg is the instantiator AbstractTypeArguments object
1585 // (or null). 1589 // (or null).
1586 if (type_arguments().IsUninstantiatedIdentity()) { 1590 if (type_arguments().IsUninstantiatedIdentity() ||
1591 type_arguments().CanShareInstantiatorTypeArguments(
1592 instantiator_class())) {
1587 // The instantiator was used in VisitExtractConstructorTypeArguments as the 1593 // The instantiator was used in VisitExtractConstructorTypeArguments as the
1588 // instantiated type arguments, no proper instantiator needed. 1594 // instantiated type arguments, no proper instantiator needed.
1589 __ LoadImmediate(instantiator_reg, 1595 __ LoadImmediate(instantiator_reg,
1590 Smi::RawValue(StubCode::kNoInstantiator)); 1596 Smi::RawValue(StubCode::kNoInstantiator));
1591 } else { 1597 } else {
1592 // If the instantiator is null and if the type argument vector 1598 // If the instantiator is null and if the type argument vector
1593 // instantiated from null becomes a vector of dynamic, then use null as 1599 // instantiated from null becomes a vector of dynamic, then use null as
1594 // the type arguments and do not pass the instantiator. 1600 // the type arguments and do not pass the instantiator.
1595 const intptr_t len = type_arguments().Length(); 1601 const intptr_t len = type_arguments().Length();
1596 if (type_arguments().IsRawInstantiatedRaw(len)) { 1602 if (type_arguments().IsRawInstantiatedRaw(len)) {
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
2725 &label, 2731 &label,
2726 PcDescriptors::kOther, 2732 PcDescriptors::kOther,
2727 locs()); 2733 locs());
2728 __ Drop(2); // Discard type arguments and receiver. 2734 __ Drop(2); // Discard type arguments and receiver.
2729 } 2735 }
2730 2736
2731 } // namespace dart 2737 } // namespace dart
2732 2738
2733 #endif // defined TARGET_ARCH_MIPS 2739 #endif // defined TARGET_ARCH_MIPS
2734 2740
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language_ia32.cc ('k') | runtime/vm/intermediate_language_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698