| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 8633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8644 size_t element_size = 1; // Bogus initialization. | 8644 size_t element_size = 1; // Bogus initialization. |
| 8645 Runtime::ArrayIdToTypeAndSize(array_id, &array_type, &element_size); | 8645 Runtime::ArrayIdToTypeAndSize(array_id, &array_type, &element_size); |
| 8646 | 8646 |
| 8647 HInstruction* length = AddUncasted<HDiv>(byte_length, | 8647 HInstruction* length = AddUncasted<HDiv>(byte_length, |
| 8648 Add<HConstant>(static_cast<int32_t>(element_size))); | 8648 Add<HConstant>(static_cast<int32_t>(element_size))); |
| 8649 | 8649 |
| 8650 Add<HStoreNamedField>(obj, | 8650 Add<HStoreNamedField>(obj, |
| 8651 HObjectAccess::ForJSTypedArrayLength(), | 8651 HObjectAccess::ForJSTypedArrayLength(), |
| 8652 length); | 8652 length); |
| 8653 | 8653 |
| 8654 Handle<Map> external_array_map( |
| 8655 isolate()->heap()->MapForExternalArrayType(array_type)); |
| 8656 |
| 8654 HValue* elements = | 8657 HValue* elements = |
| 8655 Add<HAllocate>( | 8658 Add<HAllocate>( |
| 8656 Add<HConstant>(ExternalArray::kAlignedSize), | 8659 Add<HConstant>(ExternalArray::kAlignedSize), |
| 8657 HType::JSArray(), | 8660 HType::JSArray(), |
| 8658 NOT_TENURED, | 8661 NOT_TENURED, |
| 8659 static_cast<InstanceType>(FIRST_EXTERNAL_ARRAY_TYPE + array_type)); | 8662 external_array_map->instance_type()); |
| 8660 | 8663 |
| 8661 Handle<Map> external_array_map( | 8664 AddStoreMapConstant(elements, external_array_map); |
| 8662 isolate()->heap()->MapForExternalArrayType(array_type)); | |
| 8663 Add<HStoreNamedField>(elements, | |
| 8664 HObjectAccess::ForMap(), | |
| 8665 Add<HConstant>(external_array_map)); | |
| 8666 | 8665 |
| 8667 HValue* backing_store = Add<HLoadNamedField>( | 8666 HValue* backing_store = Add<HLoadNamedField>( |
| 8668 buffer, static_cast<HValue*>(NULL), | 8667 buffer, static_cast<HValue*>(NULL), |
| 8669 HObjectAccess::ForJSArrayBufferBackingStore()); | 8668 HObjectAccess::ForJSArrayBufferBackingStore()); |
| 8670 | 8669 |
| 8671 HValue* typed_array_start; | 8670 HValue* typed_array_start; |
| 8672 if (is_zero_byte_offset) { | 8671 if (is_zero_byte_offset) { |
| 8673 typed_array_start = backing_store; | 8672 typed_array_start = backing_store; |
| 8674 } else { | 8673 } else { |
| 8675 HInstruction* external_pointer = | 8674 HInstruction* external_pointer = |
| (...skipping 2681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11357 if (ShouldProduceTraceOutput()) { | 11356 if (ShouldProduceTraceOutput()) { |
| 11358 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 11357 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
| 11359 } | 11358 } |
| 11360 | 11359 |
| 11361 #ifdef DEBUG | 11360 #ifdef DEBUG |
| 11362 graph_->Verify(false); // No full verify. | 11361 graph_->Verify(false); // No full verify. |
| 11363 #endif | 11362 #endif |
| 11364 } | 11363 } |
| 11365 | 11364 |
| 11366 } } // namespace v8::internal | 11365 } } // namespace v8::internal |
| OLD | NEW |