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

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 | « runtime/vm/code_patcher_x64_test.cc ('k') | runtime/vm/flow_graph_inliner.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 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, false));
1725 #if defined(TAG_IC_DATA) 1726 #if defined(TAG_IC_DATA)
1726 ic_data.set_tag(Instruction::kInstanceCall); 1727 ic_data.set_tag(Instruction::kInstanceCall);
1727 #endif 1728 #endif
1728 if (deopt_id_to_ic_data_ != NULL) { 1729 if (deopt_id_to_ic_data_ != NULL) {
1729 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data; 1730 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data;
1730 } 1731 }
1732 ASSERT(!ic_data.is_static_call());
1731 return &ic_data; 1733 return &ic_data;
1732 } 1734 }
1733 1735
1734 1736
1735 const ICData* FlowGraphCompiler::GetOrAddStaticCallICData( 1737 const ICData* FlowGraphCompiler::GetOrAddStaticCallICData(
1736 intptr_t deopt_id, 1738 intptr_t deopt_id,
1737 const Function& target, 1739 const Function& target,
1738 const Array& arguments_descriptor, 1740 const Array& arguments_descriptor,
1739 intptr_t num_args_tested) { 1741 intptr_t num_args_tested) {
1740 if ((deopt_id_to_ic_data_ != NULL) && 1742 if ((deopt_id_to_ic_data_ != NULL) &&
1741 ((*deopt_id_to_ic_data_)[deopt_id] != NULL)) { 1743 ((*deopt_id_to_ic_data_)[deopt_id] != NULL)) {
1742 const ICData* res = (*deopt_id_to_ic_data_)[deopt_id]; 1744 const ICData* res = (*deopt_id_to_ic_data_)[deopt_id];
1743 ASSERT(res->deopt_id() == deopt_id); 1745 ASSERT(res->deopt_id() == deopt_id);
1744 ASSERT(res->target_name() == target.name()); 1746 ASSERT(res->target_name() == target.name());
1745 ASSERT(res->NumArgsTested() == num_args_tested); 1747 ASSERT(res->NumArgsTested() == num_args_tested);
1748 ASSERT(res->is_static_call());
1746 return res; 1749 return res;
1747 } 1750 }
1748 const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New( 1751 const ICData& ic_data = ICData::ZoneHandle(zone(), ICData::New(
1749 parsed_function().function(), String::Handle(zone(), target.name()), 1752 parsed_function().function(), String::Handle(zone(), target.name()),
1750 arguments_descriptor, deopt_id, num_args_tested)); 1753 arguments_descriptor, deopt_id, num_args_tested, true));
1751 ic_data.AddTarget(target); 1754 ic_data.AddTarget(target);
1752 #if defined(TAG_IC_DATA) 1755 #if defined(TAG_IC_DATA)
1753 ic_data.set_tag(Instruction::kStaticCall); 1756 ic_data.set_tag(Instruction::kStaticCall);
1754 #endif 1757 #endif
1755 if (deopt_id_to_ic_data_ != NULL) { 1758 if (deopt_id_to_ic_data_ != NULL) {
1756 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data; 1759 (*deopt_id_to_ic_data_)[deopt_id] = &ic_data;
1757 } 1760 }
1758 return &ic_data; 1761 return &ic_data;
1759 } 1762 }
1760 1763
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1982 1985
1983 1986
1984 void FlowGraphCompiler::FrameStateClear() { 1987 void FlowGraphCompiler::FrameStateClear() {
1985 ASSERT(!is_optimizing()); 1988 ASSERT(!is_optimizing());
1986 frame_state_.TruncateTo(0); 1989 frame_state_.TruncateTo(0);
1987 } 1990 }
1988 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) 1991 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC)
1989 1992
1990 1993
1991 } // namespace dart 1994 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_patcher_x64_test.cc ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698