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

Side by Side Diff: lib/compiler/implementation/compiler.dart

Issue 10583033: Treat stack overflows specially when reporting unhandled exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Mark crashing tests. Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | 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 5
6 /** 6 /**
7 * If true, print a warning for each method that was resolved, but not 7 * If true, print a warning for each method that was resolved, but not
8 * compiled. 8 * compiled.
9 */ 9 */
10 final bool REPORT_EXCESS_RESOLUTION = false; 10 final bool REPORT_EXCESS_RESOLUTION = false;
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 ClassElement jsIndexingBehaviorInterface; 145 ClassElement jsIndexingBehaviorInterface;
146 146
147 Element get currentElement() => _currentElement; 147 Element get currentElement() => _currentElement;
148 withCurrentElement(Element element, f()) { 148 withCurrentElement(Element element, f()) {
149 Element old = currentElement; 149 Element old = currentElement;
150 _currentElement = element; 150 _currentElement = element;
151 try { 151 try {
152 return f(); 152 return f();
153 } catch (CompilerCancelledException ex) { 153 } catch (CompilerCancelledException ex) {
154 throw; 154 throw;
155 } catch (StackOverflowException ex) {
156 // We cannot report anything useful in this case, because we
157 // do not have enough stack space.
158 throw;
155 } catch (var ex) { 159 } catch (var ex) {
156 unhandledExceptionOnElement(element); 160 unhandledExceptionOnElement(element);
157 throw; 161 throw;
158 } finally { 162 } finally {
159 _currentElement = old; 163 _currentElement = old;
160 } 164 }
161 } 165 }
162 166
163 List<CompilerTask> tasks; 167 List<CompilerTask> tasks;
164 ScannerTask scanner; 168 ScannerTask scanner;
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 // invariant that endOffset > beginOffset, but for EOF the 768 // invariant that endOffset > beginOffset, but for EOF the
765 // charoffset of the next token may be [beginOffset]. This can 769 // charoffset of the next token may be [beginOffset]. This can
766 // also happen for synthetized tokens that are produced during 770 // also happen for synthetized tokens that are produced during
767 // error handling. 771 // error handling.
768 final endOffset = 772 final endOffset =
769 Math.max((end.next !== null) ? end.next.charOffset : 0, beginOffset + 1); 773 Math.max((end.next !== null) ? end.next.charOffset : 0, beginOffset + 1);
770 assert(endOffset > beginOffset); 774 assert(endOffset > beginOffset);
771 return f(beginOffset, endOffset); 775 return f(beginOffset, endOffset);
772 } 776 }
773 } 777 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-leg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698