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

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

Issue 1284093004: Reuse canonicalized type for receiver type if class is not signature class and has no type paramete… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix comment Created 5 years, 4 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 | « no previous file | 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 11841 matching lines...) Expand 10 before | Expand all | Expand 10 after
11852 current_member_->has_static && !current_member_->has_factory; 11852 current_member_->has_static && !current_member_->has_factory;
11853 } 11853 }
11854 ASSERT(!current_function().IsNull()); 11854 ASSERT(!current_function().IsNull());
11855 return 11855 return
11856 current_function().is_static() && !current_function().IsInFactoryScope(); 11856 current_function().is_static() && !current_function().IsInFactoryScope();
11857 } 11857 }
11858 11858
11859 11859
11860 const AbstractType* Parser::ReceiverType(const Class& cls) { 11860 const AbstractType* Parser::ReceiverType(const Class& cls) {
11861 ASSERT(!cls.IsNull()); 11861 ASSERT(!cls.IsNull());
11862 const TypeArguments& type_arguments = TypeArguments::Handle( 11862 AbstractType& type = AbstractType::ZoneHandle(Z, cls.CanonicalType());
11863 Z, 11863 if (!type.IsNull()) {
11864 // This requirement is embedded in 'CacnonicalType' function.
hausner 2015/08/19 17:45:03 Cacnonical -> Canonical
srdjan 2015/08/19 17:55:25 Done.
11865 ASSERT((cls.NumTypeArguments() == 0) && !cls.IsSignatureClass());
11866 return &type;
11867 }
11868
11869 const TypeArguments& type_arguments = TypeArguments::Handle(Z,
11864 (cls.NumTypeParameters() > 0) ? 11870 (cls.NumTypeParameters() > 0) ?
11865 cls.type_parameters() : TypeArguments::null()); 11871 cls.type_parameters() : TypeArguments::null());
11866 AbstractType& type = AbstractType::ZoneHandle( 11872 type = Type::New(cls, type_arguments, cls.token_pos());
11867 Z, Type::New(cls, type_arguments, cls.token_pos()));
11868 if (cls.is_type_finalized()) { 11873 if (cls.is_type_finalized()) {
11869 type ^= ClassFinalizer::FinalizeType( 11874 type ^= ClassFinalizer::FinalizeType(
11870 cls, type, ClassFinalizer::kCanonicalizeWellFormed); 11875 cls, type, ClassFinalizer::kCanonicalizeWellFormed);
11871 // Note that the receiver type may now be a malbounded type. 11876 // Note that the receiver type may now be a malbounded type.
11872 } 11877 }
11873 return &type; 11878 return &type;
11874 } 11879 }
11875 11880
11876 11881
11877 bool Parser::IsInstantiatorRequired() const { 11882 bool Parser::IsInstantiatorRequired() const {
(...skipping 2309 matching lines...) Expand 10 before | Expand all | Expand 10 after
14187 void Parser::SkipQualIdent() { 14192 void Parser::SkipQualIdent() {
14188 ASSERT(IsIdentifier()); 14193 ASSERT(IsIdentifier());
14189 ConsumeToken(); 14194 ConsumeToken();
14190 if (CurrentToken() == Token::kPERIOD) { 14195 if (CurrentToken() == Token::kPERIOD) {
14191 ConsumeToken(); // Consume the kPERIOD token. 14196 ConsumeToken(); // Consume the kPERIOD token.
14192 ExpectIdentifier("identifier expected after '.'"); 14197 ExpectIdentifier("identifier expected after '.'");
14193 } 14198 }
14194 } 14199 }
14195 14200
14196 } // namespace dart 14201 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698