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

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

Issue 565643002: Refactor emitting of deoptimization descriptors for calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 3 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/intermediate_language.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) 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/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/cha.h" 10 #include "vm/cha.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 274 }
275 275
276 ASSERT(block_order()[0]->IsGraphEntry()); 276 ASSERT(block_order()[0]->IsGraphEntry());
277 BlockInfo* block_info = block_info_[block_order()[0]->postorder_number()]; 277 BlockInfo* block_info = block_info_[block_order()[0]->postorder_number()];
278 block_info->set_next_nonempty_label(nonempty_label); 278 block_info->set_next_nonempty_label(nonempty_label);
279 } 279 }
280 280
281 281
282 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) { 282 void FlowGraphCompiler::EmitInstructionPrologue(Instruction* instr) {
283 if (!is_optimizing()) { 283 if (!is_optimizing()) {
284 if (FLAG_enable_type_checks && instr->IsAssertAssignable()) { 284 if (instr->CanBecomeDeoptimizationTarget() && !instr->IsGoto()) {
285 AssertAssignableInstr* assert = instr->AsAssertAssignable();
286 AddCurrentDescriptor(RawPcDescriptors::kDeopt,
287 assert->deopt_id(),
288 assert->token_pos());
289 } else if (instr->CanBecomeDeoptimizationTarget() && !instr->IsGoto()) {
290 // Instructions that can be deoptimization targets need to record kDeopt 285 // Instructions that can be deoptimization targets need to record kDeopt
291 // PcDescriptor corresponding to their deopt id. GotoInstr records its 286 // PcDescriptor corresponding to their deopt id. GotoInstr records its
292 // own so that it can control the placement. 287 // own so that it can control the placement.
293 AddCurrentDescriptor(RawPcDescriptors::kDeopt, 288 AddCurrentDescriptor(RawPcDescriptors::kDeopt,
294 instr->deopt_id(), 289 instr->deopt_id(),
295 Scanner::kNoSourcePos); 290 Scanner::kNoSourcePos);
296 } 291 }
297 AllocateRegistersLocally(instr); 292 AllocateRegistersLocally(instr);
298 } else if (instr->MayThrow() && 293 } else if (instr->MayThrow() &&
299 (CurrentTryIndex() != CatchClauseNode::kInvalidTryIndex)) { 294 (CurrentTryIndex() != CatchClauseNode::kInvalidTryIndex)) {
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 threshold = FLAG_optimization_counter_scale * basic_blocks + 1470 threshold = FLAG_optimization_counter_scale * basic_blocks +
1476 FLAG_min_optimization_counter_threshold; 1471 FLAG_min_optimization_counter_threshold;
1477 if (threshold > FLAG_optimization_counter_threshold) { 1472 if (threshold > FLAG_optimization_counter_threshold) {
1478 threshold = FLAG_optimization_counter_threshold; 1473 threshold = FLAG_optimization_counter_threshold;
1479 } 1474 }
1480 } 1475 }
1481 return threshold; 1476 return threshold;
1482 } 1477 }
1483 1478
1484 } // namespace dart 1479 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698