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

Unified Diff: runtime/vm/exceptions.cc

Issue 10693071: Use VM type cast and save handles. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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
Index: runtime/vm/exceptions.cc
===================================================================
--- runtime/vm/exceptions.cc (revision 9306)
+++ runtime/vm/exceptions.cc (working copy)
@@ -326,13 +326,11 @@
void Exceptions::PropagateError(const Object& obj) {
ASSERT(Isolate::Current()->top_exit_frame_info() != 0);
- Error& error = Error::Handle();
- error ^= obj.raw();
+ const Error& error = Error::Cast(obj);
if (error.IsUnhandledException()) {
// If the error object represents an unhandled exception, then
// rethrow the exception in the normal fashion.
- UnhandledException& uhe = UnhandledException::Handle();
- uhe ^= error.raw();
+ const UnhandledException& uhe = UnhandledException::Cast(obj);
const Instance& exc = Instance::Handle(uhe.exception());
const Instance& stk = Instance::Handle(uhe.stacktrace());
Exceptions::ReThrow(exc, stk);
@@ -356,14 +354,10 @@
if (result.IsError()) {
// We got an error while constructing the exception object.
// Propagate the error instead of throwing the exception.
- Error& error = Error::Handle();
- error ^= result.raw();
- PropagateError(error);
+ PropagateError(result);
Ivan Posva 2012/07/02 21:01:38 I personally do not like how the type check and th
regis 2012/07/02 21:42:33 Done.
} else {
ASSERT(result.IsInstance());
- Instance& exception = Instance::Handle();
- exception ^= result.raw();
- Throw(exception);
+ Throw(Instance::Cast(result));
}
}

Powered by Google App Engine
This is Rietveld 408576698