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

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

Issue 10825236: Replace deopt stubs location/register shuffling with using deopt-info. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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') | runtime/vm/flow_graph_compiler_ia32.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/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/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/debugger.h" 10 #include "vm/debugger.h"
(...skipping 13 matching lines...) Expand all
24 DEFINE_FLAG(bool, trace_functions, false, "Trace entry of each function."); 24 DEFINE_FLAG(bool, trace_functions, false, "Trace entry of each function.");
25 DECLARE_FLAG(bool, code_comments); 25 DECLARE_FLAG(bool, code_comments);
26 DECLARE_FLAG(bool, enable_type_checks); 26 DECLARE_FLAG(bool, enable_type_checks);
27 DECLARE_FLAG(bool, intrinsify); 27 DECLARE_FLAG(bool, intrinsify);
28 DECLARE_FLAG(bool, report_usage_count); 28 DECLARE_FLAG(bool, report_usage_count);
29 DECLARE_FLAG(bool, trace_functions); 29 DECLARE_FLAG(bool, trace_functions);
30 DECLARE_FLAG(int, optimization_counter_threshold); 30 DECLARE_FLAG(int, optimization_counter_threshold);
31 31
32 RawDeoptInfo* DeoptimizationStub::CreateDeoptInfo(FlowGraphCompiler* compiler) { 32 RawDeoptInfo* DeoptimizationStub::CreateDeoptInfo(FlowGraphCompiler* compiler) {
33 if (deoptimization_env_ == NULL) return DeoptInfo::null(); 33 if (deoptimization_env_ == NULL) return DeoptInfo::null();
34 const Function& function = compiler->parsed_function().function();
35 // For functions with optional arguments, all incoming are copied to local
36 // area below FP, deoptimization environment does not track them.
37 const intptr_t num_args = (function.num_optional_parameters() > 0) ?
38 0 : function.num_fixed_parameters();
34 const intptr_t fixed_parameter_count = 39 const intptr_t fixed_parameter_count =
35 deoptimization_env_->fixed_parameter_count(); 40 deoptimization_env_->fixed_parameter_count();
36 DeoptInfoBuilder builder(compiler->object_table(), fixed_parameter_count); 41 DeoptInfoBuilder builder(compiler->object_table(), num_args);
37 42
38 const Function& function = compiler->parsed_function().function();
39 intptr_t slot_ix = 0; 43 intptr_t slot_ix = 0;
40 builder.AddReturnAddress(function, deopt_id_, slot_ix++); 44 builder.AddReturnAddress(function, deopt_id_, slot_ix++);
41 45
42 // All locals between TOS and PC-marker. 46 // All locals between TOS and PC-marker.
43 const GrowableArray<Value*>& values = deoptimization_env_->values(); 47 const GrowableArray<Value*>& values = deoptimization_env_->values();
44 // const intptr_t local_slot_count = values.length() - fixed_parameter_count; 48 // const intptr_t local_slot_count = values.length() - fixed_parameter_count;
45 for (intptr_t i = values.length() - 1; i >= fixed_parameter_count; i--) { 49 for (intptr_t i = values.length() - 1; i >= fixed_parameter_count; i--) {
46 builder.AddCopy(deoptimization_env_->LocationAt(i), *values[i], slot_ix++); 50 builder.AddCopy(deoptimization_env_->LocationAt(i), *values[i], slot_ix++);
47 } 51 }
48 52
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 return; 855 return;
852 } 856 }
853 } 857 }
854 858
855 // This move is not blocked. 859 // This move is not blocked.
856 EmitMove(index); 860 EmitMove(index);
857 } 861 }
858 862
859 863
860 } // namespace dart 864 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/deopt_instructions.cc ('k') | runtime/vm/flow_graph_compiler_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698