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

Side by Side Diff: vm/intermediate_language.cc

Issue 10829141: Support Throw and ReThrow in SSA-based compiler. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 4 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 | « vm/intermediate_language.h ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/intermediate_language.h" 5 #include "vm/intermediate_language.h"
6 6
7 #include "vm/bit_vector.h" 7 #include "vm/bit_vector.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/flow_graph_builder.h" 9 #include "vm/flow_graph_builder.h"
10 #include "vm/flow_graph_compiler.h" 10 #include "vm/flow_graph_compiler.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 UNREACHABLE(); 245 UNREACHABLE();
246 return NULL; 246 return NULL;
247 } 247 }
248 248
249 249
250 void ParallelMoveInstr::SetInputAt(intptr_t i, Value* value) { 250 void ParallelMoveInstr::SetInputAt(intptr_t i, Value* value) {
251 UNREACHABLE(); 251 UNREACHABLE();
252 } 252 }
253 253
254 254
255 intptr_t ReThrowInstr::InputCount() const {
256 return 2;
257 }
258
259
260 Value* ReThrowInstr::InputAt(intptr_t i) const {
261 if (i == 0) return exception();
262 if (i == 1) return stack_trace();
263 UNREACHABLE();
264 return NULL;
265 }
266
267
268 void ReThrowInstr::SetInputAt(intptr_t i, Value* value) {
269 if (i == 0) {
270 exception_ = value;
271 return;
272 }
273 if (i == 1) {
274 stack_trace_ = value;
275 return;
276 }
277 UNREACHABLE();
278 }
279
280
281 intptr_t ThrowInstr::InputCount() const {
282 return 1;
283 }
284
285
286 Value* ThrowInstr::InputAt(intptr_t i) const {
287 if (i == 0) return exception();
288 UNREACHABLE();
289 return NULL;
290 }
291
292
293 void ThrowInstr::SetInputAt(intptr_t i, Value* value) {
294 if (i == 0) {
295 exception_ = value;
296 return;
297 }
298 UNREACHABLE();
299 }
300
301
302 intptr_t GotoInstr::InputCount() const { 255 intptr_t GotoInstr::InputCount() const {
303 return 0; 256 return 0;
304 } 257 }
305 258
306 259
307 Value* GotoInstr::InputAt(intptr_t i) const { 260 Value* GotoInstr::InputAt(intptr_t i) const {
308 UNREACHABLE(); 261 UNREACHABLE();
309 return NULL; 262 return NULL;
310 } 263 }
311 264
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
1085 ASSERT(temp_reg != value_reg); 1038 ASSERT(temp_reg != value_reg);
1086 ASSERT(ic_data() != NULL); 1039 ASSERT(ic_data() != NULL);
1087 compiler->EmitClassChecksNoSmi(*ic_data(), instance_reg, temp_reg, deopt); 1040 compiler->EmitClassChecksNoSmi(*ic_data(), instance_reg, temp_reg, deopt);
1088 } 1041 }
1089 __ StoreIntoObject(instance_reg, FieldAddress(instance_reg, field().Offset()), 1042 __ StoreIntoObject(instance_reg, FieldAddress(instance_reg, field().Offset()),
1090 value_reg); 1043 value_reg);
1091 } 1044 }
1092 1045
1093 1046
1094 LocationSummary* ThrowInstr::MakeLocationSummary() const { 1047 LocationSummary* ThrowInstr::MakeLocationSummary() const {
1095 const int kNumInputs = 0; 1048 return new LocationSummary(0, 0, LocationSummary::kCall);
1096 const int kNumTemps = 0;
1097 return new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1098 } 1049 }
1099 1050
1100 1051
1101 1052
1102 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1053 void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1103 ASSERT(exception()->IsUse());
1104 compiler->GenerateCallRuntime(cid(), 1054 compiler->GenerateCallRuntime(cid(),
1105 token_pos(), 1055 token_pos(),
1106 try_index(), 1056 try_index(),
1107 kThrowRuntimeEntry); 1057 kThrowRuntimeEntry);
1108 __ int3(); 1058 __ int3();
1109 } 1059 }
1110 1060
1111 1061
1112 LocationSummary* ReThrowInstr::MakeLocationSummary() const { 1062 LocationSummary* ReThrowInstr::MakeLocationSummary() const {
1113 const int kNumInputs = 0; 1063 return new LocationSummary(0, 0, LocationSummary::kCall);
1114 const int kNumTemps = 0;
1115 return new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall);
1116 } 1064 }
1117 1065
1118 1066
1119 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 1067 void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
1120 ASSERT(exception()->IsUse());
1121 ASSERT(stack_trace()->IsUse());
1122 compiler->GenerateCallRuntime(cid(), 1068 compiler->GenerateCallRuntime(cid(),
1123 token_pos(), 1069 token_pos(),
1124 try_index(), 1070 try_index(),
1125 kReThrowRuntimeEntry); 1071 kReThrowRuntimeEntry);
1126 __ int3(); 1072 __ int3();
1127 } 1073 }
1128 1074
1129 1075
1130 LocationSummary* GotoInstr::MakeLocationSummary() const { 1076 LocationSummary* GotoInstr::MakeLocationSummary() const {
1131 return new LocationSummary(0, 0, LocationSummary::kNoCall); 1077 return new LocationSummary(0, 0, LocationSummary::kNoCall);
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 if (compiler->is_ssa()) { 1388 if (compiler->is_ssa()) {
1443 ASSERT(locs()->in(0).IsRegister()); 1389 ASSERT(locs()->in(0).IsRegister());
1444 __ PushRegister(locs()->in(0).reg()); 1390 __ PushRegister(locs()->in(0).reg());
1445 } 1391 }
1446 } 1392 }
1447 1393
1448 1394
1449 #undef __ 1395 #undef __
1450 1396
1451 } // namespace dart 1397 } // namespace dart
OLDNEW
« no previous file with comments | « vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698