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

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

Issue 2728163002: VM: Make use_osr an Isolate flag, similar to how we made use_field_guards. (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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/globals.h" // Needed here to get TARGET_ARCH_ARM64. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64.
6 #if defined(TARGET_ARCH_ARM64) 6 #if defined(TARGET_ARCH_ARM64)
7 7
8 #include "vm/intermediate_language.h" 8 #include "vm/intermediate_language.h"
9 9
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 2624 matching lines...) Expand 10 before | Expand all | Expand 10 after
2635 return summary; 2635 return summary;
2636 } 2636 }
2637 2637
2638 2638
2639 class CheckStackOverflowSlowPath : public SlowPathCode { 2639 class CheckStackOverflowSlowPath : public SlowPathCode {
2640 public: 2640 public:
2641 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) 2641 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction)
2642 : instruction_(instruction) {} 2642 : instruction_(instruction) {}
2643 2643
2644 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { 2644 virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
2645 if (FLAG_use_osr && osr_entry_label()->IsLinked()) { 2645 if (compiler->isolate()->use_osr() && osr_entry_label()->IsLinked()) {
2646 const Register value = instruction_->locs()->temp(0).reg(); 2646 const Register value = instruction_->locs()->temp(0).reg();
2647 __ Comment("CheckStackOverflowSlowPathOsr"); 2647 __ Comment("CheckStackOverflowSlowPathOsr");
2648 __ Bind(osr_entry_label()); 2648 __ Bind(osr_entry_label());
2649 __ LoadImmediate(value, Thread::kOsrRequest); 2649 __ LoadImmediate(value, Thread::kOsrRequest);
2650 __ str(value, Address(THR, Thread::stack_overflow_flags_offset())); 2650 __ str(value, Address(THR, Thread::stack_overflow_flags_offset()));
2651 } 2651 }
2652 __ Comment("CheckStackOverflowSlowPath"); 2652 __ Comment("CheckStackOverflowSlowPath");
2653 __ Bind(entry_label()); 2653 __ Bind(entry_label());
2654 compiler->SaveLiveRegisters(instruction_->locs()); 2654 compiler->SaveLiveRegisters(instruction_->locs());
2655 // pending_deoptimization_env_ is needed to generate a runtime call that 2655 // pending_deoptimization_env_ is needed to generate a runtime call that
2656 // may throw an exception. 2656 // may throw an exception.
2657 ASSERT(compiler->pending_deoptimization_env_ == NULL); 2657 ASSERT(compiler->pending_deoptimization_env_ == NULL);
2658 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); 2658 Environment* env = compiler->SlowPathEnvironmentFor(instruction_);
2659 compiler->pending_deoptimization_env_ = env; 2659 compiler->pending_deoptimization_env_ = env;
2660 compiler->GenerateRuntimeCall( 2660 compiler->GenerateRuntimeCall(
2661 instruction_->token_pos(), instruction_->deopt_id(), 2661 instruction_->token_pos(), instruction_->deopt_id(),
2662 kStackOverflowRuntimeEntry, 0, instruction_->locs()); 2662 kStackOverflowRuntimeEntry, 0, instruction_->locs());
2663 2663
2664 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { 2664 if (compiler->isolate()->use_osr() && !compiler->is_optimizing() &&
2665 instruction_->in_loop()) {
2665 // In unoptimized code, record loop stack checks as possible OSR entries. 2666 // In unoptimized code, record loop stack checks as possible OSR entries.
2666 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, 2667 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry,
2667 instruction_->deopt_id(), 2668 instruction_->deopt_id(),
2668 TokenPosition::kNoSource); 2669 TokenPosition::kNoSource);
2669 } 2670 }
2670 compiler->pending_deoptimization_env_ = NULL; 2671 compiler->pending_deoptimization_env_ = NULL;
2671 compiler->RestoreLiveRegisters(instruction_->locs()); 2672 compiler->RestoreLiveRegisters(instruction_->locs());
2672 __ b(exit_label()); 2673 __ b(exit_label());
2673 } 2674 }
2674 2675
2675 Label* osr_entry_label() { 2676 Label* osr_entry_label() {
2676 ASSERT(FLAG_use_osr); 2677 ASSERT(Isolate::Current()->use_osr());
2677 return &osr_entry_label_; 2678 return &osr_entry_label_;
2678 } 2679 }
2679 2680
2680 private: 2681 private:
2681 CheckStackOverflowInstr* instruction_; 2682 CheckStackOverflowInstr* instruction_;
2682 Label osr_entry_label_; 2683 Label osr_entry_label_;
2683 }; 2684 };
2684 2685
2685 2686
2686 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { 2687 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
(...skipping 3331 matching lines...) Expand 10 before | Expand all | Expand 10 after
6018 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), 6019 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(),
6019 kGrowRegExpStackRuntimeEntry, 1, locs()); 6020 kGrowRegExpStackRuntimeEntry, 1, locs());
6020 __ Drop(1); 6021 __ Drop(1);
6021 __ Pop(result); 6022 __ Pop(result);
6022 } 6023 }
6023 6024
6024 6025
6025 } // namespace dart 6026 } // namespace dart
6026 6027
6027 #endif // defined TARGET_ARCH_ARM64 6028 #endif // defined TARGET_ARCH_ARM64
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698