Index: runtime/vm/flow_graph_compiler_arm.cc |
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc |
index a11916db9e64fb4dc09567874900d56c39d8a174..8bc755224ea5ba6092c24795fc6b6f97245f38a3 100644 |
--- a/runtime/vm/flow_graph_compiler_arm.cc |
+++ b/runtime/vm/flow_graph_compiler_arm.cc |
@@ -31,6 +31,18 @@ DECLARE_FLAG(bool, enable_simd_inline); |
DECLARE_FLAG(bool, use_megamorphic_stub); |
+void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) { |
+ Assembler* assem = compiler->assembler(); |
Florian Schneider
2015/12/14 16:07:03
s/assem/assembler/
srdjan
2015/12/15 17:52:03
Done here and below (old code).
|
+#define __ assem-> |
+ __ Bind(entry_label()); |
+ __ Comment("MegamorphicSlowPath"); |
+ compiler->EmitMegamorphicInstanceCall(ic_data_, argument_count_, deopt_id_, |
+ token_pos_, locs_, try_index_); |
+ __ b(exit_label()); |
+#undef __ |
+} |
+ |
+ |
FlowGraphCompiler::~FlowGraphCompiler() { |
// BlockInfos are zone-allocated, so their destructors are not called. |
// Verify the labels explicitly here. |
@@ -1258,7 +1270,8 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall( |
intptr_t argument_count, |
intptr_t deopt_id, |
intptr_t token_pos, |
- LocationSummary* locs) { |
+ LocationSummary* locs, |
+ intptr_t try_index) { |
const String& name = String::Handle(zone(), ic_data.target_name()); |
const Array& arguments_descriptor = |
Array::ZoneHandle(zone(), ic_data.arguments_descriptor()); |
@@ -1279,7 +1292,18 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall( |
AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos); |
Florian Schneider
2015/12/14 16:07:03
Move this into the else-branches below, so that we
srdjan
2015/12/15 17:52:03
Done.
|
RecordSafepoint(locs); |
const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
- if (is_optimizing()) { |
+ if (Compiler::always_optimize()) { |
+ // Megamorphic calls may occur in slow path stubs. |
+ // If valid use try_index argument. |
+ if (try_index == CatchClauseNode::kInvalidTryIndex) { |
+ try_index = CurrentTryIndex(); |
+ } |
+ pc_descriptors_list()->AddDescriptor(RawPcDescriptors::kOther, |
+ assembler()->CodeSize(), |
+ Thread::kNoDeoptId, |
+ token_pos, |
+ try_index); |
+ } else if (is_optimizing()) { |
AddDeoptIndexAtCall(deopt_id_after, token_pos); |
} else { |
// Add deoptimization continuation point after the call and before the |