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

Unified Diff: runtime/vm/intermediate_language_arm.cc

Issue 14362008: Implement catch on ARM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_arm.cc
===================================================================
--- runtime/vm/intermediate_language_arm.cc (revision 21707)
+++ runtime/vm/intermediate_language_arm.cc (working copy)
@@ -84,9 +84,11 @@
// not optimized.
if (!compiler->HasFinally()) {
__ Comment("Stack Check");
- const int sp_fp_dist = compiler->StackSize() + (-kFirstLocalSlotIndex - 1);
- __ sub(R2, FP, ShifterOperand(SP));
- __ CompareImmediate(R2, sp_fp_dist * kWordSize);
+ const intptr_t fp_sp_dist =
+ (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+ ASSERT(fp_sp_dist <= 0);
+ __ sub(R2, SP, ShifterOperand(FP));
+ __ CompareImmediate(R2, fp_sp_dist);
__ bkpt(0, NE);
}
#endif
@@ -1491,13 +1493,31 @@
LocationSummary* CatchEntryInstr::MakeLocationSummary() const {
- UNIMPLEMENTED();
- return NULL;
+ return LocationSummary::Make(0,
+ Location::NoLocation(),
+ LocationSummary::kNoCall);
}
+// Restore stack and initialize the two exception variables:
+// exception and stack trace variables.
void CatchEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- UNIMPLEMENTED();
+ // Restore SP from FP as we are coming from a throw and the code for
+ // popping arguments has not been run.
+ const intptr_t fp_sp_dist =
+ (kFirstLocalSlotIndex + 1 - compiler->StackSize()) * kWordSize;
+ ASSERT(fp_sp_dist <= 0);
+ __ AddImmediate(SP, FP, fp_sp_dist);
+
+ ASSERT(!exception_var().is_captured());
+ ASSERT(!stacktrace_var().is_captured());
+ __ StoreToOffset(kStoreWord, kExceptionObjectReg,
+ FP, exception_var().index() * kWordSize);
+ __ StoreToOffset(kStoreWord, kStackTraceObjectReg,
+ FP, stacktrace_var().index() * kWordSize);
+
+ // Restore the pool pointer.
+ __ LoadPoolPointer();
}
@@ -2051,7 +2071,6 @@
}
-
void ThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
compiler->GenerateCallRuntime(token_pos(),
deopt_id(),
@@ -2062,13 +2081,16 @@
LocationSummary* ReThrowInstr::MakeLocationSummary() const {
- UNIMPLEMENTED();
- return NULL;
+ return new LocationSummary(0, 0, LocationSummary::kCall);
}
void ReThrowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
- UNIMPLEMENTED();
+ compiler->GenerateCallRuntime(token_pos(),
+ deopt_id(),
+ kReThrowRuntimeEntry,
+ locs());
+ __ bkpt(0);
}
« no previous file with comments | « runtime/vm/flow_graph_compiler_arm.cc ('k') | runtime/vm/intermediate_language_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698