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

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

Issue 1682173008: ‘Yield* e' should not access e.current eagerly (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 9777 matching lines...) Expand 10 before | Expand all | Expand 10 after
9788 9788
9789 LocalVariable* iterator_param = 9789 LocalVariable* iterator_param =
9790 LookupLocalScope(Symbols::IteratorParameter()); 9790 LookupLocalScope(Symbols::IteratorParameter());
9791 ASSERT(iterator_param != NULL); 9791 ASSERT(iterator_param != NULL);
9792 // Generate :iterator.current = expr; 9792 // Generate :iterator.current = expr;
9793 AstNode* iterator = 9793 AstNode* iterator =
9794 new(Z) LoadLocalNode(TokenPosition::kNoSource, iterator_param); 9794 new(Z) LoadLocalNode(TokenPosition::kNoSource, iterator_param);
9795 AstNode* store_current = 9795 AstNode* store_current =
9796 new(Z) InstanceSetterNode(TokenPosition::kNoSource, 9796 new(Z) InstanceSetterNode(TokenPosition::kNoSource,
9797 iterator, 9797 iterator,
9798 String::ZoneHandle(Symbols::Current().raw()), 9798 Library::PrivateCoreLibName(
9799 Symbols::_current()),
9799 expr); 9800 expr);
9800 yield->AddNode(store_current); 9801 yield->AddNode(store_current);
9801 if (is_yield_each) { 9802 if (is_yield_each) {
9802 // Generate :iterator.isYieldEach = true; 9803 // Generate :iterator.isYieldEach = true;
9803 AstNode* set_is_yield_each = 9804 AstNode* set_is_yield_each =
9804 new(Z) InstanceSetterNode(TokenPosition::kNoSource, 9805 new(Z) InstanceSetterNode(TokenPosition::kNoSource,
9805 iterator, 9806 iterator,
9806 String::ZoneHandle(Symbols::IsYieldEach().raw()), 9807 String::ZoneHandle(Symbols::IsYieldEach().raw()),
9807 new(Z) LiteralNode(TokenPos(), Bool::True())); 9808 new(Z) LiteralNode(TokenPos(), Bool::True()));
9808 yield->AddNode(set_is_yield_each); 9809 yield->AddNode(set_is_yield_each);
(...skipping 4598 matching lines...) Expand 10 before | Expand all | Expand 10 after
14407 const ArgumentListNode& function_args, 14408 const ArgumentListNode& function_args,
14408 const LocalVariable* temp_for_last_arg, 14409 const LocalVariable* temp_for_last_arg,
14409 bool is_super_invocation) { 14410 bool is_super_invocation) {
14410 UNREACHABLE(); 14411 UNREACHABLE();
14411 return NULL; 14412 return NULL;
14412 } 14413 }
14413 14414
14414 } // namespace dart 14415 } // namespace dart
14415 14416
14416 #endif // DART_PRECOMPILED_RUNTIME 14417 #endif // DART_PRECOMPILED_RUNTIME
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698