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

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

Issue 2044423003: 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') | runtime/vm/object.cc » ('J')
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 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 intptr_t deopt_id, 1710 intptr_t deopt_id,
1711 const String& target_name, 1711 const String& target_name,
1712 const Array& arguments_descriptor, 1712 const Array& arguments_descriptor,
1713 intptr_t num_args_tested) { 1713 intptr_t num_args_tested) {
1714 if ((deopt_id_to_ic_data_ != NULL) && 1714 if ((deopt_id_to_ic_data_ != NULL) &&
1715 ((*deopt_id_to_ic_data_)[deopt_id] != NULL)) { 1715 ((*deopt_id_to_ic_data_)[deopt_id] != NULL)) {
1716 const ICData* res = (*deopt_id_to_ic_data_)[deopt_id]; 1716 const ICData* res = (*deopt_id_to_ic_data_)[deopt_id];
1717 ASSERT(res->deopt_id() == deopt_id); 1717 ASSERT(res->deopt_id() == deopt_id);
1718 ASSERT(res->target_name() == target_name.raw()); 1718 ASSERT(res->target_name() == target_name.raw());
1719 ASSERT(res->NumArgsTested() == num_args_tested); 1719 ASSERT(res->NumArgsTested() == num_args_tested);
1720 ASSERT(!res->is_static_call());
1720 return res; 1721 return res;
1721 } 1722 }
1722 const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New( 1723 const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New(
1723 parsed_function().function(), target_name, 1724 parsed_function().function(), target_name,
1724 arguments_descriptor, deopt_id, num_args_tested)); 1725 arguments_descriptor, deopt_id, num_args_tested));
1726 ic_data.SetIsStaticCall(false);
1725 #if defined(TAG_IC_DATA) 1727 #if defined(TAG_IC_DATA)
1726 ic_data.set_tag(Instruction::kInstanceCall); 1728 ic_data.set_tag(Instruction::kInstanceCall);
1727 #endif 1729 #endif
1728 if (deopt_id_to_ic_data_ != NULL) { 1730 if (deopt_id_to_ic_data_ != NULL) {
1729 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data; 1731 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data;
1730 } 1732 }
1733 ASSERT(!ic_data.is_static_call());
1731 return &ic_data; 1734 return &ic_data;
1732 } 1735 }
1733 1736
1734 1737
1735 const ICData* FlowGraphCompiler::GetOrAddStaticCallICData( 1738 const ICData* FlowGraphCompiler::GetOrAddStaticCallICData(
1736 intptr_t deopt_id, 1739 intptr_t deopt_id,
1737 const Function& target, 1740 const Function& target,
1738 const Array& arguments_descriptor, 1741 const Array& arguments_descriptor,
1739 intptr_t num_args_tested) { 1742 intptr_t num_args_tested) {
1740 if ((deopt_id_to_ic_data_ != NULL) && 1743 if ((deopt_id_to_ic_data_ != NULL) &&
1741 ((*deopt_id_to_ic_data_)[deopt_id] != NULL)) { 1744 ((*deopt_id_to_ic_data_)[deopt_id] != NULL)) {
1742 const ICData* res = (*deopt_id_to_ic_data_)[deopt_id]; 1745 const ICData* res = (*deopt_id_to_ic_data_)[deopt_id];
1743 ASSERT(res->deopt_id() == deopt_id); 1746 ASSERT(res->deopt_id() == deopt_id);
1744 ASSERT(res->target_name() == target.name()); 1747 ASSERT(res->target_name() == target.name());
1745 ASSERT(res->NumArgsTested() == num_args_tested); 1748 ASSERT(res->NumArgsTested() == num_args_tested);
1749 ASSERT(res->is_static_call());
1746 return res; 1750 return res;
1747 } 1751 }
1748 const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New( 1752 const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New(
1749 parsed_function().function(), String::Handle(zone(), target.name()), 1753 parsed_function().function(), String::Handle(zone(), target.name()),
1750 arguments_descriptor, deopt_id, num_args_tested)); 1754 arguments_descriptor, deopt_id, num_args_tested));
1751 ic_data.AddTarget(target); 1755 ic_data.AddTarget(target);
1756 ic_data.SetIsStaticCall(true);
1752 #if defined(TAG_IC_DATA) 1757 #if defined(TAG_IC_DATA)
1753 ic_data.set_tag(Instruction::kStaticCall); 1758 ic_data.set_tag(Instruction::kStaticCall);
1754 #endif 1759 #endif
1755 if (deopt_id_to_ic_data_ != NULL) { 1760 if (deopt_id_to_ic_data_ != NULL) {
1756 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data; 1761 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data;
1757 } 1762 }
1763 ASSERT(ic_data.is_static_call());
1758 return &ic_data; 1764 return &ic_data;
1759 } 1765 }
1760 1766
1761 1767
1762 intptr_t FlowGraphCompiler::GetOptimizationThreshold() const { 1768 intptr_t FlowGraphCompiler::GetOptimizationThreshold() const {
1763 intptr_t threshold; 1769 intptr_t threshold;
1764 if (is_optimizing()) { 1770 if (is_optimizing()) {
1765 threshold = FLAG_reoptimization_counter_threshold; 1771 threshold = FLAG_reoptimization_counter_threshold;
1766 } else if (parsed_function_.function().IsIrregexpFunction()) { 1772 } else if (parsed_function_.function().IsIrregexpFunction()) {
1767 threshold = FLAG_regexp_optimization_counter_threshold; 1773 threshold = FLAG_regexp_optimization_counter_threshold;
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1982 1988
1983 1989
1984 void FlowGraphCompiler::FrameStateClear() { 1990 void FlowGraphCompiler::FrameStateClear() {
1985 ASSERT(!is_optimizing()); 1991 ASSERT(!is_optimizing());
1986 frame_state_.TruncateTo(0); 1992 frame_state_.TruncateTo(0);
1987 } 1993 }
1988 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) 1994 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC)
1989 1995
1990 1996
1991 } // namespace dart 1997 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/isolate_reload.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698