| 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/parser.h" | 5 #include "vm/parser.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/ast_transformer.h" | 9 #include "vm/ast_transformer.h" |
| 10 #include "vm/bootstrap.h" | 10 #include "vm/bootstrap.h" |
| (...skipping 13149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13160 *constructor = type_class.LookupConstructor(constructor_name); | 13160 *constructor = type_class.LookupConstructor(constructor_name); |
| 13161 if (constructor->IsNull()) { | 13161 if (constructor->IsNull()) { |
| 13162 *constructor = type_class.LookupFactory(constructor_name); | 13162 *constructor = type_class.LookupFactory(constructor_name); |
| 13163 ASSERT(!constructor->IsNull()); | 13163 ASSERT(!constructor->IsNull()); |
| 13164 if (constructor->IsRedirectingFactory()) { | 13164 if (constructor->IsRedirectingFactory()) { |
| 13165 ClassFinalizer::ResolveRedirectingFactory(type_class, *constructor); | 13165 ClassFinalizer::ResolveRedirectingFactory(type_class, *constructor); |
| 13166 type = constructor->RedirectionType(); | 13166 type = constructor->RedirectionType(); |
| 13167 ASSERT(!type.IsMalformedOrMalbounded()); | 13167 ASSERT(!type.IsMalformedOrMalbounded()); |
| 13168 if (!type.IsInstantiated()) { | 13168 if (!type.IsInstantiated()) { |
| 13169 Error& error = Error::Handle(Z); | 13169 Error& error = Error::Handle(Z); |
| 13170 type ^= type.InstantiateFrom(*type_arguments, &error); | 13170 type ^= type.InstantiateFrom(*type_arguments, &error, NULL, Heap::kOld); |
| 13171 ASSERT(error.IsNull()); | 13171 ASSERT(error.IsNull()); |
| 13172 } | 13172 } |
| 13173 *type_arguments = type.arguments(); | 13173 *type_arguments = type.arguments(); |
| 13174 *constructor = constructor->RedirectionTarget(); | 13174 *constructor = constructor->RedirectionTarget(); |
| 13175 } | 13175 } |
| 13176 } | 13176 } |
| 13177 } | 13177 } |
| 13178 | 13178 |
| 13179 | 13179 |
| 13180 AstNode* Parser::ParseNewOperator(Token::Kind op_kind) { | 13180 AstNode* Parser::ParseNewOperator(Token::Kind op_kind) { |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13364 "redirection type '%s' is not loaded", | 13364 "redirection type '%s' is not loaded", |
| 13365 String::Handle(Z, redirect_type.UserVisibleName()).ToCString()); | 13365 String::Handle(Z, redirect_type.UserVisibleName()).ToCString()); |
| 13366 } | 13366 } |
| 13367 | 13367 |
| 13368 if (redirect_type.IsMalformedOrMalbounded()) { | 13368 if (redirect_type.IsMalformedOrMalbounded()) { |
| 13369 if (is_const) { | 13369 if (is_const) { |
| 13370 ReportError(Error::Handle(Z, redirect_type.error())); | 13370 ReportError(Error::Handle(Z, redirect_type.error())); |
| 13371 } | 13371 } |
| 13372 return ThrowTypeError(redirect_type.token_pos(), redirect_type); | 13372 return ThrowTypeError(redirect_type.token_pos(), redirect_type); |
| 13373 } | 13373 } |
| 13374 if (I->flags().type_checks() && !redirect_type.IsSubtypeOf(type, NULL)) { | 13374 if (I->flags().type_checks() && |
| 13375 !redirect_type.IsSubtypeOf(type, NULL, Heap::kOld)) { |
| 13375 // Additional type checking of the result is necessary. | 13376 // Additional type checking of the result is necessary. |
| 13376 type_bound = type.raw(); | 13377 type_bound = type.raw(); |
| 13377 } | 13378 } |
| 13378 type = redirect_type.raw(); | 13379 type = redirect_type.raw(); |
| 13379 type_class = type.type_class(); | 13380 type_class = type.type_class(); |
| 13380 type_class_name = type_class.Name(); | 13381 type_class_name = type_class.Name(); |
| 13381 type_arguments = type.arguments(); | 13382 type_arguments = type.arguments(); |
| 13382 constructor = constructor.RedirectionTarget(); | 13383 constructor = constructor.RedirectionTarget(); |
| 13383 constructor_name = constructor.name(); | 13384 constructor_name = constructor.name(); |
| 13384 ASSERT(!constructor.IsNull()); | 13385 ASSERT(!constructor.IsNull()); |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14281 void Parser::SkipQualIdent() { | 14282 void Parser::SkipQualIdent() { |
| 14282 ASSERT(IsIdentifier()); | 14283 ASSERT(IsIdentifier()); |
| 14283 ConsumeToken(); | 14284 ConsumeToken(); |
| 14284 if (CurrentToken() == Token::kPERIOD) { | 14285 if (CurrentToken() == Token::kPERIOD) { |
| 14285 ConsumeToken(); // Consume the kPERIOD token. | 14286 ConsumeToken(); // Consume the kPERIOD token. |
| 14286 ExpectIdentifier("identifier expected after '.'"); | 14287 ExpectIdentifier("identifier expected after '.'"); |
| 14287 } | 14288 } |
| 14288 } | 14289 } |
| 14289 | 14290 |
| 14290 } // namespace dart | 14291 } // namespace dart |
| OLD | NEW |