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

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

Issue 12812026: Fix crash caused by eliminating goto-s in unoptimized code. Added asserts (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/deopt_instructions.cc ('k') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/globals.h" // Needed here to get TARGET_ARCH_XXX. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX.
6 6
7 #include "vm/flow_graph_compiler.h" 7 #include "vm/flow_graph_compiler.h"
8 8
9 #include "vm/cha.h" 9 #include "vm/cha.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 block_info->set_jump_label(GetJumpLabel(target)); 229 block_info->set_jump_label(GetJumpLabel(target));
230 } 230 }
231 } 231 }
232 232
233 233
234 void FlowGraphCompiler::CompactBlocks() { 234 void FlowGraphCompiler::CompactBlocks() {
235 Label* fallthrough_label = NULL; 235 Label* fallthrough_label = NULL;
236 for (intptr_t i = block_order().length() - 1; i >= 1; --i) { 236 for (intptr_t i = block_order().length() - 1; i >= 1; --i) {
237 BlockEntryInstr* block = block_order()[i]; 237 BlockEntryInstr* block = block_order()[i];
238 238
239 CompactBlock(block); 239 // Unoptimized code must emit all possible deoptimization points.
240 if (is_optimizing()) {
241 CompactBlock(block);
242 }
240 243
241 if (!WasCompacted(block)) { 244 if (!WasCompacted(block)) {
242 BlockInfo* block_info = block_info_[block->postorder_number()]; 245 BlockInfo* block_info = block_info_[block->postorder_number()];
243 block_info->set_fallthrough_label(fallthrough_label); 246 block_info->set_fallthrough_label(fallthrough_label);
244 fallthrough_label = GetJumpLabel(block); 247 fallthrough_label = GetJumpLabel(block);
245 } 248 }
246 } 249 }
247 250
248 ASSERT(block_order()[0]->IsGraphEntry()); 251 ASSERT(block_order()[0]->IsGraphEntry());
249 BlockInfo* block_info = block_info_[block_order()[0]->postorder_number()]; 252 BlockInfo* block_info = block_info_[block_order()[0]->postorder_number()];
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 if (i != largest_ix) { 1081 if (i != largest_ix) {
1079 // Swap. 1082 // Swap.
1080 CidTarget temp = (*sorted)[i]; 1083 CidTarget temp = (*sorted)[i];
1081 (*sorted)[i] = (*sorted)[largest_ix]; 1084 (*sorted)[i] = (*sorted)[largest_ix];
1082 (*sorted)[largest_ix] = temp; 1085 (*sorted)[largest_ix] = temp;
1083 } 1086 }
1084 } 1087 }
1085 } 1088 }
1086 1089
1087 } // namespace dart 1090 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/deopt_instructions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698