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

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

Issue 2994283002: [VM-Compiler] Don't inline if we don't have inlining budget enough to fully inline.
Patch Set: Do InliningDecision the way Slava suggested Created 3 years, 2 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/compiler/backend/inliner.h » ('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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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/clustered_snapshot.h" 5 #include "vm/clustered_snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart.h" 10 #include "vm/dart.h"
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 } else { 637 } else {
638 #if !defined(DART_PRECOMPILED_RUNTIME) 638 #if !defined(DART_PRECOMPILED_RUNTIME)
639 if (Snapshot::IncludesCode(kind)) { 639 if (Snapshot::IncludesCode(kind)) {
640 func->ptr()->usage_counter_ = 0; 640 func->ptr()->usage_counter_ = 0;
641 } else { 641 } else {
642 func->ptr()->usage_counter_ = d->Read<int32_t>(); 642 func->ptr()->usage_counter_ = d->Read<int32_t>();
643 } 643 }
644 func->ptr()->deoptimization_counter_ = 0; 644 func->ptr()->deoptimization_counter_ = 0;
645 func->ptr()->optimized_instruction_count_ = 0; 645 func->ptr()->optimized_instruction_count_ = 0;
646 func->ptr()->optimized_call_site_count_ = 0; 646 func->ptr()->optimized_call_site_count_ = 0;
647 func->ptr()->inlining_depth_ = 0;
647 #endif 648 #endif
648 } 649 }
649 } 650 }
650 } 651 }
651 652
652 void PostLoad(const Array& refs, Snapshot::Kind kind, Zone* zone) { 653 void PostLoad(const Array& refs, Snapshot::Kind kind, Zone* zone) {
653 NOT_IN_PRODUCT(TimelineDurationScope tds( 654 NOT_IN_PRODUCT(TimelineDurationScope tds(
654 Thread::Current(), Timeline::GetIsolateStream(), "PostLoadFunction")); 655 Thread::Current(), Timeline::GetIsolateStream(), "PostLoadFunction"));
655 656
656 if (kind == Snapshot::kFullAOT) { 657 if (kind == Snapshot::kFullAOT) {
657 Function& func = Function::Handle(zone); 658 Function& func = Function::Handle(zone);
658 for (intptr_t i = start_index_; i < stop_index_; i++) { 659 for (intptr_t i = start_index_; i < stop_index_; i++) {
659 func ^= refs.At(i); 660 func ^= refs.At(i);
660 ASSERT(func.raw()->ptr()->code_->IsCode()); 661 ASSERT(func.raw()->ptr()->code_->IsCode());
661 uword entry_point = func.raw()->ptr()->code_->ptr()->entry_point_; 662 uword entry_point = func.raw()->ptr()->code_->ptr()->entry_point_;
662 ASSERT(entry_point != 0); 663 ASSERT(entry_point != 0);
663 func.raw()->ptr()->entry_point_ = entry_point; 664 func.raw()->ptr()->entry_point_ = entry_point;
664 } 665 }
665 } else if (kind == Snapshot::kFullJIT) { 666 } else if (kind == Snapshot::kFullJIT) {
666 Function& func = Function::Handle(zone); 667 Function& func = Function::Handle(zone);
667 Code& code = Code::Handle(zone); 668 Code& code = Code::Handle(zone);
668 for (intptr_t i = start_index_; i < stop_index_; i++) { 669 for (intptr_t i = start_index_; i < stop_index_; i++) {
669 func ^= refs.At(i); 670 func ^= refs.At(i);
670 code ^= func.CurrentCode(); 671 code ^= func.CurrentCode();
671 if (func.HasCode() && !code.IsDisabled()) { 672 if (func.HasCode() && !code.IsDisabled()) {
672 func.SetInstructions(code); 673 func.SetInstructions(code);
673 func.set_was_compiled(true); 674 func.SetWasCompiled(true);
674 } else { 675 } else {
675 func.ClearCode(); 676 func.ClearCode();
676 func.set_was_compiled(false); 677 func.SetWasCompiled(false);
677 } 678 }
678 } 679 }
679 } else { 680 } else {
680 Function& func = Function::Handle(zone); 681 Function& func = Function::Handle(zone);
681 for (intptr_t i = start_index_; i < stop_index_; i++) { 682 for (intptr_t i = start_index_; i < stop_index_; i++) {
682 func ^= refs.At(i); 683 func ^= refs.At(i);
683 func.ClearICDataArray(); 684 func.ClearICDataArray();
684 func.ClearCode(); 685 func.ClearCode();
685 func.set_was_compiled(false); 686 func.SetWasCompiled(false);
686 } 687 }
687 } 688 }
688 } 689 }
689 }; 690 };
690 691
691 #if !defined(DART_PRECOMPILED_RUNTIME) 692 #if !defined(DART_PRECOMPILED_RUNTIME)
692 class ClosureDataSerializationCluster : public SerializationCluster { 693 class ClosureDataSerializationCluster : public SerializationCluster {
693 public: 694 public:
694 ClosureDataSerializationCluster() {} 695 ClosureDataSerializationCluster() {}
695 virtual ~ClosureDataSerializationCluster() {} 696 virtual ~ClosureDataSerializationCluster() {}
(...skipping 4876 matching lines...) Expand 10 before | Expand all | Expand 10 after
5572 thread_->isolate()->SetupImagePage(data_buffer_, 5573 thread_->isolate()->SetupImagePage(data_buffer_,
5573 /* is_executable */ false); 5574 /* is_executable */ false);
5574 } 5575 }
5575 5576
5576 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); 5577 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store());
5577 5578
5578 return ApiError::null(); 5579 return ApiError::null();
5579 } 5580 }
5580 5581
5581 } // namespace dart 5582 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/compiler/backend/inliner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698