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

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

Issue 1314143002: VM: Don't depend on unoptimized code when inlining and creating deoptimization info. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 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
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/flow_graph_compiler_arm64.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) 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_ARM. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
6 #if defined(TARGET_ARCH_ARM) 6 #if defined(TARGET_ARCH_ARM)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "vm/ast_printer.h" 10 #include "vm/ast_printer.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // Emit all kMaterializeObject instructions describing objects to be 94 // Emit all kMaterializeObject instructions describing objects to be
95 // materialized on the deoptimization as a prefix to the deoptimization info. 95 // materialized on the deoptimization as a prefix to the deoptimization info.
96 EmitMaterializations(deopt_env_, builder); 96 EmitMaterializations(deopt_env_, builder);
97 97
98 // The real frame starts here. 98 // The real frame starts here.
99 builder->MarkFrameStart(); 99 builder->MarkFrameStart();
100 100
101 Zone* zone = compiler->zone(); 101 Zone* zone = compiler->zone();
102 102
103 // Current PP, FP, and PC. 103 // Current PP, FP, and PC.
104 builder->AddPp(Function::Handle(zone, current->code().function()), slot_ix++); 104 builder->AddPp(current->function(), slot_ix++);
105 builder->AddCallerFp(slot_ix++); 105 builder->AddCallerFp(slot_ix++);
106 builder->AddReturnAddress(Function::Handle(zone, current->code().function()), 106 builder->AddReturnAddress(current->function(), deopt_id(), slot_ix++);
107 deopt_id(),
108 slot_ix++);
109 107
110 // Callee's PC marker is not used anymore. Pass Function::null() to set to 0. 108 // Callee's PC marker is not used anymore. Pass Function::null() to set to 0.
111 builder->AddPcMarker(Function::Handle(zone), slot_ix++); 109 builder->AddPcMarker(Function::Handle(zone), slot_ix++);
112 110
113 // Emit all values that are needed for materialization as a part of the 111 // Emit all values that are needed for materialization as a part of the
114 // expression stack for the bottom-most frame. This guarantees that GC 112 // expression stack for the bottom-most frame. This guarantees that GC
115 // will be able to find them during materialization. 113 // will be able to find them during materialization.
116 slot_ix = builder->EmitMaterializationArguments(slot_ix); 114 slot_ix = builder->EmitMaterializationArguments(slot_ix);
117 115
118 // For the innermost environment, set outgoing arguments and the locals. 116 // For the innermost environment, set outgoing arguments and the locals.
119 for (intptr_t i = current->Length() - 1; 117 for (intptr_t i = current->Length() - 1;
120 i >= current->fixed_parameter_count(); 118 i >= current->fixed_parameter_count();
121 i--) { 119 i--) {
122 builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++); 120 builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
123 } 121 }
124 122
125 Environment* previous = current; 123 Environment* previous = current;
126 current = current->outer(); 124 current = current->outer();
127 while (current != NULL) { 125 while (current != NULL) {
128 // PP, FP, and PC. 126 // PP, FP, and PC.
129 builder->AddPp( 127 builder->AddPp(current->function(), slot_ix++);
130 Function::Handle(zone, current->code().function()), slot_ix++);
131 builder->AddCallerFp(slot_ix++); 128 builder->AddCallerFp(slot_ix++);
132 129
133 // For any outer environment the deopt id is that of the call instruction 130 // For any outer environment the deopt id is that of the call instruction
134 // which is recorded in the outer environment. 131 // which is recorded in the outer environment.
135 builder->AddReturnAddress( 132 builder->AddReturnAddress(
136 Function::Handle(zone, current->code().function()), 133 current->function(),
137 Isolate::ToDeoptAfter(current->deopt_id()), 134 Isolate::ToDeoptAfter(current->deopt_id()),
138 slot_ix++); 135 slot_ix++);
139 136
140 // PC marker. 137 // PC marker.
141 builder->AddPcMarker(Function::Handle(zone, previous->code().function()), 138 builder->AddPcMarker(previous->function(), slot_ix++);
142 slot_ix++);
143 139
144 // The values of outgoing arguments can be changed from the inlined call so 140 // The values of outgoing arguments can be changed from the inlined call so
145 // we must read them from the previous environment. 141 // we must read them from the previous environment.
146 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { 142 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
147 builder->AddCopy(previous->ValueAt(i), 143 builder->AddCopy(previous->ValueAt(i),
148 previous->LocationAt(i), 144 previous->LocationAt(i),
149 slot_ix++); 145 slot_ix++);
150 } 146 }
151 147
152 // Set the locals, note that outgoing arguments are not in the environment. 148 // Set the locals, note that outgoing arguments are not in the environment.
(...skipping 11 matching lines...) Expand all
164 } 160 }
165 // The previous pointer is now the outermost environment. 161 // The previous pointer is now the outermost environment.
166 ASSERT(previous != NULL); 162 ASSERT(previous != NULL);
167 163
168 // For the outermost environment, set caller PC, caller PP, and caller FP. 164 // For the outermost environment, set caller PC, caller PP, and caller FP.
169 builder->AddCallerPp(slot_ix++); 165 builder->AddCallerPp(slot_ix++);
170 builder->AddCallerFp(slot_ix++); 166 builder->AddCallerFp(slot_ix++);
171 builder->AddCallerPc(slot_ix++); 167 builder->AddCallerPc(slot_ix++);
172 168
173 // PC marker. 169 // PC marker.
174 builder->AddPcMarker(Function::Handle(zone, previous->code().function()), 170 builder->AddPcMarker(previous->function(), slot_ix++);
175 slot_ix++);
176 171
177 // For the outermost environment, set the incoming arguments. 172 // For the outermost environment, set the incoming arguments.
178 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) { 173 for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
179 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++); 174 builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++);
180 } 175 }
181 176
182 return builder->CreateDeoptInfo(deopt_table); 177 return builder->CreateDeoptInfo(deopt_table);
183 } 178 }
184 179
185 180
(...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 DRegister dreg = EvenDRegisterOf(reg); 1897 DRegister dreg = EvenDRegisterOf(reg);
1903 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); 1898 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex));
1904 } 1899 }
1905 1900
1906 1901
1907 #undef __ 1902 #undef __
1908 1903
1909 } // namespace dart 1904 } // namespace dart
1910 1905
1911 #endif // defined TARGET_ARCH_ARM 1906 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler.cc ('k') | runtime/vm/flow_graph_compiler_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698