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

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

Issue 2062983002: Revert "Remember inside an ICData if it is for a static call or an instance call" (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | runtime/vm/isolate_reload.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_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/cha.h" 10 #include "vm/cha.h"
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1729 intptr_t deopt_id, 1729 intptr_t deopt_id,
1730 const String& target_name, 1730 const String& target_name,
1731 const Array& arguments_descriptor, 1731 const Array& arguments_descriptor,
1732 intptr_t num_args_tested) { 1732 intptr_t num_args_tested) {
1733 if ((deopt_id_to_ic_data_ != NULL) && 1733 if ((deopt_id_to_ic_data_ != NULL) &&
1734 ((*deopt_id_to_ic_data_)[deopt_id] != NULL)) { 1734 ((*deopt_id_to_ic_data_)[deopt_id] != NULL)) {
1735 const ICData* res = (*deopt_id_to_ic_data_)[deopt_id]; 1735 const ICData* res = (*deopt_id_to_ic_data_)[deopt_id];
1736 ASSERT(res->deopt_id() == deopt_id); 1736 ASSERT(res->deopt_id() == deopt_id);
1737 ASSERT(res->target_name() == target_name.raw()); 1737 ASSERT(res->target_name() == target_name.raw());
1738 ASSERT(res->NumArgsTested() == num_args_tested); 1738 ASSERT(res->NumArgsTested() == num_args_tested);
1739 ASSERT(!res->is_static_call());
1740 return res; 1739 return res;
1741 } 1740 }
1742 const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New( 1741 const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New(
1743 parsed_function().function(), target_name, 1742 parsed_function().function(), target_name,
1744 arguments_descriptor, deopt_id, num_args_tested)); 1743 arguments_descriptor, deopt_id, num_args_tested));
1745 ic_data.SetIsStaticCall(false);
1746 #if defined(TAG_IC_DATA) 1744 #if defined(TAG_IC_DATA)
1747 ic_data.set_tag(Instruction::kInstanceCall); 1745 ic_data.set_tag(Instruction::kInstanceCall);
1748 #endif 1746 #endif
1749 if (deopt_id_to_ic_data_ != NULL) { 1747 if (deopt_id_to_ic_data_ != NULL) {
1750 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data; 1748 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data;
1751 } 1749 }
1752 ASSERT(!ic_data.is_static_call());
1753 return &ic_data; 1750 return &ic_data;
1754 } 1751 }
1755 1752
1756 1753
1757 const ICData* FlowGraphCompiler::GetOrAddStaticCallICData( 1754 const ICData* FlowGraphCompiler::GetOrAddStaticCallICData(
1758 intptr_t deopt_id, 1755 intptr_t deopt_id,
1759 const Function& target, 1756 const Function& target,
1760 const Array& arguments_descriptor, 1757 const Array& arguments_descriptor,
1761 intptr_t num_args_tested) { 1758 intptr_t num_args_tested) {
1762 if ((deopt_id_to_ic_data_ != NULL) && 1759 if ((deopt_id_to_ic_data_ != NULL) &&
1763 ((*deopt_id_to_ic_data_)[deopt_id] != NULL)) { 1760 ((*deopt_id_to_ic_data_)[deopt_id] != NULL)) {
1764 const ICData* res = (*deopt_id_to_ic_data_)[deopt_id]; 1761 const ICData* res = (*deopt_id_to_ic_data_)[deopt_id];
1765 ASSERT(res->deopt_id() == deopt_id); 1762 ASSERT(res->deopt_id() == deopt_id);
1766 ASSERT(res->target_name() == target.name()); 1763 ASSERT(res->target_name() == target.name());
1767 ASSERT(res->NumArgsTested() == num_args_tested); 1764 ASSERT(res->NumArgsTested() == num_args_tested);
1768 ASSERT(res->is_static_call());
1769 return res; 1765 return res;
1770 } 1766 }
1771 const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New( 1767 const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New(
1772 parsed_function().function(), String::Handle(zone(), target.name()), 1768 parsed_function().function(), String::Handle(zone(), target.name()),
1773 arguments_descriptor, deopt_id, num_args_tested)); 1769 arguments_descriptor, deopt_id, num_args_tested));
1774 ic_data.AddTarget(target); 1770 ic_data.AddTarget(target);
1775 ic_data.SetIsStaticCall(true);
1776 #if defined(TAG_IC_DATA) 1771 #if defined(TAG_IC_DATA)
1777 ic_data.set_tag(Instruction::kStaticCall); 1772 ic_data.set_tag(Instruction::kStaticCall);
1778 #endif 1773 #endif
1779 if (deopt_id_to_ic_data_ != NULL) { 1774 if (deopt_id_to_ic_data_ != NULL) {
1780 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data; 1775 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data;
1781 } 1776 }
1782 ASSERT(ic_data.is_static_call());
1783 return &ic_data; 1777 return &ic_data;
1784 } 1778 }
1785 1779
1786 1780
1787 intptr_t FlowGraphCompiler::GetOptimizationThreshold() const { 1781 intptr_t FlowGraphCompiler::GetOptimizationThreshold() const {
1788 intptr_t threshold; 1782 intptr_t threshold;
1789 if (is_optimizing()) { 1783 if (is_optimizing()) {
1790 threshold = FLAG_reoptimization_counter_threshold; 1784 threshold = FLAG_reoptimization_counter_threshold;
1791 } else if (parsed_function_.function().IsIrregexpFunction()) { 1785 } else if (parsed_function_.function().IsIrregexpFunction()) {
1792 threshold = FLAG_regexp_optimization_counter_threshold; 1786 threshold = FLAG_regexp_optimization_counter_threshold;
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
2007 2001
2008 2002
2009 void FlowGraphCompiler::FrameStateClear() { 2003 void FlowGraphCompiler::FrameStateClear() {
2010 ASSERT(!is_optimizing()); 2004 ASSERT(!is_optimizing());
2011 frame_state_.TruncateTo(0); 2005 frame_state_.TruncateTo(0);
2012 } 2006 }
2013 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) 2007 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC)
2014 2008
2015 2009
2016 } // namespace dart 2010 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/isolate_reload.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698