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

Unified Diff: runtime/vm/object.cc

Issue 1569213003: Eliminate phase parameter in constructors (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 85fdf7e4e2085c84d2dc8658a014b5614b83d281..8e3284f3020ddb2e84329e0df43cb0984cd0afb6 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -5872,13 +5872,8 @@ intptr_t Function::NumParameters() const {
intptr_t Function::NumImplicitParameters() const {
if (kind() == RawFunction::kConstructor) {
- if (is_static()) {
- ASSERT(IsFactory());
- return 1; // Type arguments.
- } else {
- ASSERT(IsGenerativeConstructor());
- return 2; // Instance, phase.
- }
+ // Type arguments for factory; instance for generative constructor.
+ return 1;
}
if ((kind() == RawFunction::kClosureFunction) ||
(kind() == RawFunction::kSignatureFunction)) {
@@ -6257,10 +6252,7 @@ bool Function::TypeTest(TypeTestKind test_kind,
const intptr_t other_num_opt_named_params =
other.NumOptionalNamedParameters();
// This function requires the same arguments or less and accepts the same
- // arguments or more.
- // A generative constructor may be compared to a redirecting factory and be
- // compatible although it has an additional phase parameter.
- // More generally, we can ignore implicit parameters.
+ // arguments or more. We can ignore implicit parameters.
const intptr_t num_ignored_params = NumImplicitParameters();
const intptr_t other_num_ignored_params = other.NumImplicitParameters();
if (((num_fixed_params - num_ignored_params) >
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698