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 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 CONVERT_ARG_CHECKED(Object, object, 0); | 863 CONVERT_ARG_CHECKED(Object, object, 0); |
864 return object->IsJSArrayBufferView() | 864 return object->IsJSArrayBufferView() |
865 ? isolate->heap()->true_value() | 865 ? isolate->heap()->true_value() |
866 : isolate->heap()->false_value(); | 866 : isolate->heap()->false_value(); |
867 } | 867 } |
868 | 868 |
869 | 869 |
870 void Runtime::ArrayIdToTypeAndSize( | 870 void Runtime::ArrayIdToTypeAndSize( |
871 int arrayId, ExternalArrayType* array_type, size_t* element_size) { | 871 int arrayId, ExternalArrayType* array_type, size_t* element_size) { |
872 switch (arrayId) { | 872 switch (arrayId) { |
873 case ARRAY_ID_UINT8: | 873 #define ARRAY_ID_CASE(Type, type, TYPE, ctype, size) \ |
874 *array_type = kExternalUnsignedByteArray; | 874 case ARRAY_ID_##TYPE: \ |
875 *element_size = 1; | 875 *array_type = kExternal##Type##Array; \ |
| 876 *element_size = size; \ |
876 break; | 877 break; |
877 case ARRAY_ID_INT8: | 878 |
878 *array_type = kExternalByteArray; | 879 TYPED_ARRAYS(ARRAY_ID_CASE) |
879 *element_size = 1; | 880 #undef ARRAY_ID_CASE |
880 break; | 881 |
881 case ARRAY_ID_UINT16: | |
882 *array_type = kExternalUnsignedShortArray; | |
883 *element_size = 2; | |
884 break; | |
885 case ARRAY_ID_INT16: | |
886 *array_type = kExternalShortArray; | |
887 *element_size = 2; | |
888 break; | |
889 case ARRAY_ID_UINT32: | |
890 *array_type = kExternalUnsignedIntArray; | |
891 *element_size = 4; | |
892 break; | |
893 case ARRAY_ID_INT32: | |
894 *array_type = kExternalIntArray; | |
895 *element_size = 4; | |
896 break; | |
897 case ARRAY_ID_FLOAT32: | |
898 *array_type = kExternalFloatArray; | |
899 *element_size = 4; | |
900 break; | |
901 case ARRAY_ID_FLOAT64: | |
902 *array_type = kExternalDoubleArray; | |
903 *element_size = 8; | |
904 break; | |
905 case ARRAY_ID_UINT8C: | |
906 *array_type = kExternalPixelArray; | |
907 *element_size = 1; | |
908 break; | |
909 default: | 882 default: |
910 UNREACHABLE(); | 883 UNREACHABLE(); |
911 } | 884 } |
912 } | 885 } |
913 | 886 |
914 | 887 |
915 RUNTIME_FUNCTION(MaybeObject*, Runtime_TypedArrayInitialize) { | 888 RUNTIME_FUNCTION(MaybeObject*, Runtime_TypedArrayInitialize) { |
916 HandleScope scope(isolate); | 889 HandleScope scope(isolate); |
917 ASSERT(args.length() == 5); | 890 ASSERT(args.length() == 5); |
918 CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, holder, 0); | 891 CONVERT_ARG_HANDLE_CHECKED(JSTypedArray, holder, 0); |
919 CONVERT_SMI_ARG_CHECKED(arrayId, 1); | 892 CONVERT_SMI_ARG_CHECKED(arrayId, 1); |
920 CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, buffer, 2); | 893 CONVERT_ARG_HANDLE_CHECKED(JSArrayBuffer, buffer, 2); |
921 CONVERT_ARG_HANDLE_CHECKED(Object, byte_offset_object, 3); | 894 CONVERT_ARG_HANDLE_CHECKED(Object, byte_offset_object, 3); |
922 CONVERT_ARG_HANDLE_CHECKED(Object, byte_length_object, 4); | 895 CONVERT_ARG_HANDLE_CHECKED(Object, byte_length_object, 4); |
923 | 896 |
924 ASSERT(holder->GetInternalFieldCount() == | 897 ASSERT(holder->GetInternalFieldCount() == |
925 v8::ArrayBufferView::kInternalFieldCount); | 898 v8::ArrayBufferView::kInternalFieldCount); |
926 for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) { | 899 for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) { |
927 holder->SetInternalField(i, Smi::FromInt(0)); | 900 holder->SetInternalField(i, Smi::FromInt(0)); |
928 } | 901 } |
929 | 902 |
930 ExternalArrayType array_type = kExternalByteArray; // Bogus initialization. | 903 ExternalArrayType array_type = kExternalInt8Array; // Bogus initialization. |
931 size_t element_size = 1; // Bogus initialization. | 904 size_t element_size = 1; // Bogus initialization. |
932 Runtime::ArrayIdToTypeAndSize(arrayId, &array_type, &element_size); | 905 Runtime::ArrayIdToTypeAndSize(arrayId, &array_type, &element_size); |
933 | 906 |
934 holder->set_buffer(*buffer); | 907 holder->set_buffer(*buffer); |
935 holder->set_byte_offset(*byte_offset_object); | 908 holder->set_byte_offset(*byte_offset_object); |
936 holder->set_byte_length(*byte_length_object); | 909 holder->set_byte_length(*byte_length_object); |
937 | 910 |
938 size_t byte_offset = NumberToSize(isolate, *byte_offset_object); | 911 size_t byte_offset = NumberToSize(isolate, *byte_offset_object); |
939 size_t byte_length = NumberToSize(isolate, *byte_length_object); | 912 size_t byte_length = NumberToSize(isolate, *byte_length_object); |
940 ASSERT(byte_length % element_size == 0); | 913 ASSERT(byte_length % element_size == 0); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 CONVERT_SMI_ARG_CHECKED(arrayId, 1); | 945 CONVERT_SMI_ARG_CHECKED(arrayId, 1); |
973 CONVERT_ARG_HANDLE_CHECKED(Object, source, 2); | 946 CONVERT_ARG_HANDLE_CHECKED(Object, source, 2); |
974 CONVERT_ARG_HANDLE_CHECKED(Object, length_obj, 3); | 947 CONVERT_ARG_HANDLE_CHECKED(Object, length_obj, 3); |
975 | 948 |
976 ASSERT(holder->GetInternalFieldCount() == | 949 ASSERT(holder->GetInternalFieldCount() == |
977 v8::ArrayBufferView::kInternalFieldCount); | 950 v8::ArrayBufferView::kInternalFieldCount); |
978 for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) { | 951 for (int i = 0; i < v8::ArrayBufferView::kInternalFieldCount; i++) { |
979 holder->SetInternalField(i, Smi::FromInt(0)); | 952 holder->SetInternalField(i, Smi::FromInt(0)); |
980 } | 953 } |
981 | 954 |
982 ExternalArrayType array_type = kExternalByteArray; // Bogus initialization. | 955 ExternalArrayType array_type = kExternalInt8Array; // Bogus initialization. |
983 size_t element_size = 1; // Bogus initialization. | 956 size_t element_size = 1; // Bogus initialization. |
984 Runtime::ArrayIdToTypeAndSize(arrayId, &array_type, &element_size); | 957 Runtime::ArrayIdToTypeAndSize(arrayId, &array_type, &element_size); |
985 | 958 |
986 Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer(); | 959 Handle<JSArrayBuffer> buffer = isolate->factory()->NewJSArrayBuffer(); |
987 size_t length = NumberToSize(isolate, *length_obj); | 960 size_t length = NumberToSize(isolate, *length_obj); |
988 | 961 |
989 if ((length > static_cast<unsigned>(Smi::kMaxValue)) || | 962 if ((length > static_cast<unsigned>(Smi::kMaxValue)) || |
990 (length > (kMaxInt / element_size))) { | 963 (length > (kMaxInt / element_size))) { |
991 return isolate->Throw(*isolate->factory()-> | 964 return isolate->Throw(*isolate->factory()-> |
992 NewRangeError("invalid_typed_array_length", | 965 NewRangeError("invalid_typed_array_length", |
(...skipping 9003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9996 int capacity = dictionary->Capacity(); | 9969 int capacity = dictionary->Capacity(); |
9997 for (int i = 0; i < capacity; i++) { | 9970 for (int i = 0; i < capacity; i++) { |
9998 Handle<Object> key(dictionary->KeyAt(i), array->GetIsolate()); | 9971 Handle<Object> key(dictionary->KeyAt(i), array->GetIsolate()); |
9999 if (dictionary->IsKey(*key)) { | 9972 if (dictionary->IsKey(*key)) { |
10000 element_count++; | 9973 element_count++; |
10001 } | 9974 } |
10002 } | 9975 } |
10003 break; | 9976 break; |
10004 } | 9977 } |
10005 case NON_STRICT_ARGUMENTS_ELEMENTS: | 9978 case NON_STRICT_ARGUMENTS_ELEMENTS: |
10006 case EXTERNAL_BYTE_ELEMENTS: | 9979 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
10007 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 9980 case EXTERNAL_##TYPE##_ELEMENTS: \ |
10008 case EXTERNAL_SHORT_ELEMENTS: | 9981 case TYPE##_ELEMENTS: \ |
10009 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: | 9982 |
10010 case EXTERNAL_INT_ELEMENTS: | 9983 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
10011 case EXTERNAL_UNSIGNED_INT_ELEMENTS: | 9984 #undef TYPED_ARRAY_CASE |
10012 case EXTERNAL_FLOAT_ELEMENTS: | |
10013 case EXTERNAL_DOUBLE_ELEMENTS: | |
10014 case EXTERNAL_PIXEL_ELEMENTS: | |
10015 case UINT8_ELEMENTS: | |
10016 case INT8_ELEMENTS: | |
10017 case UINT16_ELEMENTS: | |
10018 case INT16_ELEMENTS: | |
10019 case UINT32_ELEMENTS: | |
10020 case INT32_ELEMENTS: | |
10021 case FLOAT32_ELEMENTS: | |
10022 case FLOAT64_ELEMENTS: | |
10023 case UINT8_CLAMPED_ELEMENTS: | |
10024 // External arrays are always dense. | 9985 // External arrays are always dense. |
10025 return length; | 9986 return length; |
10026 } | 9987 } |
10027 // As an estimate, we assume that the prototype doesn't contain any | 9988 // As an estimate, we assume that the prototype doesn't contain any |
10028 // inherited elements. | 9989 // inherited elements. |
10029 return element_count; | 9990 return element_count; |
10030 } | 9991 } |
10031 | 9992 |
10032 | 9993 |
10033 | 9994 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10121 if (index < range) { | 10082 if (index < range) { |
10122 indices->Add(index); | 10083 indices->Add(index); |
10123 } | 10084 } |
10124 } | 10085 } |
10125 } | 10086 } |
10126 break; | 10087 break; |
10127 } | 10088 } |
10128 default: { | 10089 default: { |
10129 int dense_elements_length; | 10090 int dense_elements_length; |
10130 switch (kind) { | 10091 switch (kind) { |
10131 case EXTERNAL_PIXEL_ELEMENTS: { | 10092 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
10132 dense_elements_length = | 10093 case EXTERNAL_##TYPE##_ELEMENTS: { \ |
10133 ExternalPixelArray::cast(object->elements())->length(); | 10094 dense_elements_length = \ |
10134 break; | 10095 External##Type##Array::cast(object->elements())->length(); \ |
| 10096 break; \ |
10135 } | 10097 } |
10136 case EXTERNAL_BYTE_ELEMENTS: { | 10098 |
10137 dense_elements_length = | 10099 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
10138 ExternalByteArray::cast(object->elements())->length(); | 10100 #undef TYPED_ARRAY_CASE |
10139 break; | 10101 |
10140 } | |
10141 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: { | |
10142 dense_elements_length = | |
10143 ExternalUnsignedByteArray::cast(object->elements())->length(); | |
10144 break; | |
10145 } | |
10146 case EXTERNAL_SHORT_ELEMENTS: { | |
10147 dense_elements_length = | |
10148 ExternalShortArray::cast(object->elements())->length(); | |
10149 break; | |
10150 } | |
10151 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: { | |
10152 dense_elements_length = | |
10153 ExternalUnsignedShortArray::cast(object->elements())->length(); | |
10154 break; | |
10155 } | |
10156 case EXTERNAL_INT_ELEMENTS: { | |
10157 dense_elements_length = | |
10158 ExternalIntArray::cast(object->elements())->length(); | |
10159 break; | |
10160 } | |
10161 case EXTERNAL_UNSIGNED_INT_ELEMENTS: { | |
10162 dense_elements_length = | |
10163 ExternalUnsignedIntArray::cast(object->elements())->length(); | |
10164 break; | |
10165 } | |
10166 case EXTERNAL_FLOAT_ELEMENTS: { | |
10167 dense_elements_length = | |
10168 ExternalFloatArray::cast(object->elements())->length(); | |
10169 break; | |
10170 } | |
10171 case EXTERNAL_DOUBLE_ELEMENTS: { | |
10172 dense_elements_length = | |
10173 ExternalDoubleArray::cast(object->elements())->length(); | |
10174 break; | |
10175 } | |
10176 default: | 10102 default: |
10177 UNREACHABLE(); | 10103 UNREACHABLE(); |
10178 dense_elements_length = 0; | 10104 dense_elements_length = 0; |
10179 break; | 10105 break; |
10180 } | 10106 } |
10181 uint32_t length = static_cast<uint32_t>(dense_elements_length); | 10107 uint32_t length = static_cast<uint32_t>(dense_elements_length); |
10182 if (range <= length) { | 10108 if (range <= length) { |
10183 length = range; | 10109 length = range; |
10184 // We will add all indices, so we might as well clear it first | 10110 // We will add all indices, so we might as well clear it first |
10185 // and avoid duplicates. | 10111 // and avoid duplicates. |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10282 Handle<Object> element = Object::GetElement(isolate, receiver, index); | 10208 Handle<Object> element = Object::GetElement(isolate, receiver, index); |
10283 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, element, false); | 10209 RETURN_IF_EMPTY_HANDLE_VALUE(isolate, element, false); |
10284 visitor->visit(index, element); | 10210 visitor->visit(index, element); |
10285 // Skip to next different index (i.e., omit duplicates). | 10211 // Skip to next different index (i.e., omit duplicates). |
10286 do { | 10212 do { |
10287 j++; | 10213 j++; |
10288 } while (j < n && indices[j] == index); | 10214 } while (j < n && indices[j] == index); |
10289 } | 10215 } |
10290 break; | 10216 break; |
10291 } | 10217 } |
10292 case EXTERNAL_PIXEL_ELEMENTS: { | 10218 case EXTERNAL_UINT8_CLAMPED_ELEMENTS: { |
10293 Handle<ExternalPixelArray> pixels(ExternalPixelArray::cast( | 10219 Handle<ExternalUint8ClampedArray> pixels(ExternalUint8ClampedArray::cast( |
10294 receiver->elements())); | 10220 receiver->elements())); |
10295 for (uint32_t j = 0; j < length; j++) { | 10221 for (uint32_t j = 0; j < length; j++) { |
10296 Handle<Smi> e(Smi::FromInt(pixels->get_scalar(j)), isolate); | 10222 Handle<Smi> e(Smi::FromInt(pixels->get_scalar(j)), isolate); |
10297 visitor->visit(j, e); | 10223 visitor->visit(j, e); |
10298 } | 10224 } |
10299 break; | 10225 break; |
10300 } | 10226 } |
10301 case EXTERNAL_BYTE_ELEMENTS: { | 10227 case EXTERNAL_INT8_ELEMENTS: { |
10302 IterateExternalArrayElements<ExternalByteArray, int8_t>( | 10228 IterateExternalArrayElements<ExternalInt8Array, int8_t>( |
10303 isolate, receiver, true, true, visitor); | 10229 isolate, receiver, true, true, visitor); |
10304 break; | 10230 break; |
10305 } | 10231 } |
10306 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: { | 10232 case EXTERNAL_UINT8_ELEMENTS: { |
10307 IterateExternalArrayElements<ExternalUnsignedByteArray, uint8_t>( | 10233 IterateExternalArrayElements<ExternalUint8Array, uint8_t>( |
10308 isolate, receiver, true, true, visitor); | 10234 isolate, receiver, true, true, visitor); |
10309 break; | 10235 break; |
10310 } | 10236 } |
10311 case EXTERNAL_SHORT_ELEMENTS: { | 10237 case EXTERNAL_INT16_ELEMENTS: { |
10312 IterateExternalArrayElements<ExternalShortArray, int16_t>( | 10238 IterateExternalArrayElements<ExternalInt16Array, int16_t>( |
10313 isolate, receiver, true, true, visitor); | 10239 isolate, receiver, true, true, visitor); |
10314 break; | 10240 break; |
10315 } | 10241 } |
10316 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: { | 10242 case EXTERNAL_UINT16_ELEMENTS: { |
10317 IterateExternalArrayElements<ExternalUnsignedShortArray, uint16_t>( | 10243 IterateExternalArrayElements<ExternalUint16Array, uint16_t>( |
10318 isolate, receiver, true, true, visitor); | 10244 isolate, receiver, true, true, visitor); |
10319 break; | 10245 break; |
10320 } | 10246 } |
10321 case EXTERNAL_INT_ELEMENTS: { | 10247 case EXTERNAL_INT32_ELEMENTS: { |
10322 IterateExternalArrayElements<ExternalIntArray, int32_t>( | 10248 IterateExternalArrayElements<ExternalInt32Array, int32_t>( |
10323 isolate, receiver, true, false, visitor); | 10249 isolate, receiver, true, false, visitor); |
10324 break; | 10250 break; |
10325 } | 10251 } |
10326 case EXTERNAL_UNSIGNED_INT_ELEMENTS: { | 10252 case EXTERNAL_UINT32_ELEMENTS: { |
10327 IterateExternalArrayElements<ExternalUnsignedIntArray, uint32_t>( | 10253 IterateExternalArrayElements<ExternalUint32Array, uint32_t>( |
10328 isolate, receiver, true, false, visitor); | 10254 isolate, receiver, true, false, visitor); |
10329 break; | 10255 break; |
10330 } | 10256 } |
10331 case EXTERNAL_FLOAT_ELEMENTS: { | 10257 case EXTERNAL_FLOAT32_ELEMENTS: { |
10332 IterateExternalArrayElements<ExternalFloatArray, float>( | 10258 IterateExternalArrayElements<ExternalFloat32Array, float>( |
10333 isolate, receiver, false, false, visitor); | 10259 isolate, receiver, false, false, visitor); |
10334 break; | 10260 break; |
10335 } | 10261 } |
10336 case EXTERNAL_DOUBLE_ELEMENTS: { | 10262 case EXTERNAL_FLOAT64_ELEMENTS: { |
10337 IterateExternalArrayElements<ExternalDoubleArray, double>( | 10263 IterateExternalArrayElements<ExternalFloat64Array, double>( |
10338 isolate, receiver, false, false, visitor); | 10264 isolate, receiver, false, false, visitor); |
10339 break; | 10265 break; |
10340 } | 10266 } |
10341 default: | 10267 default: |
10342 UNREACHABLE(); | 10268 UNREACHABLE(); |
10343 break; | 10269 break; |
10344 } | 10270 } |
10345 visitor->increase_index_offset(length); | 10271 visitor->increase_index_offset(length); |
10346 return true; | 10272 return true; |
10347 } | 10273 } |
(...skipping 4197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14545 return isolate->heap()->ToBoolean(obj->Has##Name()); \ | 14471 return isolate->heap()->ToBoolean(obj->Has##Name()); \ |
14546 } | 14472 } |
14547 | 14473 |
14548 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiElements) | 14474 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiElements) |
14549 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastObjectElements) | 14475 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastObjectElements) |
14550 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiOrObjectElements) | 14476 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastSmiOrObjectElements) |
14551 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastDoubleElements) | 14477 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastDoubleElements) |
14552 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastHoleyElements) | 14478 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastHoleyElements) |
14553 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(DictionaryElements) | 14479 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(DictionaryElements) |
14554 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(NonStrictArgumentsElements) | 14480 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(NonStrictArgumentsElements) |
14555 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalPixelElements) | |
14556 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalArrayElements) | 14481 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalArrayElements) |
14557 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalByteElements) | |
14558 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalUnsignedByteElements) | |
14559 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalShortElements) | |
14560 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalUnsignedShortElements) | |
14561 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalIntElements) | |
14562 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalUnsignedIntElements) | |
14563 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalFloatElements) | |
14564 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(ExternalDoubleElements) | |
14565 // Properties test sitting with elements tests - not fooling anyone. | 14482 // Properties test sitting with elements tests - not fooling anyone. |
14566 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastProperties) | 14483 ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION(FastProperties) |
14567 | 14484 |
14568 #undef ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION | 14485 #undef ELEMENTS_KIND_CHECK_RUNTIME_FUNCTION |
14569 | 14486 |
14570 | 14487 |
| 14488 #define TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION(Type, type, TYPE, ctype, size) \ |
| 14489 RUNTIME_FUNCTION(MaybeObject*, Runtime_HasExternal##Type##Elements) { \ |
| 14490 CONVERT_ARG_CHECKED(JSObject, obj, 0); \ |
| 14491 return isolate->heap()->ToBoolean(obj->HasExternal##Type##Elements()); \ |
| 14492 } |
| 14493 |
| 14494 TYPED_ARRAYS(TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION) |
| 14495 |
| 14496 #undef TYPED_ARRAYS_CHECK_RUNTIME_FUNCTION |
| 14497 |
| 14498 |
14571 RUNTIME_FUNCTION(MaybeObject*, Runtime_HaveSameMap) { | 14499 RUNTIME_FUNCTION(MaybeObject*, Runtime_HaveSameMap) { |
14572 SealHandleScope shs(isolate); | 14500 SealHandleScope shs(isolate); |
14573 ASSERT(args.length() == 2); | 14501 ASSERT(args.length() == 2); |
14574 CONVERT_ARG_CHECKED(JSObject, obj1, 0); | 14502 CONVERT_ARG_CHECKED(JSObject, obj1, 0); |
14575 CONVERT_ARG_CHECKED(JSObject, obj2, 1); | 14503 CONVERT_ARG_CHECKED(JSObject, obj2, 1); |
14576 return isolate->heap()->ToBoolean(obj1->map() == obj2->map()); | 14504 return isolate->heap()->ToBoolean(obj1->map() == obj2->map()); |
14577 } | 14505 } |
14578 | 14506 |
14579 | 14507 |
14580 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsAccessCheckNeeded) { | 14508 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsAccessCheckNeeded) { |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14900 // Handle last resort GC and make sure to allow future allocations | 14828 // Handle last resort GC and make sure to allow future allocations |
14901 // to grow the heap without causing GCs (if possible). | 14829 // to grow the heap without causing GCs (if possible). |
14902 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14830 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14903 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14831 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14904 "Runtime::PerformGC"); | 14832 "Runtime::PerformGC"); |
14905 } | 14833 } |
14906 } | 14834 } |
14907 | 14835 |
14908 | 14836 |
14909 } } // namespace v8::internal | 14837 } } // namespace v8::internal |
OLD | NEW |