OLD | NEW |
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 1897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1908 assembler()->Bind(&ok); | 1908 assembler()->Bind(&ok); |
1909 } else { | 1909 } else { |
1910 if (complete) { | 1910 if (complete) { |
1911 Label ok; | 1911 Label ok; |
1912 EmitTestAndCall(ic_data, argument_count, argument_names, | 1912 EmitTestAndCall(ic_data, argument_count, argument_names, |
1913 NULL, // No cid match. | 1913 NULL, // No cid match. |
1914 &ok, // Found cid. | 1914 &ok, // Found cid. |
1915 deopt_id, token_pos, locs, true); | 1915 deopt_id, token_pos, locs, true); |
1916 assembler()->Bind(&ok); | 1916 assembler()->Bind(&ok); |
1917 } else { | 1917 } else { |
1918 // Instead of deoptimizing, do a megamorphic call when no matching | 1918 EmitSwitchableInstanceCall(ic_data, argument_count, |
1919 // cid found. | 1919 deopt_id, token_pos, locs); |
1920 Label ok; | |
1921 MegamorphicSlowPath* slow_path = | |
1922 new MegamorphicSlowPath(ic_data, argument_count, deopt_id, | |
1923 token_pos, locs, CurrentTryIndex()); | |
1924 AddSlowPathCode(slow_path); | |
1925 EmitTestAndCall(ic_data, argument_count, argument_names, | |
1926 slow_path->entry_label(), // No cid match. | |
1927 &ok, // Found cid. | |
1928 deopt_id, token_pos, locs, false); | |
1929 | |
1930 assembler()->Bind(slow_path->exit_label()); | |
1931 assembler()->Bind(&ok); | |
1932 } | 1920 } |
1933 } | 1921 } |
1934 } | 1922 } |
1935 #endif | 1923 #endif |
1936 | 1924 |
1937 #if defined(DEBUG) && !defined(TARGET_ARCH_DBC) | 1925 #if defined(DEBUG) && !defined(TARGET_ARCH_DBC) |
1938 // TODO(vegorov) re-enable frame state tracking on DBC. It is | 1926 // TODO(vegorov) re-enable frame state tracking on DBC. It is |
1939 // currently disabled because it relies on LocationSummaries and | 1927 // currently disabled because it relies on LocationSummaries and |
1940 // we don't use them during unoptimized compilation on DBC. | 1928 // we don't use them during unoptimized compilation on DBC. |
1941 void FlowGraphCompiler::FrameStateUpdateWith(Instruction* instr) { | 1929 void FlowGraphCompiler::FrameStateUpdateWith(Instruction* instr) { |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2004 | 1992 |
2005 | 1993 |
2006 void FlowGraphCompiler::FrameStateClear() { | 1994 void FlowGraphCompiler::FrameStateClear() { |
2007 ASSERT(!is_optimizing()); | 1995 ASSERT(!is_optimizing()); |
2008 frame_state_.TruncateTo(0); | 1996 frame_state_.TruncateTo(0); |
2009 } | 1997 } |
2010 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) | 1998 #endif // defined(DEBUG) && !defined(TARGET_ARCH_DBC) |
2011 | 1999 |
2012 | 2000 |
2013 } // namespace dart | 2001 } // namespace dart |
OLD | NEW |