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

Unified Diff: runtime/vm/code_generator.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
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/dart_api_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 9315)
+++ runtime/vm/code_generator.cc (working copy)
@@ -377,9 +377,8 @@
}
if (type_arguments.IsInstantiatedTypeArguments()) {
do {
- InstantiatedTypeArguments& instantiated_type_arguments =
- InstantiatedTypeArguments::Handle();
- instantiated_type_arguments ^= type_arguments.raw();
+ const InstantiatedTypeArguments& instantiated_type_arguments =
+ InstantiatedTypeArguments::Cast(type_arguments);
const AbstractTypeArguments& uninstantiated =
AbstractTypeArguments::Handle(
instantiated_type_arguments.uninstantiated_type_arguments());
@@ -388,15 +387,13 @@
instantiated_type_arguments.instantiator_type_arguments());
type_arguments = uninstantiated.InstantiateFrom(instantiator);
} while (type_arguments.IsInstantiatedTypeArguments());
- TypeArguments& new_type_arguments = TypeArguments::Handle();
- new_type_arguments ^= type_arguments.raw();
- new_type_arguments ^= new_type_arguments.Canonicalize();
+ AbstractTypeArguments& new_type_arguments = AbstractTypeArguments::Handle();
+ new_type_arguments = type_arguments.Canonicalize();
instance.SetTypeArguments(new_type_arguments);
*type_arguments_replaced = true;
} else if (!type_arguments.IsCanonical()) {
- AbstractTypeArguments& new_type_arguments =
- AbstractTypeArguments::Handle();
- new_type_arguments ^= type_arguments.Canonicalize();
+ AbstractTypeArguments& new_type_arguments = AbstractTypeArguments::Handle();
+ new_type_arguments = type_arguments.Canonicalize();
instance.SetTypeArguments(new_type_arguments);
*type_arguments_replaced = true;
}
@@ -458,7 +455,7 @@
if (replaced) {
type_arguments_replaced = true;
}
- instantiator_type_arguments ^= instantiator.GetTypeArguments();
+ instantiator_type_arguments = instantiator.GetTypeArguments();
}
Class& last_instance_class = Class::Handle();
@@ -789,7 +786,7 @@
// rethrow it.
static void CheckResultError(const Object& result) {
if (result.IsError()) {
- Exceptions::PropagateError(result);
+ Exceptions::PropagateError(Error::Cast(result));
}
}
@@ -1005,8 +1002,7 @@
arguments.SetReturn(closure);
return;
}
- Class& receiver_class = Class::Handle();
- receiver_class ^= receiver.clazz();
+ const Class& receiver_class = Class::Handle(receiver.clazz());
ASSERT(!receiver_class.IsNull());
String& func_name = String::Handle();
func_name = String::SubString(original_function_name, getter_prefix.Length());
@@ -1074,7 +1070,7 @@
arguments.SetReturn(code);
return;
} else {
- Exceptions::PropagateError(result);
+ Exceptions::PropagateError(Error::Cast(result));
}
}
if (!result.IsSmi()) {
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/dart_api_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698