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

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

Issue 575443002: Refactor generating lazy deoptimization descriptors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.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_MIPS. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS.
6 #if defined(TARGET_ARCH_MIPS) 6 #if defined(TARGET_ARCH_MIPS)
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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 __ Branch(&stub_code->DeoptimizeLazyLabel()); 1132 __ Branch(&stub_code->DeoptimizeLazyLabel());
1133 } 1133 }
1134 } 1134 }
1135 1135
1136 1136
1137 void FlowGraphCompiler::GenerateCall(intptr_t token_pos, 1137 void FlowGraphCompiler::GenerateCall(intptr_t token_pos,
1138 const ExternalLabel* label, 1138 const ExternalLabel* label,
1139 RawPcDescriptors::Kind kind, 1139 RawPcDescriptors::Kind kind,
1140 LocationSummary* locs) { 1140 LocationSummary* locs) {
1141 __ BranchLinkPatchable(label); 1141 __ BranchLinkPatchable(label);
1142 AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos); 1142 RecordCallInfo(token_pos, kind, Isolate::kNoDeoptId, locs, 0);
1143 RecordSafepoint(locs);
1144 } 1143 }
1145 1144
1146 1145
1147 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id, 1146 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id,
1148 intptr_t token_pos, 1147 intptr_t token_pos,
1149 const ExternalLabel* label, 1148 const ExternalLabel* label,
1150 RawPcDescriptors::Kind kind, 1149 RawPcDescriptors::Kind kind,
1151 LocationSummary* locs) { 1150 LocationSummary* locs) {
1152 __ BranchLinkPatchable(label); 1151 __ BranchLinkPatchable(label);
1153 AddCurrentDescriptor(kind, deopt_id, token_pos); 1152 RecordCallInfo(token_pos, kind, deopt_id, locs, locs->input_count());
1154 RecordSafepoint(locs);
1155 // Marks either the continuation point in unoptimized code or the
1156 // deoptimization point in optimized code, after call.
1157 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
1158 if (is_optimizing()) {
1159 AddDeoptIndexAtCall(deopt_id_after, token_pos);
1160 } else {
1161 // Add deoptimization continuation point after the call and before the
1162 // arguments are removed.
1163 AddCurrentDescriptor(RawPcDescriptors::kDeopt,
1164 deopt_id_after,
1165 token_pos);
1166 }
1167 } 1153 }
1168 1154
1169 1155
1170 void FlowGraphCompiler::GenerateRuntimeCall(intptr_t token_pos, 1156 void FlowGraphCompiler::GenerateRuntimeCall(intptr_t token_pos,
1171 intptr_t deopt_id, 1157 intptr_t deopt_id,
1172 const RuntimeEntry& entry, 1158 const RuntimeEntry& entry,
1173 intptr_t argument_count, 1159 intptr_t argument_count,
1174 LocationSummary* locs) { 1160 LocationSummary* locs) {
1175 __ CallRuntime(entry, argument_count); 1161 __ CallRuntime(entry, argument_count);
1176 AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos); 1162 RecordCallInfo(token_pos, RawPcDescriptors::kOther, deopt_id, locs, 0);
1177 RecordSafepoint(locs);
1178 if (deopt_id != Isolate::kNoDeoptId) {
1179 // Marks either the continuation point in unoptimized code or the
1180 // deoptimization point in optimized code, after call.
1181 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
1182 if (is_optimizing()) {
1183 AddDeoptIndexAtCall(deopt_id_after, token_pos);
1184 } else {
1185 // Add deoptimization continuation point after the call and before the
1186 // arguments are removed.
1187 AddCurrentDescriptor(RawPcDescriptors::kDeopt,
1188 deopt_id_after,
1189 token_pos);
1190 }
1191 }
1192 } 1163 }
1193 1164
1194 1165
1195 void FlowGraphCompiler::EmitEdgeCounter() { 1166 void FlowGraphCompiler::EmitEdgeCounter() {
1196 // We do not check for overflow when incrementing the edge counter. The 1167 // We do not check for overflow when incrementing the edge counter. The
1197 // function should normally be optimized long before the counter can 1168 // function should normally be optimized long before the counter can
1198 // overflow; and though we do not reset the counters when we optimize or 1169 // overflow; and though we do not reset the counters when we optimize or
1199 // deoptimize, there is a bound on the number of 1170 // deoptimize, there is a bound on the number of
1200 // optimization/deoptimization cycles we will attempt. 1171 // optimization/deoptimization cycles we will attempt.
1201 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld)); 1172 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld));
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1305 // be invoked as a normal Dart function. 1276 // be invoked as a normal Dart function.
1306 __ sll(T1, T3, 2); 1277 __ sll(T1, T3, 2);
1307 __ addu(T1, T2, T1); 1278 __ addu(T1, T2, T1);
1308 __ lw(T0, FieldAddress(T1, base + kWordSize)); 1279 __ lw(T0, FieldAddress(T1, base + kWordSize));
1309 1280
1310 __ lw(T1, FieldAddress(T0, Function::instructions_offset())); 1281 __ lw(T1, FieldAddress(T0, Function::instructions_offset()));
1311 __ LoadObject(S5, ic_data); 1282 __ LoadObject(S5, ic_data);
1312 __ LoadObject(S4, arguments_descriptor); 1283 __ LoadObject(S4, arguments_descriptor);
1313 __ AddImmediate(T1, Instructions::HeaderSize() - kHeapObjectTag); 1284 __ AddImmediate(T1, Instructions::HeaderSize() - kHeapObjectTag);
1314 __ jalr(T1); 1285 __ jalr(T1);
1315 AddCurrentDescriptor(RawPcDescriptors::kOther, 1286 RecordCallInfo(
1316 Isolate::kNoDeoptId, token_pos); 1287 token_pos, RawPcDescriptors::kOther, deopt_id, locs, locs->input_count());
1317 RecordSafepoint(locs);
1318 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos);
1319 __ Drop(argument_count); 1288 __ Drop(argument_count);
1320 } 1289 }
1321 1290
1322 1291
1323 void FlowGraphCompiler::EmitUnoptimizedStaticCall( 1292 void FlowGraphCompiler::EmitUnoptimizedStaticCall(
1324 intptr_t argument_count, 1293 intptr_t argument_count,
1325 intptr_t deopt_id, 1294 intptr_t deopt_id,
1326 intptr_t token_pos, 1295 intptr_t token_pos,
1327 LocationSummary* locs, 1296 LocationSummary* locs,
1328 const ICData& ic_data) { 1297 const ICData& ic_data) {
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
1799 __ AddImmediate(SP, kDoubleSize); 1768 __ AddImmediate(SP, kDoubleSize);
1800 } 1769 }
1801 1770
1802 1771
1803 #undef __ 1772 #undef __
1804 1773
1805 1774
1806 } // namespace dart 1775 } // namespace dart
1807 1776
1808 #endif // defined TARGET_ARCH_MIPS 1777 #endif // defined TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698