| OLD | NEW |
| 1 | 1 |
| 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. | 6 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 7 #if defined(TARGET_ARCH_ARM) | 7 #if defined(TARGET_ARCH_ARM) |
| 8 | 8 |
| 9 #include "vm/intermediate_language.h" | 9 #include "vm/intermediate_language.h" |
| 10 | 10 |
| (...skipping 2931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2942 return summary; | 2942 return summary; |
| 2943 } | 2943 } |
| 2944 | 2944 |
| 2945 | 2945 |
| 2946 class CheckStackOverflowSlowPath : public SlowPathCode { | 2946 class CheckStackOverflowSlowPath : public SlowPathCode { |
| 2947 public: | 2947 public: |
| 2948 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) | 2948 explicit CheckStackOverflowSlowPath(CheckStackOverflowInstr* instruction) |
| 2949 : instruction_(instruction) {} | 2949 : instruction_(instruction) {} |
| 2950 | 2950 |
| 2951 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { | 2951 virtual void EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2952 if (FLAG_use_osr && osr_entry_label()->IsLinked()) { | 2952 if (compiler->isolate()->use_osr() && osr_entry_label()->IsLinked()) { |
| 2953 const Register value = instruction_->locs()->temp(0).reg(); | 2953 const Register value = instruction_->locs()->temp(0).reg(); |
| 2954 __ Comment("CheckStackOverflowSlowPathOsr"); | 2954 __ Comment("CheckStackOverflowSlowPathOsr"); |
| 2955 __ Bind(osr_entry_label()); | 2955 __ Bind(osr_entry_label()); |
| 2956 __ LoadImmediate(value, Thread::kOsrRequest); | 2956 __ LoadImmediate(value, Thread::kOsrRequest); |
| 2957 __ str(value, Address(THR, Thread::stack_overflow_flags_offset())); | 2957 __ str(value, Address(THR, Thread::stack_overflow_flags_offset())); |
| 2958 } | 2958 } |
| 2959 __ Comment("CheckStackOverflowSlowPath"); | 2959 __ Comment("CheckStackOverflowSlowPath"); |
| 2960 __ Bind(entry_label()); | 2960 __ Bind(entry_label()); |
| 2961 compiler->SaveLiveRegisters(instruction_->locs()); | 2961 compiler->SaveLiveRegisters(instruction_->locs()); |
| 2962 // pending_deoptimization_env_ is needed to generate a runtime call that | 2962 // pending_deoptimization_env_ is needed to generate a runtime call that |
| 2963 // may throw an exception. | 2963 // may throw an exception. |
| 2964 ASSERT(compiler->pending_deoptimization_env_ == NULL); | 2964 ASSERT(compiler->pending_deoptimization_env_ == NULL); |
| 2965 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); | 2965 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); |
| 2966 compiler->pending_deoptimization_env_ = env; | 2966 compiler->pending_deoptimization_env_ = env; |
| 2967 compiler->GenerateRuntimeCall( | 2967 compiler->GenerateRuntimeCall( |
| 2968 instruction_->token_pos(), instruction_->deopt_id(), | 2968 instruction_->token_pos(), instruction_->deopt_id(), |
| 2969 kStackOverflowRuntimeEntry, 0, instruction_->locs()); | 2969 kStackOverflowRuntimeEntry, 0, instruction_->locs()); |
| 2970 | 2970 |
| 2971 if (FLAG_use_osr && !compiler->is_optimizing() && instruction_->in_loop()) { | 2971 if (compiler->isolate()->use_osr() && !compiler->is_optimizing() && |
| 2972 instruction_->in_loop()) { |
| 2972 // In unoptimized code, record loop stack checks as possible OSR entries. | 2973 // In unoptimized code, record loop stack checks as possible OSR entries. |
| 2973 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, | 2974 compiler->AddCurrentDescriptor(RawPcDescriptors::kOsrEntry, |
| 2974 instruction_->deopt_id(), | 2975 instruction_->deopt_id(), |
| 2975 TokenPosition::kNoSource); | 2976 TokenPosition::kNoSource); |
| 2976 } | 2977 } |
| 2977 compiler->pending_deoptimization_env_ = NULL; | 2978 compiler->pending_deoptimization_env_ = NULL; |
| 2978 compiler->RestoreLiveRegisters(instruction_->locs()); | 2979 compiler->RestoreLiveRegisters(instruction_->locs()); |
| 2979 __ b(exit_label()); | 2980 __ b(exit_label()); |
| 2980 } | 2981 } |
| 2981 | 2982 |
| 2982 Label* osr_entry_label() { | 2983 Label* osr_entry_label() { |
| 2983 ASSERT(FLAG_use_osr); | 2984 ASSERT(Isolate::Current()->use_osr()); |
| 2984 return &osr_entry_label_; | 2985 return &osr_entry_label_; |
| 2985 } | 2986 } |
| 2986 | 2987 |
| 2987 private: | 2988 private: |
| 2988 CheckStackOverflowInstr* instruction_; | 2989 CheckStackOverflowInstr* instruction_; |
| 2989 Label osr_entry_label_; | 2990 Label osr_entry_label_; |
| 2990 }; | 2991 }; |
| 2991 | 2992 |
| 2992 | 2993 |
| 2993 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2994 void CheckStackOverflowInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| (...skipping 4231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7225 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), | 7226 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), |
| 7226 kGrowRegExpStackRuntimeEntry, 1, locs()); | 7227 kGrowRegExpStackRuntimeEntry, 1, locs()); |
| 7227 __ Drop(1); | 7228 __ Drop(1); |
| 7228 __ Pop(result); | 7229 __ Pop(result); |
| 7229 } | 7230 } |
| 7230 | 7231 |
| 7231 | 7232 |
| 7232 } // namespace dart | 7233 } // namespace dart |
| 7233 | 7234 |
| 7234 #endif // defined TARGET_ARCH_ARM | 7235 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |