Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/code_descriptors.h" | 9 #include "vm/code_descriptors.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2292 intptr_t token_pos, | 2292 intptr_t token_pos, |
| 2293 const AbstractTypeArguments& type_arguments) { | 2293 const AbstractTypeArguments& type_arguments) { |
| 2294 if (type_arguments.IsNull() || type_arguments.IsInstantiated()) { | 2294 if (type_arguments.IsNull() || type_arguments.IsInstantiated()) { |
| 2295 return Bind(new ConstantInstr(type_arguments)); | 2295 return Bind(new ConstantInstr(type_arguments)); |
| 2296 } | 2296 } |
| 2297 // The type arguments are uninstantiated. | 2297 // The type arguments are uninstantiated. |
| 2298 const Class& instantiator_class = Class::ZoneHandle( | 2298 const Class& instantiator_class = Class::ZoneHandle( |
| 2299 owner()->parsed_function().function().Owner()); | 2299 owner()->parsed_function().function().Owner()); |
| 2300 Value* instantiator_value = | 2300 Value* instantiator_value = |
| 2301 BuildInstantiatorTypeArguments(token_pos, instantiator_class, NULL); | 2301 BuildInstantiatorTypeArguments(token_pos, instantiator_class, NULL); |
| 2302 return Bind(new InstantiateTypeArgumentsInstr(token_pos, | 2302 const bool use_instantiator_type_args = |
| 2303 type_arguments, | 2303 type_arguments.IsUninstantiatedIdentity() || |
|
Kevin Millikin (Google)
2013/05/27 09:22:03
This predicate or its negation appears over and ov
Florian Schneider
2013/05/27 10:20:11
Possibly. I don't have a really good name for such
| |
| 2304 instantiator_class, | 2304 type_arguments.CanShareInstantiatorTypeArguments( |
| 2305 instantiator_value)); | 2305 instantiator_class); |
| 2306 return use_instantiator_type_args | |
| 2307 ? instantiator_value | |
| 2308 : Bind(new InstantiateTypeArgumentsInstr(token_pos, | |
| 2309 type_arguments, | |
| 2310 instantiator_class, | |
| 2311 instantiator_value)); | |
| 2306 } | 2312 } |
| 2307 | 2313 |
| 2308 | 2314 |
| 2309 void EffectGraphVisitor::BuildConstructorTypeArguments( | 2315 void EffectGraphVisitor::BuildConstructorTypeArguments( |
| 2310 ConstructorCallNode* node, | 2316 ConstructorCallNode* node, |
| 2311 ZoneGrowableArray<PushArgumentInstr*>* call_arguments) { | 2317 ZoneGrowableArray<PushArgumentInstr*>* call_arguments) { |
| 2312 const Class& cls = Class::ZoneHandle(node->constructor().Owner()); | 2318 const Class& cls = Class::ZoneHandle(node->constructor().Owner()); |
| 2313 ASSERT(cls.HasTypeArguments() && !node->constructor().IsFactory()); | 2319 ASSERT(cls.HasTypeArguments() && !node->constructor().IsFactory()); |
| 2314 if (node->type_arguments().IsNull() || | 2320 if (node->type_arguments().IsNull() || |
| 2315 node->type_arguments().IsInstantiated()) { | 2321 node->type_arguments().IsInstantiated()) { |
| (...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3435 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3441 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 3436 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3442 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 3437 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3443 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 3438 const Error& error = Error::Handle( | 3444 const Error& error = Error::Handle( |
| 3439 LanguageError::New(String::Handle(String::New(chars)))); | 3445 LanguageError::New(String::Handle(String::New(chars)))); |
| 3440 Isolate::Current()->long_jump_base()->Jump(1, error); | 3446 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3441 } | 3447 } |
| 3442 | 3448 |
| 3443 | 3449 |
| 3444 } // namespace dart | 3450 } // namespace dart |
| OLD | NEW |