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

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

Issue 3003253002: [vm, aot] Ensure fixups applied after the world has been compiled are applied to closures in finall… (Closed)
Patch Set: Created 3 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 | « no previous file | runtime/vm/runtime_entry.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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/precompiler.h" 5 #include "vm/precompiler.h"
6 6
7 #include "vm/aot_optimizer.h" 7 #include "vm/aot_optimizer.h"
8 #include "vm/assembler.h" 8 #include "vm/assembler.h"
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/branch_optimizer.h" 10 #include "vm/branch_optimizer.h"
(...skipping 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2179 2179
2180 private: 2180 private:
2181 Code& code_; 2181 Code& code_;
2182 Array& table_; 2182 Array& table_;
2183 Smi& pc_offset_; 2183 Smi& pc_offset_;
2184 Function& target_; 2184 Function& target_;
2185 Code& target_code_; 2185 Code& target_code_;
2186 }; 2186 };
2187 2187
2188 BindStaticCallsVisitor visitor(Z); 2188 BindStaticCallsVisitor visitor(Z);
2189
2190 // This visit misses functions compiled outside of the treeshaker's
2191 // queue.
2192 FunctionSet::Iterator it(enqueued_functions_.GetIterator());
2193 for (const Function** current = it.Next(); current != NULL;
2194 current = it.Next()) {
2195 visitor.Visit(**current);
2196 }
2197
2198 // This visit misses closures from duplicated finally clauses.
siva 2017/08/23 20:11:37 Maybe the comment should be more clear , stating t
rmacnak 2017/08/23 23:25:58 Yes, I like that better.
2189 ProgramVisitor::VisitFunctions(&visitor); 2199 ProgramVisitor::VisitFunctions(&visitor);
2190 } 2200 }
2191 2201
2192 void Precompiler::SwitchICCalls() { 2202 void Precompiler::SwitchICCalls() {
2193 #if !defined(TARGET_ARCH_DBC) 2203 #if !defined(TARGET_ARCH_DBC)
2194 // Now that all functions have been compiled, we can switch to an instance 2204 // Now that all functions have been compiled, we can switch to an instance
2195 // call sequence that loads the Code object and entry point directly from 2205 // call sequence that loads the Code object and entry point directly from
2196 // the ic data array instead indirectly through a Function in the ic data 2206 // the ic data array instead indirectly through a Function in the ic data
2197 // array. Iterate all the object pools and rewrite the ic data from 2207 // array. Iterate all the object pools and rewrite the ic data from
2198 // (cid, target function, count) to (cid, target code, entry point), and 2208 // (cid, target function, count) to (cid, target code, entry point), and
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
2267 ICData& ic_; 2277 ICData& ic_;
2268 String& target_name_; 2278 String& target_name_;
2269 Array& args_descriptor_; 2279 Array& args_descriptor_;
2270 UnlinkedCall& unlinked_; 2280 UnlinkedCall& unlinked_;
2271 Code& target_code_; 2281 Code& target_code_;
2272 UnlinkedCallSet canonical_unlinked_calls_; 2282 UnlinkedCallSet canonical_unlinked_calls_;
2273 }; 2283 };
2274 2284
2275 ASSERT(!I->compilation_allowed()); 2285 ASSERT(!I->compilation_allowed());
2276 SwitchICCallsVisitor visitor(Z); 2286 SwitchICCallsVisitor visitor(Z);
2287
2288 // This visit misses functions compiled outside of the treeshaker's
2289 // queue.
2290 FunctionSet::Iterator it(enqueued_functions_.GetIterator());
2291 for (const Function** current = it.Next(); current != NULL;
2292 current = it.Next()) {
2293 visitor.Visit(**current);
2294 }
2295
2296 // This visit misses closures from duplicated finally clauses.
siva 2017/08/23 20:11:37 Ditto comment here.
2277 ProgramVisitor::VisitFunctions(&visitor); 2297 ProgramVisitor::VisitFunctions(&visitor);
2278 #endif 2298 #endif
2279 } 2299 }
2280 2300
2281 void Precompiler::FinalizeAllClasses() { 2301 void Precompiler::FinalizeAllClasses() {
2282 Library& lib = Library::Handle(Z); 2302 Library& lib = Library::Handle(Z);
2283 Class& cls = Class::Handle(Z); 2303 Class& cls = Class::Handle(Z);
2284 2304
2285 for (intptr_t i = 0; i < libraries_.Length(); i++) { 2305 for (intptr_t i = 0; i < libraries_.Length(); i++) {
2286 lib ^= libraries_.At(i); 2306 lib ^= libraries_.At(i);
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
3322 3342
3323 ASSERT(FLAG_precompiled_mode); 3343 ASSERT(FLAG_precompiled_mode);
3324 const bool optimized = function.IsOptimizable(); // False for natives. 3344 const bool optimized = function.IsOptimizable(); // False for natives.
3325 DartPrecompilationPipeline pipeline(zone, field_type_map); 3345 DartPrecompilationPipeline pipeline(zone, field_type_map);
3326 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); 3346 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized);
3327 } 3347 }
3328 3348
3329 #endif // DART_PRECOMPILER 3349 #endif // DART_PRECOMPILER
3330 3350
3331 } // namespace dart 3351 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/runtime_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698