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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
7 | 7 |
8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
9 | 9 |
10 #include "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 __ int3(); | 1077 __ int3(); |
1078 GenerateDeferredCode(); | 1078 GenerateDeferredCode(); |
1079 } | 1079 } |
1080 | 1080 |
1081 | 1081 |
1082 void FlowGraphCompiler::GenerateCall(TokenPosition token_pos, | 1082 void FlowGraphCompiler::GenerateCall(TokenPosition token_pos, |
1083 const StubEntry& stub_entry, | 1083 const StubEntry& stub_entry, |
1084 RawPcDescriptors::Kind kind, | 1084 RawPcDescriptors::Kind kind, |
1085 LocationSummary* locs) { | 1085 LocationSummary* locs) { |
1086 __ Call(stub_entry); | 1086 __ Call(stub_entry); |
1087 AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos); | 1087 EmitCallsiteMetaData(token_pos, Thread::kNoDeoptId, kind, locs); |
1088 RecordSafepoint(locs); | |
1089 } | 1088 } |
1090 | 1089 |
1091 | 1090 |
1092 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id, | 1091 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id, |
1093 TokenPosition token_pos, | 1092 TokenPosition token_pos, |
1094 const StubEntry& stub_entry, | 1093 const StubEntry& stub_entry, |
1095 RawPcDescriptors::Kind kind, | 1094 RawPcDescriptors::Kind kind, |
1096 LocationSummary* locs) { | 1095 LocationSummary* locs) { |
1097 __ Call(stub_entry); | 1096 __ Call(stub_entry); |
1098 AddCurrentDescriptor(kind, deopt_id, token_pos); | 1097 EmitCallsiteMetaData(token_pos, deopt_id, kind, locs); |
1099 RecordSafepoint(locs); | |
1100 // Marks either the continuation point in unoptimized code or the | 1098 // Marks either the continuation point in unoptimized code or the |
1101 // deoptimization point in optimized code, after call. | 1099 // deoptimization point in optimized code, after call. |
1102 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1100 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
1103 if (is_optimizing()) { | 1101 if (is_optimizing()) { |
1104 AddDeoptIndexAtCall(deopt_id_after); | 1102 AddDeoptIndexAtCall(deopt_id_after); |
1105 } else { | 1103 } else { |
1106 // Add deoptimization continuation point after the call and before the | 1104 // Add deoptimization continuation point after the call and before the |
1107 // arguments are removed. | 1105 // arguments are removed. |
1108 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); | 1106 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); |
1109 } | 1107 } |
1110 } | 1108 } |
1111 | 1109 |
1112 | 1110 |
1113 void FlowGraphCompiler::GenerateRuntimeCall(TokenPosition token_pos, | 1111 void FlowGraphCompiler::GenerateRuntimeCall(TokenPosition token_pos, |
1114 intptr_t deopt_id, | 1112 intptr_t deopt_id, |
1115 const RuntimeEntry& entry, | 1113 const RuntimeEntry& entry, |
1116 intptr_t argument_count, | 1114 intptr_t argument_count, |
1117 LocationSummary* locs) { | 1115 LocationSummary* locs) { |
1118 __ CallRuntime(entry, argument_count); | 1116 __ CallRuntime(entry, argument_count); |
1119 AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos); | 1117 EmitCallsiteMetaData(token_pos, deopt_id, RawPcDescriptors::kOther, locs); |
1120 RecordSafepoint(locs); | |
1121 if (deopt_id != Thread::kNoDeoptId) { | 1118 if (deopt_id != Thread::kNoDeoptId) { |
1122 // Marks either the continuation point in unoptimized code or the | 1119 // Marks either the continuation point in unoptimized code or the |
1123 // deoptimization point in optimized code, after call. | 1120 // deoptimization point in optimized code, after call. |
1124 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1121 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
1125 if (is_optimizing()) { | 1122 if (is_optimizing()) { |
1126 AddDeoptIndexAtCall(deopt_id_after); | 1123 AddDeoptIndexAtCall(deopt_id_after); |
1127 } else { | 1124 } else { |
1128 // Add deoptimization continuation point after the call and before the | 1125 // Add deoptimization continuation point after the call and before the |
1129 // arguments are removed. | 1126 // arguments are removed. |
1130 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); | 1127 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1238 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
1242 // Precompilation not implemented on ia32 platform. | 1239 // Precompilation not implemented on ia32 platform. |
1243 ASSERT(!FLAG_precompiled_mode); | 1240 ASSERT(!FLAG_precompiled_mode); |
1244 if (is_optimizing()) { | 1241 if (is_optimizing()) { |
1245 AddDeoptIndexAtCall(deopt_id_after); | 1242 AddDeoptIndexAtCall(deopt_id_after); |
1246 } else { | 1243 } else { |
1247 // Add deoptimization continuation point after the call and before the | 1244 // Add deoptimization continuation point after the call and before the |
1248 // arguments are removed. | 1245 // arguments are removed. |
1249 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); | 1246 AddCurrentDescriptor(RawPcDescriptors::kDeopt, deopt_id_after, token_pos); |
1250 } | 1247 } |
| 1248 EmitCatchEntryState(pending_deoptimization_env_, try_index); |
1251 __ Drop(argument_count); | 1249 __ Drop(argument_count); |
1252 } | 1250 } |
1253 | 1251 |
1254 | 1252 |
1255 void FlowGraphCompiler::EmitSwitchableInstanceCall(const ICData& ic_data, | 1253 void FlowGraphCompiler::EmitSwitchableInstanceCall(const ICData& ic_data, |
1256 intptr_t argument_count, | 1254 intptr_t argument_count, |
1257 intptr_t deopt_id, | 1255 intptr_t deopt_id, |
1258 TokenPosition token_pos, | 1256 TokenPosition token_pos, |
1259 LocationSummary* locs) { | 1257 LocationSummary* locs) { |
1260 // Only generated with precompilation. | 1258 // Only generated with precompilation. |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1770 __ movups(reg, Address(ESP, 0)); | 1768 __ movups(reg, Address(ESP, 0)); |
1771 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1769 __ addl(ESP, Immediate(kFpuRegisterSize)); |
1772 } | 1770 } |
1773 | 1771 |
1774 | 1772 |
1775 #undef __ | 1773 #undef __ |
1776 | 1774 |
1777 } // namespace dart | 1775 } // namespace dart |
1778 | 1776 |
1779 #endif // defined TARGET_ARCH_IA32 | 1777 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |