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 4771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4782 } | 4782 } |
4783 | 4783 |
4784 // Copy elements backing store content. | 4784 // Copy elements backing store content. |
4785 int elements_length = has_elements ? elements->length() : 0; | 4785 int elements_length = has_elements ? elements->length() : 0; |
4786 if (elements->IsFixedDoubleArray()) { | 4786 if (elements->IsFixedDoubleArray()) { |
4787 Handle<FixedDoubleArray> double_array = | 4787 Handle<FixedDoubleArray> double_array = |
4788 Handle<FixedDoubleArray>::cast(elements); | 4788 Handle<FixedDoubleArray>::cast(elements); |
4789 for (int i = 0; i < elements_length; i++) { | 4789 for (int i = 0; i < elements_length; i++) { |
4790 int64_t value = double_array->get_representation(i); | 4790 int64_t value = double_array->get_representation(i); |
4791 // We only support little endian mode... | 4791 // We only support little endian mode... |
4792 int32_t value_low = value & 0xFFFFFFFF; | 4792 int32_t value_low = static_cast<int32_t>(value & 0xFFFFFFFF); |
4793 int32_t value_high = value >> 32; | 4793 int32_t value_high = static_cast<int32_t>(value >> 32); |
4794 int total_offset = | 4794 int total_offset = |
4795 elements_offset + FixedDoubleArray::OffsetOfElementAt(i); | 4795 elements_offset + FixedDoubleArray::OffsetOfElementAt(i); |
4796 __ li(a2, Operand(value_low)); | 4796 __ li(a2, Operand(value_low)); |
4797 __ sw(a2, FieldMemOperand(result, total_offset)); | 4797 __ sw(a2, FieldMemOperand(result, total_offset)); |
4798 __ li(a2, Operand(value_high)); | 4798 __ li(a2, Operand(value_high)); |
4799 __ sw(a2, FieldMemOperand(result, total_offset + 4)); | 4799 __ sw(a2, FieldMemOperand(result, total_offset + 4)); |
4800 } | 4800 } |
4801 } else if (elements->IsFixedArray()) { | 4801 } else if (elements->IsFixedArray()) { |
4802 Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements); | 4802 Handle<FixedArray> fast_elements = Handle<FixedArray>::cast(elements); |
4803 for (int i = 0; i < elements_length; i++) { | 4803 for (int i = 0; i < elements_length; i++) { |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5359 __ Subu(scratch, result, scratch); | 5359 __ Subu(scratch, result, scratch); |
5360 __ lw(result, FieldMemOperand(scratch, | 5360 __ lw(result, FieldMemOperand(scratch, |
5361 FixedArray::kHeaderSize - kPointerSize)); | 5361 FixedArray::kHeaderSize - kPointerSize)); |
5362 __ bind(&done); | 5362 __ bind(&done); |
5363 } | 5363 } |
5364 | 5364 |
5365 | 5365 |
5366 #undef __ | 5366 #undef __ |
5367 | 5367 |
5368 } } // namespace v8::internal | 5368 } } // namespace v8::internal |
OLD | NEW |