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

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

Issue 10790086: Minor cleanups: use GrowableArray::is_empty instead of ::length() == 0 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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 | runtime/vm/flow_graph_compiler.h » ('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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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/exceptions.h" 5 #include "vm/exceptions.h"
6 6
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/debugger.h" 8 #include "vm/debugger.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 uword handler_fp = 0; 136 uword handler_fp = 0;
137 GrowableArray<uword> stack_frame_pcs; 137 GrowableArray<uword> stack_frame_pcs;
138 bool handler_exists = FindExceptionHandler(&handler_pc, 138 bool handler_exists = FindExceptionHandler(&handler_pc,
139 &handler_sp, 139 &handler_sp,
140 &handler_fp, 140 &handler_fp,
141 &stack_frame_pcs); 141 &stack_frame_pcs);
142 // TODO(5411263): At some point we can optimize by figuring out if a 142 // TODO(5411263): At some point we can optimize by figuring out if a
143 // stack trace is needed based on whether the catch code specifies a 143 // stack trace is needed based on whether the catch code specifies a
144 // stack trace object or there is a rethrow in the catch clause. 144 // stack trace object or there is a rethrow in the catch clause.
145 Stacktrace& stacktrace = Stacktrace::Handle(); 145 Stacktrace& stacktrace = Stacktrace::Handle();
146 if (stack_frame_pcs.length() > 0) { 146 if (!stack_frame_pcs.is_empty()) {
147 if (existing_stacktrace.IsNull()) { 147 if (existing_stacktrace.IsNull()) {
148 stacktrace = Stacktrace::New(stack_frame_pcs); 148 stacktrace = Stacktrace::New(stack_frame_pcs);
149 } else { 149 } else {
150 stacktrace ^= existing_stacktrace.raw(); 150 stacktrace ^= existing_stacktrace.raw();
151 stacktrace.Append(stack_frame_pcs); 151 stacktrace.Append(stack_frame_pcs);
152 } 152 }
153 } else { 153 } else {
154 stacktrace ^= existing_stacktrace.raw(); 154 stacktrace ^= existing_stacktrace.raw();
155 } 155 }
156 if (FLAG_print_stacktrace_at_throw) { 156 if (FLAG_print_stacktrace_at_throw) {
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 case kIsolateSpawn: 417 case kIsolateSpawn:
418 library = Library::IsolateLibrary(); 418 library = Library::IsolateLibrary();
419 class_name = String::NewSymbol("IsolateSpawnException"); 419 class_name = String::NewSymbol("IsolateSpawnException");
420 break; 420 break;
421 } 421 }
422 422
423 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); 423 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments);
424 } 424 }
425 425
426 } // namespace dart 426 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698