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 2986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2997 Register result = locs->out(0).reg(); | 2997 Register result = locs->out(0).reg(); |
2998 locs->live_registers()->Remove(Location::RegisterLocation(result)); | 2998 locs->live_registers()->Remove(Location::RegisterLocation(result)); |
2999 | 2999 |
3000 compiler->SaveLiveRegisters(locs); | 3000 compiler->SaveLiveRegisters(locs); |
3001 if (instruction_->env() != NULL) { | 3001 if (instruction_->env() != NULL) { |
3002 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); | 3002 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); |
3003 compiler->pending_deoptimization_env_ = env; | 3003 compiler->pending_deoptimization_env_ = env; |
3004 } | 3004 } |
3005 __ Push(locs->in(0).reg()); | 3005 __ Push(locs->in(0).reg()); |
3006 __ Push(locs->in(1).reg()); | 3006 __ Push(locs->in(1).reg()); |
| 3007 String& selector = |
| 3008 String::Handle(instruction_->call()->ic_data()->target_name()); |
| 3009 Array& argument_names = |
| 3010 Array::Handle(instruction_->call()->ic_data()->arguments_descriptor()); |
3007 compiler->EmitMegamorphicInstanceCall( | 3011 compiler->EmitMegamorphicInstanceCall( |
3008 *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(), | 3012 selector, argument_names, instruction_->call()->ArgumentCount(), |
3009 instruction_->call()->deopt_id(), instruction_->call()->token_pos(), | 3013 instruction_->call()->deopt_id(), instruction_->call()->token_pos(), |
3010 locs, try_index_, | 3014 locs, try_index_, |
3011 /* slow_path_argument_count = */ 2); | 3015 /* slow_path_argument_count = */ 2); |
3012 __ mov(result, V0); | 3016 __ mov(result, V0); |
3013 compiler->RestoreLiveRegisters(locs); | 3017 compiler->RestoreLiveRegisters(locs); |
3014 __ b(exit_label()); | 3018 __ b(exit_label()); |
3015 compiler->pending_deoptimization_env_ = NULL; | 3019 compiler->pending_deoptimization_env_ = NULL; |
3016 } | 3020 } |
3017 | 3021 |
3018 private: | 3022 private: |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3133 Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg(); | 3137 Register result = merged_ ? locs->temp(0).reg() : locs->out(0).reg(); |
3134 locs->live_registers()->Remove(Location::RegisterLocation(result)); | 3138 locs->live_registers()->Remove(Location::RegisterLocation(result)); |
3135 | 3139 |
3136 compiler->SaveLiveRegisters(locs); | 3140 compiler->SaveLiveRegisters(locs); |
3137 if (instruction_->env() != NULL) { | 3141 if (instruction_->env() != NULL) { |
3138 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); | 3142 Environment* env = compiler->SlowPathEnvironmentFor(instruction_); |
3139 compiler->pending_deoptimization_env_ = env; | 3143 compiler->pending_deoptimization_env_ = env; |
3140 } | 3144 } |
3141 __ Push(locs->in(0).reg()); | 3145 __ Push(locs->in(0).reg()); |
3142 __ Push(locs->in(1).reg()); | 3146 __ Push(locs->in(1).reg()); |
| 3147 String& selector = |
| 3148 String::Handle(instruction_->call()->ic_data()->target_name()); |
| 3149 Array& argument_names = |
| 3150 Array::Handle(instruction_->call()->ic_data()->arguments_descriptor()); |
3143 compiler->EmitMegamorphicInstanceCall( | 3151 compiler->EmitMegamorphicInstanceCall( |
3144 *instruction_->call()->ic_data(), instruction_->call()->ArgumentCount(), | 3152 selector, argument_names, instruction_->call()->ArgumentCount(), |
3145 instruction_->call()->deopt_id(), instruction_->call()->token_pos(), | 3153 instruction_->call()->deopt_id(), instruction_->call()->token_pos(), |
3146 locs, try_index_, | 3154 locs, try_index_, |
3147 /* slow_path_argument_count = */ 2); | 3155 /* slow_path_argument_count = */ 2); |
3148 __ mov(result, V0); | 3156 __ mov(result, V0); |
3149 compiler->RestoreLiveRegisters(locs); | 3157 compiler->RestoreLiveRegisters(locs); |
3150 compiler->pending_deoptimization_env_ = NULL; | 3158 compiler->pending_deoptimization_env_ = NULL; |
3151 if (merged_) { | 3159 if (merged_) { |
3152 __ BranchEqual(result, Bool::True(), instruction_->is_negated() | 3160 __ BranchEqual(result, Bool::True(), instruction_->is_negated() |
3153 ? labels_.false_label | 3161 ? labels_.false_label |
3154 : labels_.true_label); | 3162 : labels_.true_label); |
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5071 if (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) { | 5079 if (unary_checks().GetReceiverClassIdAt(0) == kSmiCid) { |
5072 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); | 5080 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); |
5073 __ beq(CMPRES1, ZR, &is_ok); | 5081 __ beq(CMPRES1, ZR, &is_ok); |
5074 } else { | 5082 } else { |
5075 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); | 5083 __ andi(CMPRES1, value, Immediate(kSmiTagMask)); |
5076 __ beq(CMPRES1, ZR, deopt); | 5084 __ beq(CMPRES1, ZR, deopt); |
5077 } | 5085 } |
5078 Register biased_cid = temp; | 5086 Register biased_cid = temp; |
5079 __ LoadClassId(biased_cid, value); | 5087 __ LoadClassId(biased_cid, value); |
5080 | 5088 |
5081 GrowableArray<CidRangeTarget> sorted_ic_data; | 5089 ZoneGrowableArray<CidRangeTarget> sorted_ic_data; |
5082 FlowGraphCompiler::SortICDataByCount(unary_checks(), &sorted_ic_data, | 5090 FlowGraphCompiler::SortICDataByCount(unary_checks(), &sorted_ic_data, |
5083 /* drop_smi = */ true); | 5091 /* drop_smi = */ true); |
5084 | 5092 |
5085 if (IsDenseSwitch()) { | 5093 if (IsDenseSwitch()) { |
5086 ASSERT(cids_[0] < cids_[cids_.length() - 1]); | 5094 ASSERT(cids_[0] < cids_[cids_.length() - 1]); |
5087 __ LoadImmediate(TMP, cids_[0]); | 5095 __ LoadImmediate(TMP, cids_[0]); |
5088 __ subu(biased_cid, biased_cid, TMP); | 5096 __ subu(biased_cid, biased_cid, TMP); |
5089 __ LoadImmediate(TMP, cids_[cids_.length() - 1] - cids_[0]); | 5097 __ LoadImmediate(TMP, cids_[cids_.length() - 1] - cids_[0]); |
5090 __ BranchUnsignedGreater(biased_cid, TMP, deopt); | 5098 __ BranchUnsignedGreater(biased_cid, TMP, deopt); |
5091 | 5099 |
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6080 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), | 6088 compiler->GenerateRuntimeCall(TokenPosition::kNoSource, deopt_id(), |
6081 kGrowRegExpStackRuntimeEntry, 1, locs()); | 6089 kGrowRegExpStackRuntimeEntry, 1, locs()); |
6082 __ lw(result, Address(SP, 1 * kWordSize)); | 6090 __ lw(result, Address(SP, 1 * kWordSize)); |
6083 __ addiu(SP, SP, Immediate(2 * kWordSize)); | 6091 __ addiu(SP, SP, Immediate(2 * kWordSize)); |
6084 } | 6092 } |
6085 | 6093 |
6086 | 6094 |
6087 } // namespace dart | 6095 } // namespace dart |
6088 | 6096 |
6089 #endif // defined TARGET_ARCH_MIPS | 6097 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |