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 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 CONVERT_ARG_HANDLE_CHECKED(Object, byte_length_object, 4); | 959 CONVERT_ARG_HANDLE_CHECKED(Object, byte_length_object, 4); |
960 | 960 |
961 ASSERT(holder->GetInternalFieldCount() == | 961 ASSERT(holder->GetInternalFieldCount() == |
962 v8::ArrayBufferView::kInternalFieldCount); | 962 v8::ArrayBufferView::kInternalFieldCount); |
963 for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) { | 963 for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) { |
964 holder->SetInternalField(i, Smi::FromInt(0)); | 964 holder->SetInternalField(i, Smi::FromInt(0)); |
965 } | 965 } |
966 | 966 |
967 ExternalArrayType array_type = kExternalInt8Array; // Bogus initialization. | 967 ExternalArrayType array_type = kExternalInt8Array; // Bogus initialization. |
968 size_t element_size = 1; // Bogus initialization. | 968 size_t element_size = 1; // Bogus initialization. |
969 ElementsKind external_elements_kind = EXTERNAL_INT8_ELEMENTS; | 969 ElementsKind external_elements_kind = EXTERNAL_INT8_ELEMENTS; // Bogus |
970 ElementsKind fixed_elements_kind = INT8_ELEMENTS; | 970 ElementsKind fixed_elements_kind = INT8_ELEMENTS; // Bogus initialization. |
971 Runtime::ArrayIdToTypeAndSize(arrayId, | 971 Runtime::ArrayIdToTypeAndSize(arrayId, |
972 &array_type, | 972 &array_type, |
973 &external_elements_kind, | 973 &external_elements_kind, |
974 &fixed_elements_kind, | 974 &fixed_elements_kind, |
975 &element_size); | 975 &element_size); |
976 | 976 |
977 holder->set_byte_offset(*byte_offset_object); | 977 holder->set_byte_offset(*byte_offset_object); |
978 holder->set_byte_length(*byte_length_object); | 978 holder->set_byte_length(*byte_length_object); |
979 | 979 |
980 size_t byte_offset = NumberToSize(isolate, *byte_offset_object); | 980 size_t byte_offset = NumberToSize(isolate, *byte_offset_object); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 CONVERT_ARG_HANDLE_CHECKED(Object, length_obj, 3); | 1037 CONVERT_ARG_HANDLE_CHECKED(Object, length_obj, 3); |
1038 | 1038 |
1039 ASSERT(holder->GetInternalFieldCount() == | 1039 ASSERT(holder->GetInternalFieldCount() == |
1040 v8::ArrayBufferView::kInternalFieldCount); | 1040 v8::ArrayBufferView::kInternalFieldCount); |
1041 for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) { | 1041 for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) { |
1042 holder->SetInternalField(i, Smi::FromInt(0)); | 1042 holder->SetInternalField(i, Smi::FromInt(0)); |
1043 } | 1043 } |
1044 | 1044 |
1045 ExternalArrayType array_type = kExternalInt8Array; // Bogus initialization. | 1045 ExternalArrayType array_type = kExternalInt8Array; // Bogus initialization. |
1046 size_t element_size = 1; // Bogus initialization. | 1046 size_t element_size = 1; // Bogus initialization. |
1047 ElementsKind external_elements_kind; | 1047 ElementsKind external_elements_kind = EXTERNAL_INT8_ELEMENTS; // Bogus |
1048 ElementsKind fixed_elements_kind; | 1048 ElementsKind fixed_elements_kind = INT8_ELEMENTS; // Bogus initialization. |
1049 Runtime::ArrayIdToTypeAndSize(arrayId, | 1049 Runtime::ArrayIdToTypeAndSize(arrayId, |
1050 &array_type, | 1050 &array_type, |
1051 &external_elements_kind, | 1051 &external_elements_kind, |
1052 &fixed_elements_kind, | 1052 &fixed_elements_kind, |
1053 &element_size); | 1053 &element_size); |
1054 | 1054 |
1055 Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer(); | 1055 Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer(); |
1056 if (source->IsJSTypedArray() && | 1056 if (source->IsJSTypedArray() && |
1057 JSTypedArray::cast(*source)->type() == array_type) { | 1057 JSTypedArray::cast(*source)->type() == array_type) { |
1058 length_obj = Handle<Object>(JSTypedArray::cast(*source)->length(), isolate); | 1058 length_obj = Handle<Object>(JSTypedArray::cast(*source)->length(), isolate); |
(...skipping 14115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15174 } | 15174 } |
15175 } | 15175 } |
15176 | 15176 |
15177 | 15177 |
15178 void Runtime::OutOfMemory() { | 15178 void Runtime::OutOfMemory() { |
15179 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); | 15179 Heap::FatalProcessOutOfMemory("CALL_AND_RETRY_LAST", true); |
15180 UNREACHABLE(); | 15180 UNREACHABLE(); |
15181 } | 15181 } |
15182 | 15182 |
15183 } } // namespace v8::internal | 15183 } } // namespace v8::internal |
OLD | NEW |