| 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 3077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3088 } | 3088 } |
| 3089 } | 3089 } |
| 3090 | 3090 |
| 3091 | 3091 |
| 3092 void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) { | 3092 void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) { |
| 3093 Register elements = ToRegister(instr->elements()); | 3093 Register elements = ToRegister(instr->elements()); |
| 3094 bool key_is_constant = instr->key()->IsConstantOperand(); | 3094 bool key_is_constant = instr->key()->IsConstantOperand(); |
| 3095 Register key = no_reg; | 3095 Register key = no_reg; |
| 3096 DoubleRegister result = ToDoubleRegister(instr->result()); | 3096 DoubleRegister result = ToDoubleRegister(instr->result()); |
| 3097 Register scratch = scratch0(); | 3097 Register scratch = scratch0(); |
| 3098 bool aligned = FLAG_enable_aligned_doubles; |
| 3098 | 3099 |
| 3099 int element_size_shift = ElementsKindToShiftSize(FAST_DOUBLE_ELEMENTS); | 3100 int element_size_shift = ElementsKindToShiftSize(FAST_DOUBLE_ELEMENTS); |
| 3100 | 3101 |
| 3101 int base_offset = | 3102 int base_offset = |
| 3102 FixedDoubleArray::kHeaderSize - kHeapObjectTag + | 3103 FixedDoubleArray::kHeaderSize - kHeapObjectTag + |
| 3103 (instr->additional_index() << element_size_shift); | 3104 (instr->additional_index() << element_size_shift); |
| 3104 if (key_is_constant) { | 3105 if (key_is_constant) { |
| 3105 int constant_key = ToInteger32(LConstantOperand::cast(instr->key())); | 3106 int constant_key = ToInteger32(LConstantOperand::cast(instr->key())); |
| 3106 if (constant_key & 0xF0000000) { | 3107 if (constant_key & 0xF0000000) { |
| 3107 Abort(kArrayIndexConstantValueTooBig); | 3108 Abort(kArrayIndexConstantValueTooBig); |
| 3108 } | 3109 } |
| 3109 base_offset += constant_key << element_size_shift; | 3110 base_offset += constant_key << element_size_shift; |
| 3110 } | 3111 } |
| 3111 __ Addu(scratch, elements, Operand(base_offset)); | 3112 __ Addu(scratch, elements, Operand(base_offset)); |
| 3112 | 3113 |
| 3113 if (!key_is_constant) { | 3114 if (!key_is_constant) { |
| 3114 key = ToRegister(instr->key()); | 3115 key = ToRegister(instr->key()); |
| 3115 int shift_size = (instr->hydrogen()->key()->representation().IsSmi()) | 3116 int shift_size = (instr->hydrogen()->key()->representation().IsSmi()) |
| 3116 ? (element_size_shift - kSmiTagSize) : element_size_shift; | 3117 ? (element_size_shift - kSmiTagSize) : element_size_shift; |
| 3117 __ sll(at, key, shift_size); | 3118 __ sll(at, key, shift_size); |
| 3118 __ Addu(scratch, scratch, at); | 3119 __ Addu(scratch, scratch, at); |
| 3119 } | 3120 } |
| 3120 | 3121 |
| 3121 __ ldc1(result, MemOperand(scratch)); | 3122 __ ldc1(result, MemOperand(scratch), aligned); |
| 3122 | 3123 |
| 3123 if (instr->hydrogen()->RequiresHoleCheck()) { | 3124 if (instr->hydrogen()->RequiresHoleCheck()) { |
| 3124 __ lw(scratch, MemOperand(scratch, sizeof(kHoleNanLower32))); | 3125 __ lw(scratch, MemOperand(scratch, sizeof(kHoleNanLower32))); |
| 3125 DeoptimizeIf(eq, instr->environment(), scratch, Operand(kHoleNanUpper32)); | 3126 DeoptimizeIf(eq, instr->environment(), scratch, Operand(kHoleNanUpper32)); |
| 3126 } | 3127 } |
| 3127 } | 3128 } |
| 3128 | 3129 |
| 3129 | 3130 |
| 3130 void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { | 3131 void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { |
| 3131 Register elements = ToRegister(instr->elements()); | 3132 Register elements = ToRegister(instr->elements()); |
| (...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4294 } | 4295 } |
| 4295 | 4296 |
| 4296 | 4297 |
| 4297 void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { | 4298 void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { |
| 4298 DoubleRegister value = ToDoubleRegister(instr->value()); | 4299 DoubleRegister value = ToDoubleRegister(instr->value()); |
| 4299 Register elements = ToRegister(instr->elements()); | 4300 Register elements = ToRegister(instr->elements()); |
| 4300 Register scratch = scratch0(); | 4301 Register scratch = scratch0(); |
| 4301 DoubleRegister double_scratch = double_scratch0(); | 4302 DoubleRegister double_scratch = double_scratch0(); |
| 4302 bool key_is_constant = instr->key()->IsConstantOperand(); | 4303 bool key_is_constant = instr->key()->IsConstantOperand(); |
| 4303 Label not_nan, done; | 4304 Label not_nan, done; |
| 4305 bool aligned = FLAG_enable_aligned_doubles; |
| 4304 | 4306 |
| 4305 // Calculate the effective address of the slot in the array to store the | 4307 // Calculate the effective address of the slot in the array to store the |
| 4306 // double value. | 4308 // double value. |
| 4307 int element_size_shift = ElementsKindToShiftSize(FAST_DOUBLE_ELEMENTS); | 4309 int element_size_shift = ElementsKindToShiftSize(FAST_DOUBLE_ELEMENTS); |
| 4308 if (key_is_constant) { | 4310 if (key_is_constant) { |
| 4309 int constant_key = ToInteger32(LConstantOperand::cast(instr->key())); | 4311 int constant_key = ToInteger32(LConstantOperand::cast(instr->key())); |
| 4310 if (constant_key & 0xF0000000) { | 4312 if (constant_key & 0xF0000000) { |
| 4311 Abort(kArrayIndexConstantValueTooBig); | 4313 Abort(kArrayIndexConstantValueTooBig); |
| 4312 } | 4314 } |
| 4313 __ Addu(scratch, elements, | 4315 __ Addu(scratch, elements, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 4332 __ bind(&is_nan); | 4334 __ bind(&is_nan); |
| 4333 __ Move(double_scratch, | 4335 __ Move(double_scratch, |
| 4334 FixedDoubleArray::canonical_not_the_hole_nan_as_double()); | 4336 FixedDoubleArray::canonical_not_the_hole_nan_as_double()); |
| 4335 __ sdc1(double_scratch, MemOperand(scratch, instr->additional_index() << | 4337 __ sdc1(double_scratch, MemOperand(scratch, instr->additional_index() << |
| 4336 element_size_shift)); | 4338 element_size_shift)); |
| 4337 __ Branch(&done); | 4339 __ Branch(&done); |
| 4338 } | 4340 } |
| 4339 | 4341 |
| 4340 __ bind(¬_nan); | 4342 __ bind(¬_nan); |
| 4341 __ sdc1(value, MemOperand(scratch, instr->additional_index() << | 4343 __ sdc1(value, MemOperand(scratch, instr->additional_index() << |
| 4342 element_size_shift)); | 4344 element_size_shift), aligned); |
| 4343 __ bind(&done); | 4345 __ bind(&done); |
| 4344 } | 4346 } |
| 4345 | 4347 |
| 4346 | 4348 |
| 4347 void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { | 4349 void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { |
| 4348 Register value = ToRegister(instr->value()); | 4350 Register value = ToRegister(instr->value()); |
| 4349 Register elements = ToRegister(instr->elements()); | 4351 Register elements = ToRegister(instr->elements()); |
| 4350 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) | 4352 Register key = instr->key()->IsRegister() ? ToRegister(instr->key()) |
| 4351 : no_reg; | 4353 : no_reg; |
| 4352 Register scratch = scratch0(); | 4354 Register scratch = scratch0(); |
| (...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5816 __ Subu(scratch, result, scratch); | 5818 __ Subu(scratch, result, scratch); |
| 5817 __ lw(result, FieldMemOperand(scratch, | 5819 __ lw(result, FieldMemOperand(scratch, |
| 5818 FixedArray::kHeaderSize - kPointerSize)); | 5820 FixedArray::kHeaderSize - kPointerSize)); |
| 5819 __ bind(&done); | 5821 __ bind(&done); |
| 5820 } | 5822 } |
| 5821 | 5823 |
| 5822 | 5824 |
| 5823 #undef __ | 5825 #undef __ |
| 5824 | 5826 |
| 5825 } } // namespace v8::internal | 5827 } } // namespace v8::internal |
| OLD | NEW |