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

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

Issue 2989493002: Simplify and fix implicit closure check, speed up Closure_equals (Closed)
Patch Set: Avoid overloaded NewClosureFunction Created 3 years, 5 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
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 #include "vm/flags.h" 6 #include "vm/flags.h"
7 7
8 #ifndef DART_PRECOMPILED_RUNTIME 8 #ifndef DART_PRECOMPILED_RUNTIME
9 9
10 #include "lib/invocation_mirror.h" 10 #include "lib/invocation_mirror.h"
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 const Script& script = Script::Handle(zone, func.script()); 1082 const Script& script = Script::Handle(zone, func.script());
1083 Parser parser(script, parsed_function, func.token_pos()); 1083 Parser parser(script, parsed_function, func.token_pos());
1084 #ifndef PRODUCT 1084 #ifndef PRODUCT
1085 if (tds.enabled()) { 1085 if (tds.enabled()) {
1086 tds.SetNumArguments(1); 1086 tds.SetNumArguments(1);
1087 tds.CopyArgument(0, "function", String::Handle(func.name()).ToCString()); 1087 tds.CopyArgument(0, "function", String::Handle(func.name()).ToCString());
1088 } 1088 }
1089 #endif // !PRODUCT 1089 #endif // !PRODUCT
1090 SequenceNode* node_sequence = NULL; 1090 SequenceNode* node_sequence = NULL;
1091 switch (func.kind()) { 1091 switch (func.kind()) {
1092 case RawFunction::kImplicitClosureFunction:
1093 node_sequence = parser.ParseImplicitClosure(func);
1094 break;
1092 case RawFunction::kClosureFunction: 1095 case RawFunction::kClosureFunction:
1093 if (func.IsImplicitClosureFunction()) {
1094 node_sequence = parser.ParseImplicitClosure(func);
1095 break;
1096 }
1097 if (func.IsConstructorClosureFunction()) { 1096 if (func.IsConstructorClosureFunction()) {
1098 node_sequence = parser.ParseConstructorClosure(func); 1097 node_sequence = parser.ParseConstructorClosure(func);
1099 break; 1098 break;
1100 } 1099 }
1101 // Fall-through: Handle non-implicit closures. 1100 // Fall-through: Handle non-implicit closures.
1102 case RawFunction::kRegularFunction: 1101 case RawFunction::kRegularFunction:
1103 case RawFunction::kGetterFunction: 1102 case RawFunction::kGetterFunction:
1104 case RawFunction::kSetterFunction: 1103 case RawFunction::kSetterFunction:
1105 case RawFunction::kConstructor: 1104 case RawFunction::kConstructor:
1106 // The call to a redirecting factory is redirected. 1105 // The call to a redirecting factory is redirected.
(...skipping 13994 matching lines...) Expand 10 before | Expand all | Expand 10 after
15101 bool Parser::FieldHasFunctionLiteralInitializer(const Field& field, 15100 bool Parser::FieldHasFunctionLiteralInitializer(const Field& field,
15102 TokenPosition* start, 15101 TokenPosition* start,
15103 TokenPosition* end) { 15102 TokenPosition* end) {
15104 UNREACHABLE(); 15103 UNREACHABLE();
15105 return false; 15104 return false;
15106 } 15105 }
15107 15106
15108 } // namespace dart 15107 } // namespace dart
15109 15108
15110 #endif // DART_PRECOMPILED_RUNTIME 15109 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW
« runtime/lib/function.cc ('K') | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698