| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
| 6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
| 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 2760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2771 return summary; | 2771 return summary; |
| 2772 } | 2772 } |
| 2773 | 2773 |
| 2774 | 2774 |
| 2775 class CheckStackOverflowSlowPath : public SlowPathCode { | 2775 class CheckStackOverflowSlowPath : public SlowPathCode { |
| 2776 public: | 2776 public: |
| 2777 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) | 2777 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) |
| 2778 : instruction_(instruction) {} | 2778 : instruction_(instruction) {} |
| 2779 | 2779 |
| 2780 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2780 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2781 if (FLAG_use_osr && osr_entry_label()->IsLinked()) { | 2781 if (compiler->isolate()->use_osr() && osr_entry_label()->IsLinked()) { |
| 2782 Register value = instruction_->locs()->temp(0).reg(); | 2782 Register value = instruction_->locs()->temp(0).reg(); |
| 2783 __ Comment("CheckStackOverflowSlowPathOsr"); | 2783 __ Comment("CheckStackOverflowSlowPathOsr"); |
| 2784 __ Bind(osr_entry_label()); | 2784 __ Bind(osr_entry_label()); |
| 2785 __ LoadImmediate(value, Thread::kOsrRequest); | 2785 __ LoadImmediate(value, Thread::kOsrRequest); |
| 2786 __ sw(value, Address(THR, Thread::stack_overflow_flags_offset())); | 2786 __ sw(value, Address(THR, Thread::stack_overflow_flags_offset())); |
| 2787 } | 2787 } |
| 2788 __ Comment("CheckStackOverflowSlowPath"); | 2788 __ Comment("CheckStackOverflowSlowPath"); |
| 2789 __ Bind(entry_label()); | 2789 __ Bind(entry_label()); |
| 2790 compiler->SaveLiveRegisters(instruction_->locs()); | 2790 compiler->SaveLiveRegisters(instruction_->locs()); |
| 2791 // pending_deoptimization_env_ is needed to generate a runtime call that | 2791 // pending_deoptimization_env_ is needed to generate a runtime call that |
| 2792 // may throw an exception. | 2792 // may throw an exception. |
| 2793 ASSERT(compiler->pending_deoptimization_env_ == NULL); | 2793 ASSERT(compiler->pending_deoptimization_env_ == NULL); |
| 2794 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); | 2794 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); |
| 2795 compiler->pending_deoptimization_env_ = env; | 2795 compiler->pending_deoptimization_env_ = env; |
| 2796 compiler->GenerateRuntimeCall( | 2796 compiler->GenerateRuntimeCall( |
| 2797 instruction_->token_pos(), instruction_->deopt_id(), | 2797 instruction_->token_pos(), instruction_->deopt_id(), |
| 2798 kStackOverflowRuntimeEntry, 0, instruction_->locs()); | 2798 kStackOverflowRuntimeEntry, 0, instruction_->locs()); |
| 2799 | 2799 |
| 2800 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { | 2800 if (compiler->isolate()->use_osr() && !compiler->is_optimizing() && |
| 2801 instruction_->in_loop()) { |
| 2801 // In unoptimized code, record loop stack checks as possible OSR entries. | 2802 // In unoptimized code, record loop stack checks as possible OSR entries. |
| 2802 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, | 2803 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, |
| 2803 instruction_->deopt_id(), | 2804 instruction_->deopt_id(), |
| 2804 TokenPosition::kNoSource); | 2805 TokenPosition::kNoSource); |
| 2805 } | 2806 } |
| 2806 compiler->pending_deoptimization_env_ = NULL; | 2807 compiler->pending_deoptimization_env_ = NULL; |
| 2807 compiler->RestoreLiveRegisters(instruction_->locs()); | 2808 compiler->RestoreLiveRegisters(instruction_->locs()); |
| 2808 __ b(exit_label()); | 2809 __ b(exit_label()); |
| 2809 } | 2810 } |
| 2810 | 2811 |
| 2811 Label* osr_entry_label() { | 2812 Label* osr_entry_label() { |
| 2812 ASSERT(FLAG_use_osr); | 2813 ASSERT(Isolate::Current()->use_osr()); |
| 2813 return &osr_entry_label_; | 2814 return &osr_entry_label_; |
| 2814 } | 2815 } |
| 2815 | 2816 |
| 2816 private: | 2817 private: |
| 2817 CheckStackOverflowInstr* instruction_; | 2818 CheckStackOverflowInstr* instruction_; |
| 2818 Label osr_entry_label_; | 2819 Label osr_entry_label_; |
| 2819 }; | 2820 }; |
| 2820 | 2821 |
| 2821 | 2822 |
| 2822 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2823 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| (...skipping 3187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6010 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), | 6011 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), |
| 6011 kGrowRegExpStackRuntimeEntry, 1, locs()); | 6012 kGrowRegExpStackRuntimeEntry, 1, locs()); |
| 6012 __ lw(result, Address(SP, 1 * kWordSize)); | 6013 __ lw(result, Address(SP, 1 * kWordSize)); |
| 6013 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 6014 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
| 6014 } | 6015 } |
| 6015 | 6016 |
| 6016 | 6017 |
| 6017 } // namespace dart | 6018 } // namespace dart |
| 6018 | 6019 |
| 6019 #endif // defined TARGET_ARCH_MIPS | 6020 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |