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

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

Issue 2086993003: Fix crash bug in disassembler. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix crash bug in disassembler Created 4 years, 6 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 | no next file » | 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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 function.AttachCode(code); 636 function.AttachCode(code);
637 } 637 }
638 if (parsed_function()->HasDeferredPrefixes()) { 638 if (parsed_function()->HasDeferredPrefixes()) {
639 ASSERT(!FLAG_load_deferred_eagerly); 639 ASSERT(!FLAG_load_deferred_eagerly);
640 ZoneGrowableArray<const LibraryPrefix*>* prefixes = 640 ZoneGrowableArray<const LibraryPrefix*>* prefixes =
641 parsed_function()->deferred_prefixes(); 641 parsed_function()->deferred_prefixes();
642 for (intptr_t i = 0; i < prefixes->length(); i++) { 642 for (intptr_t i = 0; i < prefixes->length(); i++) {
643 (*prefixes)[i]->RegisterDependentCode(code); 643 (*prefixes)[i]->RegisterDependentCode(code);
644 } 644 }
645 } 645 }
646
647 if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) {
648 Disassembler::DisassembleCode(function, optimized());
649 } else if (FLAG_disassemble_optimized &&
650 optimized() &&
651 FlowGraphPrinter::ShouldPrint(function)) {
652 Disassembler::DisassembleCode(function, true);
653 }
646 } 654 }
647 655
648 656
649 void CompileParsedFunctionHelper::CheckIfBackgroundCompilerIsBeingStopped() { 657 void CompileParsedFunctionHelper::CheckIfBackgroundCompilerIsBeingStopped() {
650 ASSERT(Compiler::IsBackgroundCompilation()); 658 ASSERT(Compiler::IsBackgroundCompilation());
651 if (!isolate()->background_compiler()->is_running()) { 659 if (!isolate()->background_compiler()->is_running()) {
652 // The background compiler is being stopped. 660 // The background compiler is being stopped.
653 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId, 661 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId,
654 "Background compilation is being stopped"); 662 "Background compilation is being stopped");
655 } 663 }
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 function.ToFullyQualifiedCString(), 1316 function.ToFullyQualifiedCString(),
1309 Code::Handle(function.CurrentCode()).EntryPoint(), 1317 Code::Handle(function.CurrentCode()).EntryPoint(),
1310 Code::Handle(function.CurrentCode()).Size(), 1318 Code::Handle(function.CurrentCode()).Size(),
1311 per_compile_timer.TotalElapsedTime()); 1319 per_compile_timer.TotalElapsedTime());
1312 } 1320 }
1313 1321
1314 if (FLAG_support_debugger) { 1322 if (FLAG_support_debugger) {
1315 isolate->debugger()->NotifyCompilation(function); 1323 isolate->debugger()->NotifyCompilation(function);
1316 } 1324 }
1317 1325
1318 if (FLAG_disassemble && FlowGraphPrinter::ShouldPrint(function)) {
1319 Disassembler::DisassembleCode(function, optimized);
1320 } else if (FLAG_disassemble_optimized &&
1321 optimized &&
1322 FlowGraphPrinter::ShouldPrint(function)) {
1323 Disassembler::DisassembleCode(function, true);
1324 }
1325 DEBUG_ONLY(CheckInliningIntervals(function)); 1326 DEBUG_ONLY(CheckInliningIntervals(function));
1326 return Error::null(); 1327 return Error::null();
1327 } else { 1328 } else {
1328 Thread* const thread = Thread::Current(); 1329 Thread* const thread = Thread::Current();
1329 StackZone stack_zone(thread); 1330 StackZone stack_zone(thread);
1330 Error& error = Error::Handle(); 1331 Error& error = Error::Handle();
1331 // We got an error during compilation or it is a bailout from background 1332 // We got an error during compilation or it is a bailout from background
1332 // compilation (e.g., during parsing with EnsureIsFinalized). 1333 // compilation (e.g., during parsing with EnsureIsFinalized).
1333 error = thread->sticky_error(); 1334 error = thread->sticky_error();
1334 thread->clear_sticky_error(); 1335 thread->clear_sticky_error();
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
2160 2161
2161 2162
2162 bool BackgroundCompiler::IsDisabled() { 2163 bool BackgroundCompiler::IsDisabled() {
2163 UNREACHABLE(); 2164 UNREACHABLE();
2164 return true; 2165 return true;
2165 } 2166 }
2166 2167
2167 #endif // DART_PRECOMPILED_RUNTIME 2168 #endif // DART_PRECOMPILED_RUNTIME
2168 2169
2169 } // namespace dart 2170 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698