| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 4145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4156 | 4156 |
| 4157 // Name is always in a2. | 4157 // Name is always in a2. |
| 4158 __ li(a2, Operand(instr->name())); | 4158 __ li(a2, Operand(instr->name())); |
| 4159 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 4159 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) |
| 4160 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 4160 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| 4161 : isolate()->builtins()->StoreIC_Initialize(); | 4161 : isolate()->builtins()->StoreIC_Initialize(); |
| 4162 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4162 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 4163 } | 4163 } |
| 4164 | 4164 |
| 4165 | 4165 |
| 4166 void LCodeGen::ApplyCheckIf(Condition cc, |
| 4167 LBoundsCheck* check, |
| 4168 Register src1, |
| 4169 const Operand& src2) { |
| 4170 if (FLAG_debug_code && check->hydrogen()->skip_check()) { |
| 4171 Label done; |
| 4172 __ Branch(&done, NegateCondition(cc), src1, src2); |
| 4173 __ stop("eliminated bounds check failed"); |
| 4174 __ bind(&done); |
| 4175 } else { |
| 4176 DeoptimizeIf(cc, check->environment(), src1, src2); |
| 4177 } |
| 4178 } |
| 4179 |
| 4180 |
| 4166 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4181 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
| 4167 if (instr->hydrogen()->skip_check()) return; | 4182 if (instr->hydrogen()->skip_check()) return; |
| 4168 | 4183 |
| 4169 Condition condition = instr->hydrogen()->allow_equality() ? hi : hs; | 4184 Condition condition = instr->hydrogen()->allow_equality() ? hi : hs; |
| 4170 if (instr->index()->IsConstantOperand()) { | 4185 if (instr->index()->IsConstantOperand()) { |
| 4171 int constant_index = | 4186 int constant_index = |
| 4172 ToInteger32(LConstantOperand::cast(instr->index())); | 4187 ToInteger32(LConstantOperand::cast(instr->index())); |
| 4173 if (instr->hydrogen()->length()->representation().IsSmi()) { | 4188 if (instr->hydrogen()->length()->representation().IsSmi()) { |
| 4174 __ li(at, Operand(Smi::FromInt(constant_index))); | 4189 __ li(at, Operand(Smi::FromInt(constant_index))); |
| 4175 } else { | 4190 } else { |
| 4176 __ li(at, Operand(constant_index)); | 4191 __ li(at, Operand(constant_index)); |
| 4177 } | 4192 } |
| 4178 DeoptimizeIf(condition, | 4193 ApplyCheckIf(condition, |
| 4179 instr->environment(), | 4194 instr, |
| 4180 at, | 4195 at, |
| 4181 Operand(ToRegister(instr->length()))); | 4196 Operand(ToRegister(instr->length()))); |
| 4182 } else { | 4197 } else { |
| 4183 DeoptimizeIf(condition, | 4198 ApplyCheckIf(condition, |
| 4184 instr->environment(), | 4199 instr, |
| 4185 ToRegister(instr->index()), | 4200 ToRegister(instr->index()), |
| 4186 Operand(ToRegister(instr->length()))); | 4201 Operand(ToRegister(instr->length()))); |
| 4187 } | 4202 } |
| 4188 } | 4203 } |
| 4189 | 4204 |
| 4190 | 4205 |
| 4191 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { | 4206 void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { |
| 4192 Register external_pointer = ToRegister(instr->elements()); | 4207 Register external_pointer = ToRegister(instr->elements()); |
| 4193 Register key = no_reg; | 4208 Register key = no_reg; |
| 4194 ElementsKind elements_kind = instr->elements_kind(); | 4209 ElementsKind elements_kind = instr->elements_kind(); |
| (...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5806 __ Subu(scratch, result, scratch); | 5821 __ Subu(scratch, result, scratch); |
| 5807 __ lw(result, FieldMemOperand(scratch, | 5822 __ lw(result, FieldMemOperand(scratch, |
| 5808 FixedArray::kHeaderSize - kPointerSize)); | 5823 FixedArray::kHeaderSize - kPointerSize)); |
| 5809 __ bind(&done); | 5824 __ bind(&done); |
| 5810 } | 5825 } |
| 5811 | 5826 |
| 5812 | 5827 |
| 5813 #undef __ | 5828 #undef __ |
| 5814 | 5829 |
| 5815 } } // namespace v8::internal | 5830 } } // namespace v8::internal |
| OLD | NEW |