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

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

Issue 1672873003: Bailout if field state changed during background compilation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Comment Created 4 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
« no previous file with comments | « runtime/vm/compiler.h ('k') | runtime/vm/flow_graph_inliner.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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 // Extract type feedback before the graph is built, as the graph 639 // Extract type feedback before the graph is built, as the graph
640 // builder uses it to attach it to nodes. 640 // builder uses it to attach it to nodes.
641 ASSERT(function.deoptimization_counter() < 641 ASSERT(function.deoptimization_counter() <
642 FLAG_max_deoptimization_counter_threshold); 642 FLAG_max_deoptimization_counter_threshold);
643 643
644 // 'Freeze' ICData in background compilation so that it does not 644 // 'Freeze' ICData in background compilation so that it does not
645 // change while compiling. 645 // change while compiling.
646 const bool clone_descriptors = Compiler::IsBackgroundCompilation(); 646 const bool clone_descriptors = Compiler::IsBackgroundCompilation();
647 function.RestoreICDataMap(ic_data_array, clone_descriptors); 647 function.RestoreICDataMap(ic_data_array, clone_descriptors);
648 648
649 if (Compiler::IsBackgroundCompilation() &&
650 (function.ic_data_array() == Array::null())) {
651 Compiler::AbortBackgroundCompilation(Thread::kNoDeoptId);
652 }
649 if (FLAG_print_ic_data_map) { 653 if (FLAG_print_ic_data_map) {
650 for (intptr_t i = 0; i < ic_data_array->length(); i++) { 654 for (intptr_t i = 0; i < ic_data_array->length(); i++) {
651 if ((*ic_data_array)[i] != NULL) { 655 if ((*ic_data_array)[i] != NULL) {
652 THR_Print("%" Pd " ", i); 656 THR_Print("%" Pd " ", i);
653 FlowGraphPrinter::PrintICData(*(*ic_data_array)[i]); 657 FlowGraphPrinter::PrintICData(*(*ic_data_array)[i]);
654 } 658 }
655 } 659 }
656 } 660 }
657 } 661 }
658 662
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 Thread* const thread = Thread::Current(); 1688 Thread* const thread = Thread::Current();
1685 const Object& result = PassiveObject::Handle(thread->sticky_error()); 1689 const Object& result = PassiveObject::Handle(thread->sticky_error());
1686 thread->clear_sticky_error(); 1690 thread->clear_sticky_error();
1687 return result.raw(); 1691 return result.raw();
1688 } 1692 }
1689 UNREACHABLE(); 1693 UNREACHABLE();
1690 return Object::null(); 1694 return Object::null();
1691 } 1695 }
1692 1696
1693 1697
1698 void Compiler::AbortBackgroundCompilation(intptr_t deopt_id) {
1699 ASSERT(Compiler::IsBackgroundCompilation());
1700 Thread::Current()->long_jump_base()->Jump(
1701 deopt_id, Object::background_compilation_error());
1702 }
1703
1704
1694 // C-heap allocated background compilation queue element. 1705 // C-heap allocated background compilation queue element.
1695 class QueueElement { 1706 class QueueElement {
1696 public: 1707 public:
1697 explicit QueueElement(const Function& function) 1708 explicit QueueElement(const Function& function)
1698 : next_(NULL), 1709 : next_(NULL),
1699 function_(function.raw()) { 1710 function_(function.raw()) {
1700 ASSERT(Thread::Current()->IsMutatorThread()); 1711 ASSERT(Thread::Current()->IsMutatorThread());
1701 } 1712 }
1702 1713
1703 ~QueueElement() { 1714 ~QueueElement() {
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 } 2026 }
2016 2027
2017 2028
2018 2029
2019 RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) { 2030 RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) {
2020 UNREACHABLE(); 2031 UNREACHABLE();
2021 return Object::null(); 2032 return Object::null();
2022 } 2033 }
2023 2034
2024 2035
2036 void Compiler::AbortBackgroundCompilation(intptr_t deopt_id) {
2037 UNREACHABLE();
2038 }
2039
2040
2025 void BackgroundCompiler::CompileOptimized(const Function& function) { 2041 void BackgroundCompiler::CompileOptimized(const Function& function) {
2026 UNREACHABLE(); 2042 UNREACHABLE();
2027 } 2043 }
2028 2044
2029 2045
2030 void BackgroundCompiler::VisitPointers(ObjectPointerVisitor* visitor) { 2046 void BackgroundCompiler::VisitPointers(ObjectPointerVisitor* visitor) {
2031 UNREACHABLE(); 2047 UNREACHABLE();
2032 } 2048 }
2033 2049
2034 2050
2035 void BackgroundCompiler::Stop(BackgroundCompiler* task) { 2051 void BackgroundCompiler::Stop(BackgroundCompiler* task) {
2036 UNREACHABLE(); 2052 UNREACHABLE();
2037 } 2053 }
2038 2054
2039 2055
2040 void BackgroundCompiler::EnsureInit(Thread* thread) { 2056 void BackgroundCompiler::EnsureInit(Thread* thread) {
2041 UNREACHABLE(); 2057 UNREACHABLE();
2042 } 2058 }
2043 2059
2044 #endif // DART_PRECOMPILED_RUNTIME 2060 #endif // DART_PRECOMPILED_RUNTIME
2045 2061
2046 } // namespace dart 2062 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.h ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698