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

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

Issue 23190029: Cleanup of deoptimization environment copying functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments. Created 7 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/flow_graph_type_propagator.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/flow_graph_builder.h" 5 #include "vm/flow_graph_builder.h"
6 6
7 #include "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "vm/ast_printer.h" 8 #include "vm/ast_printer.h"
9 #include "vm/bit_vector.h" 9 #include "vm/bit_vector.h"
10 #include "vm/code_descriptors.h" 10 #include "vm/code_descriptors.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 ASSERT(callee_graph->max_block_id() > caller_graph_->max_block_id()); 74 ASSERT(callee_graph->max_block_id() > caller_graph_->max_block_id());
75 ASSERT(callee_graph->max_virtual_register_number() > 75 ASSERT(callee_graph->max_virtual_register_number() >
76 caller_graph_->max_virtual_register_number()); 76 caller_graph_->max_virtual_register_number());
77 77
78 // Adjust the caller's maximum block id and current SSA temp index. 78 // Adjust the caller's maximum block id and current SSA temp index.
79 caller_graph_->set_max_block_id(callee_graph->max_block_id()); 79 caller_graph_->set_max_block_id(callee_graph->max_block_id());
80 caller_graph_->set_current_ssa_temp_index( 80 caller_graph_->set_current_ssa_temp_index(
81 callee_graph->max_virtual_register_number()); 81 callee_graph->max_virtual_register_number());
82 82
83 // Attach the outer environment on each instruction in the callee graph. 83 // Attach the outer environment on each instruction in the callee graph.
84 ASSERT(call_->env() != NULL);
84 for (BlockIterator block_it = callee_graph->postorder_iterator(); 85 for (BlockIterator block_it = callee_graph->postorder_iterator();
85 !block_it.Done(); 86 !block_it.Done();
86 block_it.Advance()) { 87 block_it.Advance()) {
87 for (ForwardInstructionIterator it(block_it.Current()); 88 for (ForwardInstructionIterator it(block_it.Current());
88 !it.Done(); 89 !it.Done();
89 it.Advance()) { 90 it.Advance()) {
90 Instruction* instr = it.Current(); 91 Instruction* instr = it.Current();
91 // TODO(zerny): Avoid creating unnecessary environments. Note that some 92 // TODO(zerny): Avoid creating unnecessary environments. Note that some
92 // optimizations need deoptimization info for non-deoptable instructions, 93 // optimizations need deoptimization info for non-deoptable instructions,
93 // eg, LICM on GOTOs. 94 // eg, LICM on GOTOs.
(...skipping 3649 matching lines...) Expand 10 before | Expand all | Expand 10 after
3743 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1; 3744 intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name, reason) + 1;
3744 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len); 3745 char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
3745 OS::SNPrint(chars, len, kFormat, function_name, reason); 3746 OS::SNPrint(chars, len, kFormat, function_name, reason);
3746 const Error& error = Error::Handle( 3747 const Error& error = Error::Handle(
3747 LanguageError::New(String::Handle(String::New(chars)))); 3748 LanguageError::New(String::Handle(String::New(chars))));
3748 Isolate::Current()->long_jump_base()->Jump(1, error); 3749 Isolate::Current()->long_jump_base()->Jump(1, error);
3749 } 3750 }
3750 3751
3751 3752
3752 } // namespace dart 3753 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698