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

Unified Diff: runtime/vm/code_generator.cc

Issue 10134069: Inline type check where type argument that we check against is instantiated. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | « no previous file | runtime/vm/code_generator_ia32.cc » ('j') | runtime/vm/code_generator_ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/code_generator.cc
===================================================================
--- runtime/vm/code_generator.cc (revision 6976)
+++ runtime/vm/code_generator.cc (working copy)
@@ -410,8 +410,18 @@
AbstractTypeArguments::Handle(type.arguments());
const bool is_raw_type = type_arguments.IsNull() ||
type_arguments.IsRaw(type_arguments.Length());
- if (!is_raw_type) {
- return;
+ if (!is_raw_type && !type_arguments.IsNull()) {
regis 2012/04/26 00:36:17 No need to check && !type_arguments.IsNull()
srdjan 2012/04/26 18:08:37 Done.
+ // We cannot inline tests for instances with more than one type argument
+ // or if it's class has not been resolved (malformed type).
regis 2012/04/26 00:36:17 its class
regis 2012/04/26 00:36:17 I do not think you can encounter a malformed type
srdjan 2012/04/26 18:08:37 I misunderstood your explanation of malformed type
+ if (type_arguments.Length() != 1) {
+ // We can handle only one argument so far
regis 2012/04/26 00:36:17 far.
srdjan 2012/04/26 18:08:37 Done.
+ return;
+ }
+ const AbstractType& type_argument_0 =
regis 2012/04/26 00:36:17 type_argument instead of type_argument_0?
srdjan 2012/04/26 18:08:37 Removed that code.
+ AbstractType::ZoneHandle(type_arguments.TypeAt(0));
regis 2012/04/26 00:36:17 Why a ZoneHandle?
srdjan 2012/04/26 18:08:37 Handle
+ if (type_argument_0.IsType() && !type_argument_0.HasResolvedTypeClass()) {
regis 2012/04/26 00:36:17 Are you checking for IsMalformed()? But how can th
srdjan 2012/04/26 18:08:37 Converted to assert added comment why it can't be
+ return;
+ }
}
}
StackFrameIterator iterator(StackFrameIterator::kDontValidateFrames);
« no previous file with comments | « no previous file | runtime/vm/code_generator_ia32.cc » ('j') | runtime/vm/code_generator_ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698