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

Side by Side Diff: runtime/vm/parser.cc

Issue 1377453005: Cleanups and preemptively pass Heap::kOld whenever subtype testing in compiler (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: sync Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698