| 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 3946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3957 | 3957 |
| 3958 // Name is always in a2. | 3958 // Name is always in a2. |
| 3959 __ li(a2, Operand(instr->name())); | 3959 __ li(a2, Operand(instr->name())); |
| 3960 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) | 3960 Handle<Code> ic = (instr->strict_mode_flag() == kStrictMode) |
| 3961 ? isolate()->builtins()->StoreIC_Initialize_Strict() | 3961 ? isolate()->builtins()->StoreIC_Initialize_Strict() |
| 3962 : isolate()->builtins()->StoreIC_Initialize(); | 3962 : isolate()->builtins()->StoreIC_Initialize(); |
| 3963 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 3963 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
| 3964 } | 3964 } |
| 3965 | 3965 |
| 3966 | 3966 |
| 3967 void LCodeGen::DeoptIfTaggedButNotSmi(LEnvironment* environment, | |
| 3968 HValue* value, | |
| 3969 LOperand* operand) { | |
| 3970 if (value->representation().IsTagged() && !value->type().IsSmi()) { | |
| 3971 if (operand->IsRegister()) { | |
| 3972 __ And(at, ToRegister(operand), Operand(kSmiTagMask)); | |
| 3973 DeoptimizeIf(ne, environment, at, Operand(zero_reg)); | |
| 3974 } else { | |
| 3975 __ li(at, ToOperand(operand)); | |
| 3976 __ And(at, at, Operand(kSmiTagMask)); | |
| 3977 DeoptimizeIf(ne, environment, at, Operand(zero_reg)); | |
| 3978 } | |
| 3979 } | |
| 3980 } | |
| 3981 | |
| 3982 | |
| 3983 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 3967 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
| 3984 DeoptIfTaggedButNotSmi(instr->environment(), | 3968 if (instr->hydrogen()->skip_check()) return; |
| 3985 instr->hydrogen()->length(), | 3969 |
| 3986 instr->length()); | |
| 3987 DeoptIfTaggedButNotSmi(instr->environment(), | |
| 3988 instr->hydrogen()->index(), | |
| 3989 instr->index()); | |
| 3990 if (instr->index()->IsConstantOperand()) { | 3970 if (instr->index()->IsConstantOperand()) { |
| 3991 int constant_index = | 3971 int constant_index = |
| 3992 ToInteger32(LConstantOperand::cast(instr->index())); | 3972 ToInteger32(LConstantOperand::cast(instr->index())); |
| 3993 if (instr->hydrogen()->length()->representation().IsTagged()) { | 3973 if (instr->hydrogen()->length()->representation().IsTagged()) { |
| 3994 __ li(at, Operand(Smi::FromInt(constant_index))); | 3974 __ li(at, Operand(Smi::FromInt(constant_index))); |
| 3995 } else { | 3975 } else { |
| 3996 __ li(at, Operand(constant_index)); | 3976 __ li(at, Operand(constant_index)); |
| 3997 } | 3977 } |
| 3998 DeoptimizeIf(hs, | 3978 DeoptimizeIf(hs, |
| 3999 instr->environment(), | 3979 instr->environment(), |
| (...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5827 __ Subu(scratch, result, scratch); | 5807 __ Subu(scratch, result, scratch); |
| 5828 __ lw(result, FieldMemOperand(scratch, | 5808 __ lw(result, FieldMemOperand(scratch, |
| 5829 FixedArray::kHeaderSize - kPointerSize)); | 5809 FixedArray::kHeaderSize - kPointerSize)); |
| 5830 __ bind(&done); | 5810 __ bind(&done); |
| 5831 } | 5811 } |
| 5832 | 5812 |
| 5833 | 5813 |
| 5834 #undef __ | 5814 #undef __ |
| 5835 | 5815 |
| 5836 } } // namespace v8::internal | 5816 } } // namespace v8::internal |
| OLD | NEW |