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

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

Issue 1282633002: Make constructor closure functions invisible on the stack (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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 12866 matching lines...) Expand 10 before | Expand all | Expand 10 after
12877 ParseFormalParameters(ctr, &params); 12877 ParseFormalParameters(ctr, &params);
12878 // Per language spec, the type of the closure parameters is dynamic. 12878 // Per language spec, the type of the closure parameters is dynamic.
12879 // Replace the types parsed from the constructor. 12879 // Replace the types parsed from the constructor.
12880 params.EraseParameterTypes(); 12880 params.EraseParameterTypes();
12881 12881
12882 closure = Function::NewClosureFunction(closure_name, 12882 closure = Function::NewClosureFunction(closure_name,
12883 innermost_function(), 12883 innermost_function(),
12884 token_pos); 12884 token_pos);
12885 closure.set_is_generated_body(true); 12885 closure.set_is_generated_body(true);
12886 closure.set_is_debuggable(false); 12886 closure.set_is_debuggable(false);
12887 closure.set_is_visible(false);
12887 closure.set_result_type(AbstractType::Handle(Type::DynamicType())); 12888 closure.set_result_type(AbstractType::Handle(Type::DynamicType()));
12888 AddFormalParamsToFunction(&params, closure); 12889 AddFormalParamsToFunction(&params, closure);
12889 12890
12890 // Create and set the signature class of the closure. 12891 // Create and set the signature class of the closure.
12891 const String& sig = String::Handle(Z, closure.Signature()); 12892 const String& sig = String::Handle(Z, closure.Signature());
12892 Class& sig_cls = Class::Handle(Z, library_.LookupLocalClass(sig)); 12893 Class& sig_cls = Class::Handle(Z, library_.LookupLocalClass(sig));
12893 if (sig_cls.IsNull()) { 12894 if (sig_cls.IsNull()) {
12894 sig_cls = Class::NewSignatureClass(sig, closure, script_, token_pos); 12895 sig_cls = Class::NewSignatureClass(sig, closure, script_, token_pos);
12895 library_.AddClass(sig_cls); 12896 library_.AddClass(sig_cls);
12896 } 12897 }
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
14061 void Parser::SkipQualIdent() { 14062 void Parser::SkipQualIdent() {
14062 ASSERT(IsIdentifier()); 14063 ASSERT(IsIdentifier());
14063 ConsumeToken(); 14064 ConsumeToken();
14064 if (CurrentToken() == Token::kPERIOD) { 14065 if (CurrentToken() == Token::kPERIOD) {
14065 ConsumeToken(); // Consume the kPERIOD token. 14066 ConsumeToken(); // Consume the kPERIOD token.
14066 ExpectIdentifier("identifier expected after '.'"); 14067 ExpectIdentifier("identifier expected after '.'");
14067 } 14068 }
14068 } 14069 }
14069 14070
14070 } // namespace dart 14071 } // 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