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

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

Issue 10948007: Revert "Deoptimization support in inlined code." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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/intrinsifier.h » ('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) 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 #include "vm/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_allocator.h" 9 #include "vm/flow_graph_allocator.h"
10 #include "vm/flow_graph_builder.h" 10 #include "vm/flow_graph_builder.h"
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1649 // TODO(fschneider): Avoid special-casing for SSA mode here. 1649 // TODO(fschneider): Avoid special-casing for SSA mode here.
1650 if (compiler->is_optimizing()) { 1650 if (compiler->is_optimizing()) {
1651 ASSERT(locs()->in(0).IsRegister()); 1651 ASSERT(locs()->in(0).IsRegister());
1652 __ PushRegister(locs()->in(0).reg()); 1652 __ PushRegister(locs()->in(0).reg());
1653 } 1653 }
1654 } 1654 }
1655 1655
1656 1656
1657 Environment* Environment::From(const GrowableArray<Definition*>& definitions, 1657 Environment* Environment::From(const GrowableArray<Definition*>& definitions,
1658 intptr_t fixed_parameter_count, 1658 intptr_t fixed_parameter_count,
1659 const Function& function) { 1659 const Environment* outer) {
1660 Environment* env = 1660 Environment* env =
1661 new Environment(definitions.length(), 1661 new Environment(definitions.length(),
1662 fixed_parameter_count, 1662 fixed_parameter_count,
1663 Isolate::kNoDeoptId, 1663 Isolate::kNoDeoptId,
1664 function, 1664 (outer == NULL) ? NULL : outer->DeepCopy());
1665 NULL);
1666 for (intptr_t i = 0; i < definitions.length(); ++i) { 1665 for (intptr_t i = 0; i < definitions.length(); ++i) {
1667 env->values_.Add(new Value(definitions[i])); 1666 env->values_.Add(new Value(definitions[i]));
1668 } 1667 }
1669 return env; 1668 return env;
1670 } 1669 }
1671 1670
1672 1671
1673 Environment* Environment::DeepCopy() const { 1672 Environment* Environment::DeepCopy() const {
1674 Environment* copy = 1673 Environment* copy =
1675 new Environment(values_.length(), 1674 new Environment(values_.length(),
1676 fixed_parameter_count_, 1675 fixed_parameter_count_,
1677 deopt_id_, 1676 deopt_id_,
1678 function_,
1679 (outer_ == NULL) ? NULL : outer_->DeepCopy()); 1677 (outer_ == NULL) ? NULL : outer_->DeepCopy());
1680 for (intptr_t i = 0; i < values_.length(); ++i) { 1678 for (intptr_t i = 0; i < values_.length(); ++i) {
1681 copy->values_.Add(values_[i]->Copy()); 1679 copy->values_.Add(values_[i]->Copy());
1682 } 1680 }
1683 return copy; 1681 return copy;
1684 } 1682 }
1685 1683
1686 1684
1687 // Copies the environment and updates the environment use lists. 1685 // Copies the environment and updates the environment use lists.
1688 void Environment::DeepCopyTo(Instruction* instr) const { 1686 void Environment::DeepCopyTo(Instruction* instr) const {
1689 Environment* copy = DeepCopy(); 1687 Environment* copy = DeepCopy();
1690 intptr_t use_index = 0; 1688 intptr_t use_index = 0;
1691 for (Environment::DeepIterator it(copy); !it.Done(); it.Advance()) { 1689 for (Environment::DeepIterator it(copy); !it.Done(); it.Advance()) {
1692 Value* value = it.CurrentValue(); 1690 Value* value = it.CurrentValue();
1693 value->set_instruction(instr); 1691 value->set_instruction(instr);
1694 value->set_use_index(use_index++); 1692 value->set_use_index(use_index++);
1695 value->AddToEnvUseList(); 1693 value->AddToEnvUseList();
1696 } 1694 }
1697 instr->set_env(copy); 1695 instr->set_env(copy);
1698 } 1696 }
1699 1697
1700 1698
1701 // Copies the environment as outer on an inlined instruction and updates the
1702 // environment use lists.
1703 void Environment::DeepCopyToOuter(Instruction* instr) const {
1704 ASSERT(instr->env()->outer() == NULL);
1705 Environment* copy = DeepCopy();
1706 intptr_t use_index = instr->env()->Length(); // Start index after inner.
1707 for (Environment::DeepIterator it(copy); !it.Done(); it.Advance()) {
1708 Value* value = it.CurrentValue();
1709 value->set_instruction(instr);
1710 value->set_use_index(use_index++);
1711 value->AddToEnvUseList();
1712 }
1713 instr->env()->outer_ = copy;
1714 }
1715
1716
1717 #undef __ 1699 #undef __
1718 1700
1719 } // namespace dart 1701 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.h ('k') | runtime/vm/intrinsifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698