OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved.7 | 1 // Copyright 2012 the V8 project authors. All rights reserved.7 |
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 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2176 | 2176 |
2177 if (expected.Contains(ToBooleanStub::SYMBOL)) { | 2177 if (expected.Contains(ToBooleanStub::SYMBOL)) { |
2178 // Symbol value -> true. | 2178 // Symbol value -> true. |
2179 const Register scratch = scratch1(); | 2179 const Register scratch = scratch1(); |
2180 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 2180 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
2181 __ Branch(instr->TrueLabel(chunk_), eq, scratch, Operand(SYMBOL_TYPE)); | 2181 __ Branch(instr->TrueLabel(chunk_), eq, scratch, Operand(SYMBOL_TYPE)); |
2182 } | 2182 } |
2183 | 2183 |
2184 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { | 2184 if (expected.Contains(ToBooleanStub::SIMD_VALUE)) { |
2185 // SIMD value -> true. | 2185 // SIMD value -> true. |
| 2186 Label not_simd; |
2186 const Register scratch = scratch1(); | 2187 const Register scratch = scratch1(); |
2187 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); | 2188 __ lbu(scratch, FieldMemOperand(map, Map::kInstanceTypeOffset)); |
2188 __ Branch(instr->TrueLabel(chunk_), eq, scratch, | 2189 __ Branch(¬_simd, lt, at, Operand(FIRST_SIMD_VALUE_TYPE)); |
2189 Operand(FLOAT32X4_TYPE)); | 2190 __ Branch(instr->TrueLabel(chunk_), le, scratch, |
| 2191 Operand(LAST_SIMD_VALUE_TYPE)); |
| 2192 __ bind(¬_simd); |
2190 } | 2193 } |
2191 | 2194 |
2192 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { | 2195 if (expected.Contains(ToBooleanStub::HEAP_NUMBER)) { |
2193 // heap number -> false iff +0, -0, or NaN. | 2196 // heap number -> false iff +0, -0, or NaN. |
2194 DoubleRegister dbl_scratch = double_scratch0(); | 2197 DoubleRegister dbl_scratch = double_scratch0(); |
2195 Label not_heap_number; | 2198 Label not_heap_number; |
2196 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 2199 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
2197 __ Branch(¬_heap_number, ne, map, Operand(at)); | 2200 __ Branch(¬_heap_number, ne, map, Operand(at)); |
2198 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); | 2201 __ ldc1(dbl_scratch, FieldMemOperand(reg, HeapNumber::kValueOffset)); |
2199 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), | 2202 __ BranchF(instr->TrueLabel(chunk_), instr->FalseLabel(chunk_), |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2892 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), | 2895 CodeFactory::LoadICInOptimizedCode(isolate(), instr->typeof_mode(), |
2893 SLOPPY, PREMONOMORPHIC).code(); | 2896 SLOPPY, PREMONOMORPHIC).code(); |
2894 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 2897 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
2895 } | 2898 } |
2896 | 2899 |
2897 | 2900 |
2898 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { | 2901 void LCodeGen::DoLoadGlobalViaContext(LLoadGlobalViaContext* instr) { |
2899 DCHECK(ToRegister(instr->context()).is(cp)); | 2902 DCHECK(ToRegister(instr->context()).is(cp)); |
2900 DCHECK(ToRegister(instr->result()).is(v0)); | 2903 DCHECK(ToRegister(instr->result()).is(v0)); |
2901 | 2904 |
2902 int const slot = instr->slot_index(); | 2905 __ li(LoadGlobalViaContextDescriptor::DepthRegister(), |
2903 int const depth = instr->depth(); | 2906 Operand(Smi::FromInt(instr->depth()))); |
2904 if (depth <= LoadGlobalViaContextStub::kMaximumDepth) { | 2907 __ li(LoadGlobalViaContextDescriptor::SlotRegister(), |
2905 __ li(LoadGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | 2908 Operand(Smi::FromInt(instr->slot_index()))); |
2906 Handle<Code> stub = | 2909 __ li(LoadGlobalViaContextDescriptor::NameRegister(), Operand(instr->name())); |
2907 CodeFactory::LoadGlobalViaContext(isolate(), depth).code(); | 2910 |
2908 CallCode(stub, RelocInfo::CODE_TARGET, instr); | 2911 Handle<Code> stub = |
2909 } else { | 2912 CodeFactory::LoadGlobalViaContext(isolate(), instr->depth()).code(); |
2910 __ Push(Smi::FromInt(slot)); | 2913 CallCode(stub, RelocInfo::CODE_TARGET, instr); |
2911 __ CallRuntime(Runtime::kLoadGlobalViaContext, 1); | |
2912 } | |
2913 } | 2914 } |
2914 | 2915 |
2915 | 2916 |
2916 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { | 2917 void LCodeGen::DoLoadContextSlot(LLoadContextSlot* instr) { |
2917 Register context = ToRegister(instr->context()); | 2918 Register context = ToRegister(instr->context()); |
2918 Register result = ToRegister(instr->result()); | 2919 Register result = ToRegister(instr->result()); |
2919 | 2920 |
2920 __ lw(result, ContextOperand(context, instr->slot_index())); | 2921 __ lw(result, ContextOperand(context, instr->slot_index())); |
2921 if (instr->hydrogen()->RequiresHoleCheck()) { | 2922 if (instr->hydrogen()->RequiresHoleCheck()) { |
2922 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); | 2923 __ LoadRoot(at, Heap::kTheHoleValueRootIndex); |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3104 Abort(kArrayIndexConstantValueTooBig); | 3105 Abort(kArrayIndexConstantValueTooBig); |
3105 } | 3106 } |
3106 } else { | 3107 } else { |
3107 key = ToRegister(instr->key()); | 3108 key = ToRegister(instr->key()); |
3108 } | 3109 } |
3109 int element_size_shift = ElementsKindToShiftSize(elements_kind); | 3110 int element_size_shift = ElementsKindToShiftSize(elements_kind); |
3110 int shift_size = (instr->hydrogen()->key()->representation().IsSmi()) | 3111 int shift_size = (instr->hydrogen()->key()->representation().IsSmi()) |
3111 ? (element_size_shift - kSmiTagSize) : element_size_shift; | 3112 ? (element_size_shift - kSmiTagSize) : element_size_shift; |
3112 int base_offset = instr->base_offset(); | 3113 int base_offset = instr->base_offset(); |
3113 | 3114 |
3114 if (elements_kind == FLOAT32_ELEMENTS || elements_kind == FLOAT64_ELEMENTS) { | 3115 if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS || |
| 3116 elements_kind == FLOAT32_ELEMENTS || |
| 3117 elements_kind == EXTERNAL_FLOAT64_ELEMENTS || |
| 3118 elements_kind == FLOAT64_ELEMENTS) { |
3115 FPURegister result = ToDoubleRegister(instr->result()); | 3119 FPURegister result = ToDoubleRegister(instr->result()); |
3116 if (key_is_constant) { | 3120 if (key_is_constant) { |
3117 __ Addu(scratch0(), external_pointer, constant_key << element_size_shift); | 3121 __ Addu(scratch0(), external_pointer, constant_key << element_size_shift); |
3118 } else { | 3122 } else { |
3119 __ sll(scratch0(), key, shift_size); | 3123 __ sll(scratch0(), key, shift_size); |
3120 __ Addu(scratch0(), scratch0(), external_pointer); | 3124 __ Addu(scratch0(), scratch0(), external_pointer); |
3121 } | 3125 } |
3122 if (elements_kind == FLOAT32_ELEMENTS) { | 3126 if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS || |
| 3127 elements_kind == FLOAT32_ELEMENTS) { |
3123 __ lwc1(result, MemOperand(scratch0(), base_offset)); | 3128 __ lwc1(result, MemOperand(scratch0(), base_offset)); |
3124 __ cvt_d_s(result, result); | 3129 __ cvt_d_s(result, result); |
3125 } else { // i.e. elements_kind == EXTERNAL_DOUBLE_ELEMENTS | 3130 } else { // i.e. elements_kind == EXTERNAL_DOUBLE_ELEMENTS |
3126 __ ldc1(result, MemOperand(scratch0(), base_offset)); | 3131 __ ldc1(result, MemOperand(scratch0(), base_offset)); |
3127 } | 3132 } |
3128 } else { | 3133 } else { |
3129 Register result = ToRegister(instr->result()); | 3134 Register result = ToRegister(instr->result()); |
3130 MemOperand mem_operand = PrepareKeyedOperand( | 3135 MemOperand mem_operand = PrepareKeyedOperand( |
3131 key, external_pointer, key_is_constant, constant_key, | 3136 key, external_pointer, key_is_constant, constant_key, |
3132 element_size_shift, shift_size, base_offset); | 3137 element_size_shift, shift_size, base_offset); |
3133 switch (elements_kind) { | 3138 switch (elements_kind) { |
| 3139 case EXTERNAL_INT8_ELEMENTS: |
3134 case INT8_ELEMENTS: | 3140 case INT8_ELEMENTS: |
3135 __ lb(result, mem_operand); | 3141 __ lb(result, mem_operand); |
3136 break; | 3142 break; |
| 3143 case EXTERNAL_UINT8_CLAMPED_ELEMENTS: |
| 3144 case EXTERNAL_UINT8_ELEMENTS: |
3137 case UINT8_ELEMENTS: | 3145 case UINT8_ELEMENTS: |
3138 case UINT8_CLAMPED_ELEMENTS: | 3146 case UINT8_CLAMPED_ELEMENTS: |
3139 __ lbu(result, mem_operand); | 3147 __ lbu(result, mem_operand); |
3140 break; | 3148 break; |
| 3149 case EXTERNAL_INT16_ELEMENTS: |
3141 case INT16_ELEMENTS: | 3150 case INT16_ELEMENTS: |
3142 __ lh(result, mem_operand); | 3151 __ lh(result, mem_operand); |
3143 break; | 3152 break; |
| 3153 case EXTERNAL_UINT16_ELEMENTS: |
3144 case UINT16_ELEMENTS: | 3154 case UINT16_ELEMENTS: |
3145 __ lhu(result, mem_operand); | 3155 __ lhu(result, mem_operand); |
3146 break; | 3156 break; |
| 3157 case EXTERNAL_INT32_ELEMENTS: |
3147 case INT32_ELEMENTS: | 3158 case INT32_ELEMENTS: |
3148 __ lw(result, mem_operand); | 3159 __ lw(result, mem_operand); |
3149 break; | 3160 break; |
| 3161 case EXTERNAL_UINT32_ELEMENTS: |
3150 case UINT32_ELEMENTS: | 3162 case UINT32_ELEMENTS: |
3151 __ lw(result, mem_operand); | 3163 __ lw(result, mem_operand); |
3152 if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) { | 3164 if (!instr->hydrogen()->CheckFlag(HInstruction::kUint32)) { |
3153 DeoptimizeIf(Ugreater_equal, instr, Deoptimizer::kNegativeValue, | 3165 DeoptimizeIf(Ugreater_equal, instr, Deoptimizer::kNegativeValue, |
3154 result, Operand(0x80000000)); | 3166 result, Operand(0x80000000)); |
3155 } | 3167 } |
3156 break; | 3168 break; |
3157 case FLOAT32_ELEMENTS: | 3169 case FLOAT32_ELEMENTS: |
3158 case FLOAT64_ELEMENTS: | 3170 case FLOAT64_ELEMENTS: |
| 3171 case EXTERNAL_FLOAT32_ELEMENTS: |
| 3172 case EXTERNAL_FLOAT64_ELEMENTS: |
3159 case FAST_DOUBLE_ELEMENTS: | 3173 case FAST_DOUBLE_ELEMENTS: |
3160 case FAST_ELEMENTS: | 3174 case FAST_ELEMENTS: |
3161 case FAST_SMI_ELEMENTS: | 3175 case FAST_SMI_ELEMENTS: |
3162 case FAST_HOLEY_DOUBLE_ELEMENTS: | 3176 case FAST_HOLEY_DOUBLE_ELEMENTS: |
3163 case FAST_HOLEY_ELEMENTS: | 3177 case FAST_HOLEY_ELEMENTS: |
3164 case FAST_HOLEY_SMI_ELEMENTS: | 3178 case FAST_HOLEY_SMI_ELEMENTS: |
3165 case DICTIONARY_ELEMENTS: | 3179 case DICTIONARY_ELEMENTS: |
3166 case FAST_SLOPPY_ARGUMENTS_ELEMENTS: | 3180 case FAST_SLOPPY_ARGUMENTS_ELEMENTS: |
3167 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS: | 3181 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS: |
3168 UNREACHABLE(); | 3182 UNREACHABLE(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3260 DeoptimizeIf(ne, instr, Deoptimizer::kHole, result, | 3274 DeoptimizeIf(ne, instr, Deoptimizer::kHole, result, |
3261 Operand(Smi::FromInt(Isolate::kArrayProtectorValid))); | 3275 Operand(Smi::FromInt(Isolate::kArrayProtectorValid))); |
3262 } | 3276 } |
3263 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); | 3277 __ LoadRoot(result, Heap::kUndefinedValueRootIndex); |
3264 __ bind(&done); | 3278 __ bind(&done); |
3265 } | 3279 } |
3266 } | 3280 } |
3267 | 3281 |
3268 | 3282 |
3269 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { | 3283 void LCodeGen::DoLoadKeyed(LLoadKeyed* instr) { |
3270 if (instr->is_fixed_typed_array()) { | 3284 if (instr->is_typed_elements()) { |
3271 DoLoadKeyedExternalArray(instr); | 3285 DoLoadKeyedExternalArray(instr); |
3272 } else if (instr->hydrogen()->representation().IsDouble()) { | 3286 } else if (instr->hydrogen()->representation().IsDouble()) { |
3273 DoLoadKeyedFixedDoubleArray(instr); | 3287 DoLoadKeyedFixedDoubleArray(instr); |
3274 } else { | 3288 } else { |
3275 DoLoadKeyedFixedArray(instr); | 3289 DoLoadKeyedFixedArray(instr); |
3276 } | 3290 } |
3277 } | 3291 } |
3278 | 3292 |
3279 | 3293 |
3280 MemOperand LCodeGen::PrepareKeyedOperand(Register key, | 3294 MemOperand LCodeGen::PrepareKeyedOperand(Register key, |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3514 // If there is no frame, the context must be in cp. | 3528 // If there is no frame, the context must be in cp. |
3515 DCHECK(result.is(cp)); | 3529 DCHECK(result.is(cp)); |
3516 } | 3530 } |
3517 } | 3531 } |
3518 | 3532 |
3519 | 3533 |
3520 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { | 3534 void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { |
3521 DCHECK(ToRegister(instr->context()).is(cp)); | 3535 DCHECK(ToRegister(instr->context()).is(cp)); |
3522 __ li(scratch0(), instr->hydrogen()->pairs()); | 3536 __ li(scratch0(), instr->hydrogen()->pairs()); |
3523 __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags()))); | 3537 __ li(scratch1(), Operand(Smi::FromInt(instr->hydrogen()->flags()))); |
3524 __ Push(scratch0(), scratch1()); | 3538 // The context is the first argument. |
3525 CallRuntime(Runtime::kDeclareGlobals, 2, instr); | 3539 __ Push(cp, scratch0(), scratch1()); |
| 3540 CallRuntime(Runtime::kDeclareGlobals, 3, instr); |
3526 } | 3541 } |
3527 | 3542 |
3528 | 3543 |
3529 void LCodeGen::CallKnownFunction(Handle<JSFunction> function, | 3544 void LCodeGen::CallKnownFunction(Handle<JSFunction> function, |
3530 int formal_parameter_count, int arity, | 3545 int formal_parameter_count, int arity, |
3531 LInstruction* instr) { | 3546 LInstruction* instr) { |
3532 bool dont_adapt_arguments = | 3547 bool dont_adapt_arguments = |
3533 formal_parameter_count == SharedFunctionInfo::kDontAdaptArgumentsSentinel; | 3548 formal_parameter_count == SharedFunctionInfo::kDontAdaptArgumentsSentinel; |
3534 bool can_invoke_directly = | 3549 bool can_invoke_directly = |
3535 dont_adapt_arguments || formal_parameter_count == arity; | 3550 dont_adapt_arguments || formal_parameter_count == arity; |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4190 instr->hydrogen()->initialization_state()).code(); | 4205 instr->hydrogen()->initialization_state()).code(); |
4191 CallCode(ic, RelocInfo::CODE_TARGET, instr); | 4206 CallCode(ic, RelocInfo::CODE_TARGET, instr); |
4192 } | 4207 } |
4193 | 4208 |
4194 | 4209 |
4195 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { | 4210 void LCodeGen::DoStoreGlobalViaContext(LStoreGlobalViaContext* instr) { |
4196 DCHECK(ToRegister(instr->context()).is(cp)); | 4211 DCHECK(ToRegister(instr->context()).is(cp)); |
4197 DCHECK(ToRegister(instr->value()) | 4212 DCHECK(ToRegister(instr->value()) |
4198 .is(StoreGlobalViaContextDescriptor::ValueRegister())); | 4213 .is(StoreGlobalViaContextDescriptor::ValueRegister())); |
4199 | 4214 |
4200 int const slot = instr->slot_index(); | 4215 __ li(StoreGlobalViaContextDescriptor::DepthRegister(), |
4201 int const depth = instr->depth(); | 4216 Operand(Smi::FromInt(instr->depth()))); |
4202 if (depth <= StoreGlobalViaContextStub::kMaximumDepth) { | 4217 __ li(StoreGlobalViaContextDescriptor::SlotRegister(), |
4203 __ li(StoreGlobalViaContextDescriptor::SlotRegister(), Operand(slot)); | 4218 Operand(Smi::FromInt(instr->slot_index()))); |
4204 Handle<Code> stub = CodeFactory::StoreGlobalViaContext( | 4219 __ li(StoreGlobalViaContextDescriptor::NameRegister(), |
4205 isolate(), depth, instr->language_mode()) | 4220 Operand(instr->name())); |
4206 .code(); | 4221 |
4207 CallCode(stub, RelocInfo::CODE_TARGET, instr); | 4222 Handle<Code> stub = CodeFactory::StoreGlobalViaContext( |
4208 } else { | 4223 isolate(), instr->depth(), instr->language_mode()) |
4209 __ Push(Smi::FromInt(slot)); | 4224 .code(); |
4210 __ Push(StoreGlobalViaContextDescriptor::ValueRegister()); | 4225 CallCode(stub, RelocInfo::CODE_TARGET, instr); |
4211 __ CallRuntime(is_strict(language_mode()) | |
4212 ? Runtime::kStoreGlobalViaContext_Strict | |
4213 : Runtime::kStoreGlobalViaContext_Sloppy, | |
4214 2); | |
4215 } | |
4216 } | 4226 } |
4217 | 4227 |
4218 | 4228 |
4219 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { | 4229 void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
4220 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; | 4230 Condition cc = instr->hydrogen()->allow_equality() ? hi : hs; |
4221 Operand operand(0); | 4231 Operand operand(0); |
4222 Register reg; | 4232 Register reg; |
4223 if (instr->index()->IsConstantOperand()) { | 4233 if (instr->index()->IsConstantOperand()) { |
4224 operand = ToOperand(instr->index()); | 4234 operand = ToOperand(instr->index()); |
4225 reg = ToRegister(instr->length()); | 4235 reg = ToRegister(instr->length()); |
(...skipping 25 matching lines...) Expand all Loading... |
4251 Abort(kArrayIndexConstantValueTooBig); | 4261 Abort(kArrayIndexConstantValueTooBig); |
4252 } | 4262 } |
4253 } else { | 4263 } else { |
4254 key = ToRegister(instr->key()); | 4264 key = ToRegister(instr->key()); |
4255 } | 4265 } |
4256 int element_size_shift = ElementsKindToShiftSize(elements_kind); | 4266 int element_size_shift = ElementsKindToShiftSize(elements_kind); |
4257 int shift_size = (instr->hydrogen()->key()->representation().IsSmi()) | 4267 int shift_size = (instr->hydrogen()->key()->representation().IsSmi()) |
4258 ? (element_size_shift - kSmiTagSize) : element_size_shift; | 4268 ? (element_size_shift - kSmiTagSize) : element_size_shift; |
4259 int base_offset = instr->base_offset(); | 4269 int base_offset = instr->base_offset(); |
4260 | 4270 |
4261 if (elements_kind == FLOAT32_ELEMENTS || elements_kind == FLOAT64_ELEMENTS) { | 4271 if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS || |
| 4272 elements_kind == FLOAT32_ELEMENTS || |
| 4273 elements_kind == EXTERNAL_FLOAT64_ELEMENTS || |
| 4274 elements_kind == FLOAT64_ELEMENTS) { |
4262 Register address = scratch0(); | 4275 Register address = scratch0(); |
4263 FPURegister value(ToDoubleRegister(instr->value())); | 4276 FPURegister value(ToDoubleRegister(instr->value())); |
4264 if (key_is_constant) { | 4277 if (key_is_constant) { |
4265 if (constant_key != 0) { | 4278 if (constant_key != 0) { |
4266 __ Addu(address, external_pointer, | 4279 __ Addu(address, external_pointer, |
4267 Operand(constant_key << element_size_shift)); | 4280 Operand(constant_key << element_size_shift)); |
4268 } else { | 4281 } else { |
4269 address = external_pointer; | 4282 address = external_pointer; |
4270 } | 4283 } |
4271 } else { | 4284 } else { |
4272 __ sll(address, key, shift_size); | 4285 __ sll(address, key, shift_size); |
4273 __ Addu(address, external_pointer, address); | 4286 __ Addu(address, external_pointer, address); |
4274 } | 4287 } |
4275 | 4288 |
4276 if (elements_kind == FLOAT32_ELEMENTS) { | 4289 if (elements_kind == EXTERNAL_FLOAT32_ELEMENTS || |
| 4290 elements_kind == FLOAT32_ELEMENTS) { |
4277 __ cvt_s_d(double_scratch0(), value); | 4291 __ cvt_s_d(double_scratch0(), value); |
4278 __ swc1(double_scratch0(), MemOperand(address, base_offset)); | 4292 __ swc1(double_scratch0(), MemOperand(address, base_offset)); |
4279 } else { // Storing doubles, not floats. | 4293 } else { // Storing doubles, not floats. |
4280 __ sdc1(value, MemOperand(address, base_offset)); | 4294 __ sdc1(value, MemOperand(address, base_offset)); |
4281 } | 4295 } |
4282 } else { | 4296 } else { |
4283 Register value(ToRegister(instr->value())); | 4297 Register value(ToRegister(instr->value())); |
4284 MemOperand mem_operand = PrepareKeyedOperand( | 4298 MemOperand mem_operand = PrepareKeyedOperand( |
4285 key, external_pointer, key_is_constant, constant_key, | 4299 key, external_pointer, key_is_constant, constant_key, |
4286 element_size_shift, shift_size, | 4300 element_size_shift, shift_size, |
4287 base_offset); | 4301 base_offset); |
4288 switch (elements_kind) { | 4302 switch (elements_kind) { |
| 4303 case EXTERNAL_UINT8_CLAMPED_ELEMENTS: |
| 4304 case EXTERNAL_INT8_ELEMENTS: |
| 4305 case EXTERNAL_UINT8_ELEMENTS: |
4289 case UINT8_ELEMENTS: | 4306 case UINT8_ELEMENTS: |
4290 case UINT8_CLAMPED_ELEMENTS: | 4307 case UINT8_CLAMPED_ELEMENTS: |
4291 case INT8_ELEMENTS: | 4308 case INT8_ELEMENTS: |
4292 __ sb(value, mem_operand); | 4309 __ sb(value, mem_operand); |
4293 break; | 4310 break; |
| 4311 case EXTERNAL_INT16_ELEMENTS: |
| 4312 case EXTERNAL_UINT16_ELEMENTS: |
4294 case INT16_ELEMENTS: | 4313 case INT16_ELEMENTS: |
4295 case UINT16_ELEMENTS: | 4314 case UINT16_ELEMENTS: |
4296 __ sh(value, mem_operand); | 4315 __ sh(value, mem_operand); |
4297 break; | 4316 break; |
| 4317 case EXTERNAL_INT32_ELEMENTS: |
| 4318 case EXTERNAL_UINT32_ELEMENTS: |
4298 case INT32_ELEMENTS: | 4319 case INT32_ELEMENTS: |
4299 case UINT32_ELEMENTS: | 4320 case UINT32_ELEMENTS: |
4300 __ sw(value, mem_operand); | 4321 __ sw(value, mem_operand); |
4301 break; | 4322 break; |
4302 case FLOAT32_ELEMENTS: | 4323 case FLOAT32_ELEMENTS: |
4303 case FLOAT64_ELEMENTS: | 4324 case FLOAT64_ELEMENTS: |
| 4325 case EXTERNAL_FLOAT32_ELEMENTS: |
| 4326 case EXTERNAL_FLOAT64_ELEMENTS: |
4304 case FAST_DOUBLE_ELEMENTS: | 4327 case FAST_DOUBLE_ELEMENTS: |
4305 case FAST_ELEMENTS: | 4328 case FAST_ELEMENTS: |
4306 case FAST_SMI_ELEMENTS: | 4329 case FAST_SMI_ELEMENTS: |
4307 case FAST_HOLEY_DOUBLE_ELEMENTS: | 4330 case FAST_HOLEY_DOUBLE_ELEMENTS: |
4308 case FAST_HOLEY_ELEMENTS: | 4331 case FAST_HOLEY_ELEMENTS: |
4309 case FAST_HOLEY_SMI_ELEMENTS: | 4332 case FAST_HOLEY_SMI_ELEMENTS: |
4310 case DICTIONARY_ELEMENTS: | 4333 case DICTIONARY_ELEMENTS: |
4311 case FAST_SLOPPY_ARGUMENTS_ELEMENTS: | 4334 case FAST_SLOPPY_ARGUMENTS_ELEMENTS: |
4312 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS: | 4335 case SLOW_SLOPPY_ARGUMENTS_ELEMENTS: |
4313 UNREACHABLE(); | 4336 UNREACHABLE(); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4407 kSaveFPRegs, | 4430 kSaveFPRegs, |
4408 EMIT_REMEMBERED_SET, | 4431 EMIT_REMEMBERED_SET, |
4409 check_needed, | 4432 check_needed, |
4410 instr->hydrogen()->PointersToHereCheckForValue()); | 4433 instr->hydrogen()->PointersToHereCheckForValue()); |
4411 } | 4434 } |
4412 } | 4435 } |
4413 | 4436 |
4414 | 4437 |
4415 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { | 4438 void LCodeGen::DoStoreKeyed(LStoreKeyed* instr) { |
4416 // By cases: external, fast double | 4439 // By cases: external, fast double |
4417 if (instr->is_fixed_typed_array()) { | 4440 if (instr->is_typed_elements()) { |
4418 DoStoreKeyedExternalArray(instr); | 4441 DoStoreKeyedExternalArray(instr); |
4419 } else if (instr->hydrogen()->value()->representation().IsDouble()) { | 4442 } else if (instr->hydrogen()->value()->representation().IsDouble()) { |
4420 DoStoreKeyedFixedDoubleArray(instr); | 4443 DoStoreKeyedFixedDoubleArray(instr); |
4421 } else { | 4444 } else { |
4422 DoStoreKeyedFixedArray(instr); | 4445 DoStoreKeyedFixedArray(instr); |
4423 } | 4446 } |
4424 } | 4447 } |
4425 | 4448 |
4426 | 4449 |
4427 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { | 4450 void LCodeGen::DoStoreKeyedGeneric(LStoreKeyedGeneric* instr) { |
(...skipping 1313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5741 *cmp2 = Operand(zero_reg); | 5764 *cmp2 = Operand(zero_reg); |
5742 final_branch_condition = eq; | 5765 final_branch_condition = eq; |
5743 | 5766 |
5744 } else if (String::Equals(type_name, factory->float32x4_string())) { | 5767 } else if (String::Equals(type_name, factory->float32x4_string())) { |
5745 __ JumpIfSmi(input, false_label); | 5768 __ JumpIfSmi(input, false_label); |
5746 __ GetObjectType(input, input, scratch); | 5769 __ GetObjectType(input, input, scratch); |
5747 *cmp1 = scratch; | 5770 *cmp1 = scratch; |
5748 *cmp2 = Operand(FLOAT32X4_TYPE); | 5771 *cmp2 = Operand(FLOAT32X4_TYPE); |
5749 final_branch_condition = eq; | 5772 final_branch_condition = eq; |
5750 | 5773 |
| 5774 } else if (String::Equals(type_name, factory->int32x4_string())) { |
| 5775 __ JumpIfSmi(input, false_label); |
| 5776 __ GetObjectType(input, input, scratch); |
| 5777 *cmp1 = scratch; |
| 5778 *cmp2 = Operand(INT32X4_TYPE); |
| 5779 final_branch_condition = eq; |
| 5780 |
| 5781 } else if (String::Equals(type_name, factory->bool32x4_string())) { |
| 5782 __ JumpIfSmi(input, false_label); |
| 5783 __ GetObjectType(input, input, scratch); |
| 5784 *cmp1 = scratch; |
| 5785 *cmp2 = Operand(BOOL32X4_TYPE); |
| 5786 final_branch_condition = eq; |
| 5787 |
| 5788 } else if (String::Equals(type_name, factory->int16x8_string())) { |
| 5789 __ JumpIfSmi(input, false_label); |
| 5790 __ GetObjectType(input, input, scratch); |
| 5791 *cmp1 = scratch; |
| 5792 *cmp2 = Operand(INT16X8_TYPE); |
| 5793 final_branch_condition = eq; |
| 5794 |
| 5795 } else if (String::Equals(type_name, factory->bool16x8_string())) { |
| 5796 __ JumpIfSmi(input, false_label); |
| 5797 __ GetObjectType(input, input, scratch); |
| 5798 *cmp1 = scratch; |
| 5799 *cmp2 = Operand(BOOL16X8_TYPE); |
| 5800 final_branch_condition = eq; |
| 5801 |
| 5802 } else if (String::Equals(type_name, factory->int8x16_string())) { |
| 5803 __ JumpIfSmi(input, false_label); |
| 5804 __ GetObjectType(input, input, scratch); |
| 5805 *cmp1 = scratch; |
| 5806 *cmp2 = Operand(INT8X16_TYPE); |
| 5807 final_branch_condition = eq; |
| 5808 |
| 5809 } else if (String::Equals(type_name, factory->bool8x16_string())) { |
| 5810 __ JumpIfSmi(input, false_label); |
| 5811 __ GetObjectType(input, input, scratch); |
| 5812 *cmp1 = scratch; |
| 5813 *cmp2 = Operand(BOOL8X16_TYPE); |
| 5814 final_branch_condition = eq; |
| 5815 |
5751 } else { | 5816 } else { |
5752 *cmp1 = at; | 5817 *cmp1 = at; |
5753 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. | 5818 *cmp2 = Operand(zero_reg); // Set to valid regs, to avoid caller assertion. |
5754 __ Branch(false_label); | 5819 __ Branch(false_label); |
5755 } | 5820 } |
5756 | 5821 |
5757 return final_branch_condition; | 5822 return final_branch_condition; |
5758 } | 5823 } |
5759 | 5824 |
5760 | 5825 |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6059 __ Push(at, ToRegister(instr->function())); | 6124 __ Push(at, ToRegister(instr->function())); |
6060 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6125 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
6061 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6126 RecordSafepoint(Safepoint::kNoLazyDeopt); |
6062 } | 6127 } |
6063 | 6128 |
6064 | 6129 |
6065 #undef __ | 6130 #undef __ |
6066 | 6131 |
6067 } // namespace internal | 6132 } // namespace internal |
6068 } // namespace v8 | 6133 } // namespace v8 |
OLD | NEW |