| 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/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/code_descriptors.h" | 10 #include "vm/code_descriptors.h" |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 // Type nodes are used when a type is referenced as a literal. Type nodes | 857 // Type nodes are used when a type is referenced as a literal. Type nodes |
| 858 // can also be used for the right-hand side of instanceof comparisons, | 858 // can also be used for the right-hand side of instanceof comparisons, |
| 859 // but they are handled specially in that context, not here. | 859 // but they are handled specially in that context, not here. |
| 860 void EffectGraphVisitor::VisitTypeNode(TypeNode* node) { | 860 void EffectGraphVisitor::VisitTypeNode(TypeNode* node) { |
| 861 return; | 861 return; |
| 862 } | 862 } |
| 863 | 863 |
| 864 | 864 |
| 865 void ValueGraphVisitor::VisitTypeNode(TypeNode* node) { | 865 void ValueGraphVisitor::VisitTypeNode(TypeNode* node) { |
| 866 const AbstractType& type = node->type(); | 866 const AbstractType& type = node->type(); |
| 867 ASSERT(type.IsFinalized() && !type.IsMalformed() && !type.IsMalbounded()); | 867 // Type may be malbounded, but not malformed. |
| 868 ASSERT(type.IsFinalized() && !type.IsMalformed()); |
| 868 if (type.IsInstantiated()) { | 869 if (type.IsInstantiated()) { |
| 869 ReturnDefinition(new ConstantInstr(type)); | 870 ReturnDefinition(new ConstantInstr(type)); |
| 870 } else { | 871 } else { |
| 871 const Class& instantiator_class = Class::ZoneHandle( | 872 const Class& instantiator_class = Class::ZoneHandle( |
| 872 owner()->parsed_function()->function().Owner()); | 873 owner()->parsed_function()->function().Owner()); |
| 873 Value* instantiator_value = BuildInstantiatorTypeArguments( | 874 Value* instantiator_value = BuildInstantiatorTypeArguments( |
| 874 node->token_pos(), instantiator_class, NULL); | 875 node->token_pos(), instantiator_class, NULL); |
| 875 ReturnDefinition(new InstantiateTypeInstr( | 876 ReturnDefinition(new InstantiateTypeInstr( |
| 876 node->token_pos(), type, instantiator_class, instantiator_value)); | 877 node->token_pos(), type, instantiator_class, instantiator_value)); |
| 877 } | 878 } |
| (...skipping 2961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3839 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; | 3840 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; |
| 3840 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); | 3841 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); |
| 3841 OS::SNPrint(chars, len, kFormat, function_name, reason); | 3842 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 3842 const Error& error = Error::Handle( | 3843 const Error& error = Error::Handle( |
| 3843 LanguageError::New(String::Handle(String::New(chars)))); | 3844 LanguageError::New(String::Handle(String::New(chars)))); |
| 3844 Isolate::Current()->long_jump_base()->Jump(1, error); | 3845 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 3845 } | 3846 } |
| 3846 | 3847 |
| 3847 | 3848 |
| 3848 } // namespace dart | 3849 } // namespace dart |
| OLD | NEW |