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

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

Issue 1753053003: When a catch is unreachable, use the canonical empty array instead of null as its type array. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('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 #include "vm/code_descriptors.h" 5 #include "vm/code_descriptors.h"
6 6
7 namespace dart { 7 namespace dart {
8 8
9 void DescriptorList::AddDescriptor(RawPcDescriptors::Kind kind, 9 void DescriptorList::AddDescriptor(RawPcDescriptors::Kind kind,
10 intptr_t pc_offset, 10 intptr_t pc_offset,
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Initialize it to some meaningful value. 117 // Initialize it to some meaningful value.
118 const bool has_catch_all = false; 118 const bool has_catch_all = false;
119 // Check it is uninitialized. 119 // Check it is uninitialized.
120 ASSERT((list_[i].outer_try_index == -1) && 120 ASSERT((list_[i].outer_try_index == -1) &&
121 (list_[i].pc_offset == ExceptionHandlers::kInvalidPcOffset)); 121 (list_[i].pc_offset == ExceptionHandlers::kInvalidPcOffset));
122 handlers.SetHandlerInfo(i, 122 handlers.SetHandlerInfo(i,
123 list_[i].outer_try_index, 123 list_[i].outer_try_index,
124 list_[i].pc_offset, 124 list_[i].pc_offset,
125 list_[i].needs_stacktrace, 125 list_[i].needs_stacktrace,
126 has_catch_all); 126 has_catch_all);
127 handlers.SetHandledTypes(i, Array::null_array()); 127 handlers.SetHandledTypes(i, Array::empty_array());
128 } else { 128 } else {
129 const bool has_catch_all = ContainsDynamic(*list_[i].handler_types); 129 const bool has_catch_all = ContainsDynamic(*list_[i].handler_types);
130 handlers.SetHandlerInfo(i, 130 handlers.SetHandlerInfo(i,
131 list_[i].outer_try_index, 131 list_[i].outer_try_index,
132 list_[i].pc_offset, 132 list_[i].pc_offset,
133 list_[i].needs_stacktrace, 133 list_[i].needs_stacktrace,
134 has_catch_all); 134 has_catch_all);
135 handlers.SetHandledTypes(i, *list_[i].handler_types); 135 handlers.SetHandledTypes(i, *list_[i].handler_types);
136 } 136 }
137 } 137 }
138 return handlers.raw(); 138 return handlers.raw();
139 } 139 }
140 140
141 141
142 } // namespace dart 142 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698