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

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

Issue 2761933002: Add Genericity enum in VM to distinguish how a type is uninstantiated. (Closed)
Patch Set: sync Created 3 years, 9 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/object.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 #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 12570 matching lines...) Expand 10 before | Expand all | Expand 10 after
12581 } 12581 }
12582 parent = parent.parent_function(); 12582 parent = parent.parent_function();
12583 } 12583 }
12584 return false; 12584 return false;
12585 } 12585 }
12586 12586
12587 12587
12588 bool Parser::InGenericFunctionScope() const { 12588 bool Parser::InGenericFunctionScope() const {
12589 if (!innermost_function().IsNull()) { 12589 if (!innermost_function().IsNull()) {
12590 // With one more free tag bit in Function, we could cache this information. 12590 // With one more free tag bit in Function, we could cache this information.
12591 if (innermost_function().IsGeneric()) { 12591 if (innermost_function().IsGeneric() ||
12592 innermost_function().HasGenericParent()) {
12592 return true; 12593 return true;
12593 } 12594 }
12594 Function& parent = Function::Handle(innermost_function().parent_function());
12595 while (!parent.IsNull()) {
12596 if (parent.IsGeneric()) {
12597 return true;
12598 }
12599 parent = parent.parent_function();
12600 }
12601 } 12595 }
12602 return false; 12596 return false;
12603 } 12597 }
12604 12598
12605 12599
12606 void Parser::InsertCachedConstantValue(const Script& script, 12600 void Parser::InsertCachedConstantValue(const Script& script,
12607 TokenPosition token_pos, 12601 TokenPosition token_pos,
12608 const Instance& value) { 12602 const Instance& value) {
12609 ASSERT(Thread::Current()->IsMutatorThread()); 12603 ASSERT(Thread::Current()->IsMutatorThread());
12610 const intptr_t kInitialConstMapSize = 16; 12604 const intptr_t kInitialConstMapSize = 16;
(...skipping 2592 matching lines...) Expand 10 before | Expand all | Expand 10 after
15203 const ArgumentListNode& function_args, 15197 const ArgumentListNode& function_args,
15204 const LocalVariable* temp_for_last_arg, 15198 const LocalVariable* temp_for_last_arg,
15205 bool is_super_invocation) { 15199 bool is_super_invocation) {
15206 UNREACHABLE(); 15200 UNREACHABLE();
15207 return NULL; 15201 return NULL;
15208 } 15202 }
15209 15203
15210 } // namespace dart 15204 } // namespace dart
15211 15205
15212 #endif // DART_PRECOMPILED_RUNTIME 15206 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698