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

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

Issue 177733002: Revert r32930 (Add more timing information in the VM to track time...) (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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/code_descriptors_test.cc ('k') | runtime/vm/compiler_test.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/compiler.h" 5 #include "vm/compiler.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 8
9 #include "vm/ast_printer.h" 9 #include "vm/ast_printer.h"
10 #include "vm/block_scheduler.h" 10 #include "vm/block_scheduler.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 251
252 // Return false if bailed out. 252 // Return false if bailed out.
253 static bool CompileParsedFunctionHelper(ParsedFunction* parsed_function, 253 static bool CompileParsedFunctionHelper(ParsedFunction* parsed_function,
254 bool optimized, 254 bool optimized,
255 intptr_t osr_id) { 255 intptr_t osr_id) {
256 const Function& function = parsed_function->function(); 256 const Function& function = parsed_function->function();
257 if (optimized && !function.IsOptimizable()) { 257 if (optimized && !function.IsOptimizable()) {
258 return false; 258 return false;
259 } 259 }
260 TimerScope timer(FLAG_compiler_stats, &CompilerStats::codegen_timer);
261 bool is_compiled = false;
260 Isolate* isolate = Isolate::Current(); 262 Isolate* isolate = Isolate::Current();
261 TimerScope timer(FLAG_compiler_stats, &CompilerStats::codegen_timer, isolate);
262 bool is_compiled = false;
263 HANDLESCOPE(isolate); 263 HANDLESCOPE(isolate);
264 isolate->set_cha_used(false); 264 isolate->set_cha_used(false);
265 265
266 // We may reattempt compilation if the function needs to be assembled using 266 // We may reattempt compilation if the function needs to be assembled using
267 // far branches on ARM and MIPS. In the else branch of the setjmp call, 267 // far branches on ARM and MIPS. In the else branch of the setjmp call,
268 // done is set to false, and use_far_branches is set to true if there is a 268 // done is set to false, and use_far_branches is set to true if there is a
269 // longjmp from the ARM or MIPS assemblers. In all other paths through this 269 // longjmp from the ARM or MIPS assemblers. In all other paths through this
270 // while loop, done is set to true. use_far_branches is always false on ia32 270 // while loop, done is set to true. use_far_branches is always false on ia32
271 // and x64. 271 // and x64.
272 bool done = false; 272 bool done = false;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 345 DEBUG_ASSERT(flow_graph->VerifyUseLists());
346 346
347 // Optimize (a << b) & c patterns, merge operations. 347 // Optimize (a << b) & c patterns, merge operations.
348 // Run early in order to have more opportunity to optimize left shifts. 348 // Run early in order to have more opportunity to optimize left shifts.
349 optimizer.TryOptimizePatterns(); 349 optimizer.TryOptimizePatterns();
350 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 350 DEBUG_ASSERT(flow_graph->VerifyUseLists());
351 351
352 // Inlining (mutates the flow graph) 352 // Inlining (mutates the flow graph)
353 if (FLAG_use_inlining) { 353 if (FLAG_use_inlining) {
354 TimerScope timer(FLAG_compiler_stats, 354 TimerScope timer(FLAG_compiler_stats,
355 &CompilerStats::graphinliner_timer, 355 &CompilerStats::graphinliner_timer);
356 isolate);
357 // Propagate types to create more inlining opportunities. 356 // Propagate types to create more inlining opportunities.
358 FlowGraphTypePropagator::Propagate(flow_graph); 357 FlowGraphTypePropagator::Propagate(flow_graph);
359 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 358 DEBUG_ASSERT(flow_graph->VerifyUseLists());
360 359
361 // Use propagated class-ids to create more inlining opportunities. 360 // Use propagated class-ids to create more inlining opportunities.
362 optimizer.ApplyClassIds(); 361 optimizer.ApplyClassIds();
363 DEBUG_ASSERT(flow_graph->VerifyUseLists()); 362 DEBUG_ASSERT(flow_graph->VerifyUseLists());
364 363
365 FlowGraphInliner inliner(flow_graph); 364 FlowGraphInliner inliner(flow_graph);
366 inliner.Inline(); 365 inliner.Inline();
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 StackZone zone(isolate); 740 StackZone zone(isolate);
742 LongJumpScope jump; 741 LongJumpScope jump;
743 // Make sure unoptimized code is not collected while we are compiling. 742 // Make sure unoptimized code is not collected while we are compiling.
744 const Code& unoptimized_code = Code::ZoneHandle(function.unoptimized_code()); 743 const Code& unoptimized_code = Code::ZoneHandle(function.unoptimized_code());
745 // Skips parsing if we need to only install unoptimized code. 744 // Skips parsing if we need to only install unoptimized code.
746 if (!optimized && !unoptimized_code.IsNull()) { 745 if (!optimized && !unoptimized_code.IsNull()) {
747 InstallUnoptimizedCode(function); 746 InstallUnoptimizedCode(function);
748 return Error::null(); 747 return Error::null();
749 } 748 }
750 if (setjmp(*jump.Set()) == 0) { 749 if (setjmp(*jump.Set()) == 0) {
751 TIMERSCOPE(isolate, time_compilation); 750 TIMERSCOPE(time_compilation);
752 Timer per_compile_timer(FLAG_trace_compiler, "Compilation time"); 751 Timer per_compile_timer(FLAG_trace_compiler, "Compilation time");
753 per_compile_timer.Start(); 752 per_compile_timer.Start();
754 ParsedFunction* parsed_function = 753 ParsedFunction* parsed_function =
755 new ParsedFunction(Function::ZoneHandle(function.raw())); 754 new ParsedFunction(Function::ZoneHandle(function.raw()));
756 if (FLAG_trace_compiler) { 755 if (FLAG_trace_compiler) {
757 OS::Print("Compiling %s%sfunction: '%s' @ token %" Pd ", size %" Pd "\n", 756 OS::Print("Compiling %s%sfunction: '%s' @ token %" Pd ", size %" Pd "\n",
758 (osr_id == Isolate::kNoDeoptId ? "" : "osr "), 757 (osr_id == Isolate::kNoDeoptId ? "" : "osr "),
759 (optimized ? "optimized " : ""), 758 (optimized ? "optimized " : ""),
760 function.ToFullyQualifiedCString(), 759 function.ToFullyQualifiedCString(),
761 function.token_pos(), 760 function.token_pos(),
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 const Object& result = 942 const Object& result =
944 Object::Handle(isolate->object_store()->sticky_error()); 943 Object::Handle(isolate->object_store()->sticky_error());
945 isolate->object_store()->clear_sticky_error(); 944 isolate->object_store()->clear_sticky_error();
946 return result.raw(); 945 return result.raw();
947 } 946 }
948 UNREACHABLE(); 947 UNREACHABLE();
949 return Object::null(); 948 return Object::null();
950 } 949 }
951 950
952 } // namespace dart 951 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_descriptors_test.cc ('k') | runtime/vm/compiler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698