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

Side by Side Diff: runtime/vm/code_descriptors.h

Issue 847613002: Fix issue 21795. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 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 | 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 #ifndef VM_CODE_DESCRIPTORS_H_ 5 #ifndef VM_CODE_DESCRIPTORS_H_
6 #define VM_CODE_DESCRIPTORS_H_ 6 #define VM_CODE_DESCRIPTORS_H_
7 7
8 #include "vm/ast.h" 8 #include "vm/ast.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 const Array& handler_types, 128 const Array& handler_types,
129 bool needs_stacktrace) { 129 bool needs_stacktrace) {
130 ASSERT(try_index >= 0); 130 ASSERT(try_index >= 0);
131 while (Length() <= try_index) { 131 while (Length() <= try_index) {
132 AddPlaceHolder(); 132 AddPlaceHolder();
133 } 133 }
134 list_[try_index].outer_try_index = outer_try_index; 134 list_[try_index].outer_try_index = outer_try_index;
135 list_[try_index].pc_offset = pc_offset; 135 list_[try_index].pc_offset = pc_offset;
136 ASSERT(handler_types.IsZoneHandle()); 136 ASSERT(handler_types.IsZoneHandle());
137 list_[try_index].handler_types = &handler_types; 137 list_[try_index].handler_types = &handler_types;
138 list_[try_index].needs_stacktrace = needs_stacktrace; 138 list_[try_index].needs_stacktrace = needs_stacktrace;
regis 2015/01/10 00:58:16 I rushed to catch my shuttle and I realize now (on
Florian Schneider 2015/01/12 12:47:48 You're right. The flag may be overridden, so AddHa
139 } 139 }
140 140
141 141
142 // Called by rethrows, to mark their enclosing handlers. 142 // Called by rethrows, to mark their enclosing handlers.
143 void SetNeedsStacktrace(intptr_t try_index) { 143 void SetNeedsStacktrace(intptr_t try_index) {
144 // Rethrows can be generated outside a try by the compiler. 144 // Rethrows can be generated outside a try by the compiler.
145 if (try_index == CatchClauseNode::kInvalidTryIndex) { 145 if (try_index == CatchClauseNode::kInvalidTryIndex) {
146 return; 146 return;
147 } 147 }
148 ASSERT((0 <= try_index) && (try_index < Length())); 148 ASSERT(try_index >= 0);
149 while (Length() <= try_index) {
150 AddPlaceHolder();
151 }
149 list_[try_index].needs_stacktrace = true; 152 list_[try_index].needs_stacktrace = true;
150 } 153 }
151 154
152 155
153 static bool ContainsDynamic(const Array& array) { 156 static bool ContainsDynamic(const Array& array) {
154 for (intptr_t i = 0; i < array.Length(); i++) { 157 for (intptr_t i = 0; i < array.Length(); i++) {
155 if (array.At(i) == Type::DynamicType()) { 158 if (array.At(i) == Type::DynamicType()) {
156 return true; 159 return true;
157 } 160 }
158 } 161 }
(...skipping 23 matching lines...) Expand all
182 } 185 }
183 186
184 private: 187 private:
185 GrowableArray<struct HandlerDesc> list_; 188 GrowableArray<struct HandlerDesc> list_;
186 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList); 189 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerList);
187 }; 190 };
188 191
189 } // namespace dart 192 } // namespace dart
190 193
191 #endif // VM_CODE_DESCRIPTORS_H_ 194 #endif // VM_CODE_DESCRIPTORS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698