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

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

Issue 2692803006: Track the 'awaiter return' call stack use it to detect uncaught exceptions in async functions (Closed)
Patch Set: rmacnak review 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
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/scopes.h" 5 #include "vm/scopes.h"
6 6
7 #include "vm/object.h" 7 #include "vm/object.h"
8 #include "vm/stack_frame.h" 8 #include "vm/stack_frame.h"
9 #include "vm/symbols.h" 9 #include "vm/symbols.h"
10 10
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 } 257 }
258 258
259 259
260 // The parser creates internal variables that start with ":" 260 // The parser creates internal variables that start with ":"
261 static bool IsFilteredIdentifier(const String& str) { 261 static bool IsFilteredIdentifier(const String& str) {
262 ASSERT(str.Length() > 0); 262 ASSERT(str.Length() > 0);
263 if (str.raw() == Symbols::AsyncOperation().raw()) { 263 if (str.raw() == Symbols::AsyncOperation().raw()) {
264 // Keep :async_op for asynchronous debugging. 264 // Keep :async_op for asynchronous debugging.
265 return false; 265 return false;
266 } 266 }
267 if (str.raw() == Symbols::AsyncCompleter().raw()) {
268 // Keep :async_completer for asynchronous debugging.
269 return false;
270 }
271 if (str.raw() == Symbols::ControllerStream().raw()) {
272 // Keep :controller_stream for asynchronous debugging.
273 return false;
274 }
275 if (str.raw() == Symbols::AwaitJumpVar().raw()) {
276 // Keep :await_jump_var for asynchronous debugging.
277 return false;
278 }
267 return str.CharAt(0) == ':'; 279 return str.CharAt(0) == ':';
268 } 280 }
269 281
270 282
271 RawLocalVarDescriptors* LocalScope::GetVarDescriptors(const Function& func) { 283 RawLocalVarDescriptors* LocalScope::GetVarDescriptors(const Function& func) {
272 GrowableArray<VarDesc> vars(8); 284 GrowableArray<VarDesc> vars(8);
273 // First enter all variables from scopes of outer functions. 285 // First enter all variables from scopes of outer functions.
274 const ContextScope& context_scope = 286 const ContextScope& context_scope =
275 ContextScope::Handle(func.context_scope()); 287 ContextScope::Handle(func.context_scope());
276 if (!context_scope.IsNull()) { 288 if (!context_scope.IsNull()) {
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 return fixed_parameter_count - (index() - kParamEndSlotFromFp); 698 return fixed_parameter_count - (index() - kParamEndSlotFromFp);
687 } else { 699 } else {
688 // Shift negative indexes so that the lowest one is 0 (they are still 700 // Shift negative indexes so that the lowest one is 0 (they are still
689 // non-positive). 701 // non-positive).
690 return fixed_parameter_count - (index() - kFirstLocalSlotFromFp); 702 return fixed_parameter_count - (index() - kFirstLocalSlotFromFp);
691 } 703 }
692 } 704 }
693 705
694 706
695 } // namespace dart 707 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698