| 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 13918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13929 NONE)); | 13929 NONE)); |
| 13930 output->set(i, *result); | 13930 output->set(i, *result); |
| 13931 } | 13931 } |
| 13932 | 13932 |
| 13933 Handle<JSArray> result = isolate->factory()->NewJSArrayWithElements(output); | 13933 Handle<JSArray> result = isolate->factory()->NewJSArrayWithElements(output); |
| 13934 result->set_length(Smi::FromInt(length)); | 13934 result->set_length(Smi::FromInt(length)); |
| 13935 return *result; | 13935 return *result; |
| 13936 } | 13936 } |
| 13937 | 13937 |
| 13938 | 13938 |
| 13939 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsInitializedIntlObject) { | |
| 13940 HandleScope scope(isolate); | |
| 13941 | |
| 13942 ASSERT(args.length() == 1); | |
| 13943 | |
| 13944 CONVERT_ARG_HANDLE_CHECKED(JSObject, input, 0); | |
| 13945 | |
| 13946 Handle<String> marker = isolate->factory()->intl_initialized_marker_string(); | |
| 13947 Handle<Object> tag(input->GetHiddenProperty(*marker), isolate); | |
| 13948 return isolate->heap()->ToBoolean(!tag->IsTheHole()); | |
| 13949 } | |
| 13950 | |
| 13951 | |
| 13952 RUNTIME_FUNCTION(MaybeObject*, Runtime_IsInitializedIntlObjectOfType) { | |
| 13953 HandleScope scope(isolate); | |
| 13954 | |
| 13955 ASSERT(args.length() == 2); | |
| 13956 | |
| 13957 CONVERT_ARG_HANDLE_CHECKED(JSObject, input, 0); | |
| 13958 CONVERT_ARG_HANDLE_CHECKED(String, expected_type, 1); | |
| 13959 | |
| 13960 | |
| 13961 Handle<String> marker = isolate->factory()->intl_initialized_marker_string(); | |
| 13962 Handle<Object> tag(input->GetHiddenProperty(*marker), isolate); | |
| 13963 return isolate->heap()->ToBoolean( | |
| 13964 tag->IsString() && String::cast(*tag)->Equals(*expected_type)); | |
| 13965 } | |
| 13966 | |
| 13967 | |
| 13968 RUNTIME_FUNCTION(MaybeObject*, Runtime_MarkAsInitializedIntlObjectOfType) { | |
| 13969 HandleScope scope(isolate); | |
| 13970 | |
| 13971 ASSERT(args.length() == 3); | |
| 13972 | |
| 13973 CONVERT_ARG_HANDLE_CHECKED(JSObject, input, 0); | |
| 13974 CONVERT_ARG_HANDLE_CHECKED(String, type, 1); | |
| 13975 CONVERT_ARG_HANDLE_CHECKED(JSObject, impl, 2); | |
| 13976 | |
| 13977 Handle<String> marker = isolate->factory()->intl_initialized_marker_string(); | |
| 13978 JSObject::SetHiddenProperty(input, marker, type); | |
| 13979 | |
| 13980 marker = isolate->factory()->intl_impl_object_string(); | |
| 13981 JSObject::SetHiddenProperty(input, marker, impl); | |
| 13982 | |
| 13983 return isolate->heap()->undefined_value(); | |
| 13984 } | |
| 13985 | |
| 13986 | |
| 13987 RUNTIME_FUNCTION(MaybeObject*, Runtime_GetImplFromInitializedIntlObject) { | |
| 13988 HandleScope scope(isolate); | |
| 13989 | |
| 13990 ASSERT(args.length() == 1); | |
| 13991 | |
| 13992 CONVERT_ARG_HANDLE_CHECKED(JSObject, input, 0); | |
| 13993 | |
| 13994 Handle<String> marker = isolate->factory()->intl_impl_object_string(); | |
| 13995 Handle<Object> impl(input->GetHiddenProperty(*marker), isolate); | |
| 13996 if (impl->IsTheHole()) return isolate->heap()->undefined_value(); | |
| 13997 return *impl; | |
| 13998 } | |
| 13999 | |
| 14000 | |
| 14001 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateDateTimeFormat) { | 13939 RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateDateTimeFormat) { |
| 14002 HandleScope scope(isolate); | 13940 HandleScope scope(isolate); |
| 14003 | 13941 |
| 14004 ASSERT(args.length() == 3); | 13942 ASSERT(args.length() == 3); |
| 14005 | 13943 |
| 14006 CONVERT_ARG_HANDLE_CHECKED(String, locale, 0); | 13944 CONVERT_ARG_HANDLE_CHECKED(String, locale, 0); |
| 14007 CONVERT_ARG_HANDLE_CHECKED(JSObject, options, 1); | 13945 CONVERT_ARG_HANDLE_CHECKED(JSObject, options, 1); |
| 14008 CONVERT_ARG_HANDLE_CHECKED(JSObject, resolved, 2); | 13946 CONVERT_ARG_HANDLE_CHECKED(JSObject, resolved, 2); |
| 14009 | 13947 |
| 14010 Handle<ObjectTemplateInfo> date_format_template = | 13948 Handle<ObjectTemplateInfo> date_format_template = |
| (...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15231 // Handle last resort GC and make sure to allow future allocations | 15169 // Handle last resort GC and make sure to allow future allocations |
| 15232 // to grow the heap without causing GCs (if possible). | 15170 // to grow the heap without causing GCs (if possible). |
| 15233 isolate->counters()->gc_last_resort_from_js()->Increment(); | 15171 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 15234 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 15172 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
| 15235 "Runtime::PerformGC"); | 15173 "Runtime::PerformGC"); |
| 15236 } | 15174 } |
| 15237 } | 15175 } |
| 15238 | 15176 |
| 15239 | 15177 |
| 15240 } } // namespace v8::internal | 15178 } } // namespace v8::internal |
| OLD | NEW |